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 Foam_faLaplacianScheme_H
39 #define Foam_faLaplacianScheme_H
40 
41 #include "areaFieldsFwd.H"
42 #include "edgeFieldsFwd.H"
43 #include "correctedLnGrad.H"
44 #include "runTimeSelectionTables.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 template<class Type> class faMatrix;
53 class faMesh;
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace fa
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class laplacianScheme Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
65 class laplacianScheme
66 :
67  public refCount
68 {
69 protected:
70 
71  // Protected Data
72 
73  const faMesh& mesh_;
74 
77 
78 
79 public:
80 
81  // Declare run-time constructor selection tables
82 
84  (
85  tmp,
87  Istream,
88  (const faMesh& mesh, Istream& schemeData),
89  (mesh, schemeData)
90  );
91 
92 
93  // Generated Methods
94 
95  //- No copy construct
96  laplacianScheme(const laplacianScheme&) = delete;
97 
98  //- No copy assignment
99  void operator=(const laplacianScheme&) = delete;
100 
101 
102  // Constructors
103 
104  //- Construct from mesh
105  laplacianScheme(const faMesh& mesh)
106  :
107  mesh_(mesh),
110  {}
111 
112  //- Construct from mesh and Istream
113  laplacianScheme(const faMesh& mesh, Istream& is)
114  :
115  mesh_(mesh)
116  {
117  if (is.eof())
118  {
119  tinterpGammaScheme_.reset
120  (
122  );
123 
124  tlnGradScheme_.reset
125  (
127  );
128  }
129  else
130  {
131  tinterpGammaScheme_.reset
132  (
134  );
135 
136  tlnGradScheme_.reset
137  (
139  );
140  }
141  }
142 
143 
144  // Selectors
145 
146  //- Return a pointer to a new laplacianScheme created on freestore
148  (
149  const faMesh& mesh,
150  Istream& schemeData
151  );
152 
153 
154  //- Destructor
155  virtual ~laplacianScheme();
156 
157 
158  // Member Functions
159 
160  //- Return mesh reference
161  const faMesh& mesh() const
162  {
163  return mesh_;
164  }
165 
167  (
168  const edgeScalarField&,
170  ) = 0;
171 
173  (
174  const areaScalarField&,
176  );
177 
179  (
181  ) = 0;
182 
184  (
185  const edgeScalarField&,
187  ) = 0;
188 
190  (
191  const areaScalarField&,
193  );
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace fa
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 // Add the patch constructor functions to the hash tables
208 
209 #define makeFaLaplacianTypeScheme(SS, Type) \
210  \
211  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
212  \
213  namespace Foam \
214  { \
215  namespace fa \
216  { \
217  laplacianScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
218  add##SS##Type##IstreamConstructorToTable_; \
219  } \
220  }
221 
222 
223 #define makeFaLaplacianScheme(SS) \
224  \
225 makeFaLaplacianTypeScheme(SS, scalar) \
226 makeFaLaplacianTypeScheme(SS, vector) \
227 makeFaLaplacianTypeScheme(SS, tensor)
228 
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #ifdef NoRepository
233  #include "faLaplacianScheme.C"
234 #endif
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #endif
239 
240 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:133
Reference counter for various OpenFOAM components.
Definition: refCount.H:44
tmp< lnGradScheme< Type > > tlnGradScheme_
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
void operator=(const laplacianScheme &)=delete
No copy assignment.
const faMesh & mesh() const
Return mesh reference.
Abstract base class for edge interpolation schemes.
Abstract base class for finite area calculus laplacian schemes.
Simple central-difference lnGrad scheme with non-orthogonal correction.
Abstract base class for lnGrad schemes.
Definition: lnGradScheme.H:57
Forwards for edge field types.
virtual ~laplacianScheme()
Destructor.
virtual tmp< faMatrix< Type > > famLaplacian(const edgeScalarField &, const GeometricField< Type, faPatchField, areaMesh > &)=0
static tmp< laplacianScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new laplacianScheme created on freestore.
virtual tmp< GeometricField< Type, faPatchField, areaMesh > > facLaplacian(const GeometricField< Type, faPatchField, areaMesh > &)=0
tmp< edgeInterpolationScheme< scalar > > tinterpGammaScheme_
declareRunTimeSelectionTable(tmp, laplacianScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
Central-differencing interpolation scheme class.
Macros to ease declaration of run-time selection tables.
laplacianScheme(const laplacianScheme &)=delete
No copy construct.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
bool eof() const noexcept
True if end of input seen.
Definition: IOstream.H:289
Forwards and collection of common area field types.
Namespace for OpenFOAM.