faDivScheme.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::divScheme
28 
29 Description
30  Abstract base class for finite area calculus div schemes.
31 
32 SourceFiles
33  faDivScheme.C
34  faDivSchemes.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef faDivScheme_H
39 #define faDivScheme_H
40 
41 #include "tmp.H"
42 #include "areaFieldsFwd.H"
43 #include "edgeFieldsFwd.H"
45 #include "typeInfo.H"
46 #include "runTimeSelectionTables.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 template<class Type>
54 class faMatrix;
55 
56 class faMesh;
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace fa
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class divScheme Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class Type>
68 class divScheme
69 :
70  public refCount
71 {
72 
73 protected:
74 
75  // Protected data
76 
77  const faMesh& mesh_;
79 
80 
81  // Private Member Functions
82 
83  //- No copy construct
84  divScheme(const divScheme&) = delete;
85 
86  //- No copy assignment
87  void operator=(const divScheme&) = delete;
88 
89 
90 public:
91 
92  // Declare run-time constructor selection tables
93 
95  (
96  tmp,
97  divScheme,
98  Istream,
99  (const faMesh& mesh, Istream& schemeData),
100  (mesh, schemeData)
101  );
102 
103 
104  // Constructors
105 
106  //- Construct from mesh
107  divScheme(const faMesh& mesh)
108  :
109  mesh_(mesh),
111  {}
112 
113  //- Construct from mesh and Istream
114  divScheme(const faMesh& mesh, Istream& is)
115  :
116  mesh_(mesh),
118  {}
119 
120 
121  // Selectors
122 
123  //- Return a pointer to a new divScheme created on freestore
124  static tmp<divScheme<Type>> New
125  (
126  const faMesh& mesh,
127  Istream& schemeData
128  );
129 
130 
131  //- Destructor
132  virtual ~divScheme();
133 
134 
135  // Member Functions
136 
137  //- Return mesh reference
138  const faMesh& mesh() const
139  {
140  return mesh_;
141  }
142 
143  virtual tmp
144  <
147  > facDiv
148  (
150  ) = 0;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace fa
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 // Add the patch constructor functions to the hash tables
165 
166 #define makeFaDivTypeScheme(SS, Type) \
167  \
168  defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
169  \
170  namespace Foam \
171  { \
172  namespace fa \
173  { \
174  divScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
175  add##SS##Type##IstreamConstructorToTable_; \
176  } \
177  }
178 
179 #define makeFaDivScheme(SS) \
180  \
181 makeFaDivTypeScheme(SS, vector) \
182 makeFaDivTypeScheme(SS, tensor)
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #ifdef NoRepository
188  #include "faDivScheme.C"
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
Foam::edgeInterpolationScheme
Abstract base class for edge interpolation schemes.
Definition: edgeInterpolationScheme.H:57
Foam::faPatchField
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:50
Foam::fa::divScheme::declareRunTimeSelectionTable
declareRunTimeSelectionTable(tmp, divScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
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
Foam::fa::divScheme::divScheme
divScheme(const divScheme &)=delete
No copy construct.
Foam::fa::divScheme::~divScheme
virtual ~divScheme()
Destructor.
Definition: faDivScheme.C:90
Foam::innerProduct
Definition: products.H:141
faDivScheme.C
Foam::fa::divScheme::divScheme
divScheme(const faMesh &mesh)
Construct from mesh.
Definition: faDivScheme.H:106
Foam::fa::divScheme::tinterpScheme_
tmp< edgeInterpolationScheme< Type > > tinterpScheme_
Definition: faDivScheme.H:77
Foam::fa::divScheme::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: faDivScheme.H:137
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
areaFieldsFwd.H
Forwards and collection of common area field types.
Foam::fa::divScheme::divScheme
divScheme(const faMesh &mesh, Istream &is)
Construct from mesh and Istream.
Definition: faDivScheme.H:113
Foam::areaMesh
Mesh data needed to do the Finite Area discretisation.
Definition: areaFaMesh.H:53
Foam::fa::divScheme
Abstract base class for finite area calculus div schemes.
Definition: faDivScheme.H:67
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fa::divScheme::mesh_
const faMesh & mesh_
Definition: faDivScheme.H:76
tmp.H
linearEdgeInterpolation.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::fa::divScheme::New
static tmp< divScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new divScheme created on freestore.
Definition: faDivScheme.C:47
Foam::linearEdgeInterpolation
Central-differencing interpolation scheme class.
Definition: linearEdgeInterpolation.H:52
Foam::fa::divScheme::operator=
void operator=(const divScheme &)=delete
No copy assignment.
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
edgeFieldsFwd.H
Forwards for edge field types.
Foam::fa::divScheme::facDiv
virtual tmp< GeometricField< typename innerProduct< vector, Type >::type, faPatchField, areaMesh > > facDiv(const GeometricField< Type, faPatchField, areaMesh > &)=0