faLaplacianScheme.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 Wikki Ltd
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fa::laplacianScheme
28 
29 Description
30  Abstract base class for finite area calculus laplacian schemes.
31 
32 SourceFiles
33  faLaplacianScheme.C
34  faLaplacianSchemes.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef faLaplacianScheme_H
39 #define faLaplacianScheme_H
40 
41 #include "tmp.H"
42 #include "areaFieldsFwd.H"
43 #include "edgeFieldsFwd.H"
45 #include "correctedLnGrad.H"
46 #include "typeInfo.H"
47 #include "runTimeSelectionTables.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 template<class Type>
55 class faMatrix;
56 
57 class faMesh;
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace fa
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class laplacianScheme Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class Type>
69 class laplacianScheme
70 :
71  public refCount
72 {
73 
74 protected:
75 
76  // Protected data
77 
78  const faMesh& mesh_;
81 
82 
83  // Private Member Functions
84 
85  //- No copy construct
86  laplacianScheme(const laplacianScheme&) = delete;
87 
88  //- No copy assignment
89  void operator=(const laplacianScheme&) = delete;
90 
91 
92 public:
93 
94  // Declare run-time constructor selection tables
95 
97  (
98  tmp,
100  Istream,
101  (const faMesh& mesh, Istream& schemeData),
102  (mesh, schemeData)
103  );
104 
105 
106  // Constructors
107 
108  //- Construct from mesh
109  laplacianScheme(const faMesh& mesh)
110  :
111  mesh_(mesh),
114  {}
115 
116  //- Construct from mesh and Istream
117  laplacianScheme(const faMesh& mesh, Istream& is)
118  :
119  mesh_(mesh),
120  tinterpGammaScheme_(nullptr),
121  tlnGradScheme_(nullptr)
122  {
123  if (is.eof())
124  {
126  (
128  );
129 
131  (
133  );
134  }
135  else
136  {
138  (
140  );
141 
143  (
145  );
146  }
147  }
148 
149 
150  // Selectors
151 
152  //- Return a pointer to a new laplacianScheme created on freestore
154  (
155  const faMesh& mesh,
156  Istream& schemeData
157  );
158 
159 
160  //- Destructor
161  virtual ~laplacianScheme();
162 
163 
164  // Member Functions
165 
166  //- Return mesh reference
167  const faMesh& mesh() const
168  {
169  return mesh_;
170  }
171 
173  (
174  const edgeScalarField&,
176  ) = 0;
177 
179  (
180  const areaScalarField&,
182  );
183 
185  (
187  ) = 0;
188 
190  (
191  const edgeScalarField&,
193  ) = 0;
194 
196  (
197  const areaScalarField&,
199  );
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace fa
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 // Add the patch constructor functions to the hash tables
214 
215 #define makeFaLaplacianTypeScheme(SS, Type) \
216  \
217  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
218  \
219  namespace Foam \
220  { \
221  namespace fa \
222  { \
223  laplacianScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
224  add##SS##Type##IstreamConstructorToTable_; \
225  } \
226  }
227 
228 
229 #define makeFaLaplacianScheme(SS) \
230  \
231 makeFaLaplacianTypeScheme(SS, scalar) \
232 makeFaLaplacianTypeScheme(SS, vector) \
233 makeFaLaplacianTypeScheme(SS, tensor)
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #ifdef NoRepository
239  #include "faLaplacianScheme.C"
240 #endif
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
typeInfo.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
faLaplacianScheme.C
Foam::fa::laplacianScheme
Abstract base class for finite area calculus laplacian schemes.
Definition: faLaplacianScheme.H:68
Foam::fa::laplacianScheme::New
static tmp< laplacianScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new laplacianScheme created on freestore.
Definition: faLaplacianScheme.C:47
Foam::fa::laplacianScheme::tlnGradScheme_
tmp< lnGradScheme< Type > > tlnGradScheme_
Definition: faLaplacianScheme.H:79
Foam::fa::laplacianScheme::famLaplacian
virtual tmp< faMatrix< Type > > famLaplacian(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &)=0
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fa::laplacianScheme::operator=
void operator=(const laplacianScheme &)=delete
No copy assignment.
areaFieldsFwd.H
Forwards and collection of common area field types.
Foam::IOstream::eof
bool eof() const noexcept
True if end of input seen.
Definition: IOstream.H:239
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fa::laplacianScheme::~laplacianScheme
virtual ~laplacianScheme()
Destructor.
Definition: faLaplacianScheme.C:90
Foam::fa::laplacianScheme::declareRunTimeSelectionTable
declareRunTimeSelectionTable(tmp, laplacianScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
Foam::fa::laplacianScheme::laplacianScheme
laplacianScheme(const faMesh &mesh)
Construct from mesh.
Definition: faLaplacianScheme.H:108
Foam::fa::correctedLnGrad
Simple central-difference lnGrad scheme with non-orthogonal correction.
Definition: correctedLnGrad.H:56
tmp.H
Foam::fa::lnGradScheme::New
static tmp< lnGradScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: lnGradScheme.C:49
Foam::fa::laplacianScheme::laplacianScheme
laplacianScheme(const laplacianScheme &)=delete
No copy construct.
linearEdgeInterpolation.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::fa::laplacianScheme::mesh_
const faMesh & mesh_
Definition: faLaplacianScheme.H:77
correctedLnGrad.H
Foam::linearEdgeInterpolation
Central-differencing interpolation scheme class.
Definition: linearEdgeInterpolation.H:52
Foam::fa::laplacianScheme::facLaplacian
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facLaplacian(const GeometricField< Type, faPatchField, areaMesh > &)=0
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::fa::laplacianScheme::tinterpGammaScheme_
tmp< edgeInterpolationScheme< scalar > > tinterpGammaScheme_
Definition: faLaplacianScheme.H:78
Foam::fa::laplacianScheme::laplacianScheme
laplacianScheme(const faMesh &mesh, Istream &is)
Construct from mesh and Istream.
Definition: faLaplacianScheme.H:116
Foam::GeometricField< scalar, faePatchField, edgeMesh >
edgeFieldsFwd.H
Forwards for edge field types.
Foam::fa::laplacianScheme::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: faLaplacianScheme.H:166
Foam::edgeInterpolationScheme::New
static tmp< edgeInterpolationScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: edgeInterpolationScheme.C:41