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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fa::divScheme
28
29Description
30 Abstract base class for finite area calculus div schemes.
31
32SourceFiles
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"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53template<class Type>
54class faMatrix;
55
56class faMesh;
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace fa
61{
62
63/*---------------------------------------------------------------------------*\
64 Class divScheme Declaration
65\*---------------------------------------------------------------------------*/
66
67template<class Type>
68class divScheme
69:
70 public refCount
71{
72
73protected:
74
75 // Protected data
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
90public:
91
92 // Declare run-time constructor selection tables
95 (
96 tmp,
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
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
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 }
179#define makeFaDivScheme(SS) \
180 \
181makeFaDivTypeScheme(SS, vector) \
182makeFaDivTypeScheme(SS, tensor)
183
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187#ifdef NoRepository
188 #include "faDivScheme.C"
189#endif
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193#endif
194
195// ************************************************************************* //
Forwards and collection of common area field types.
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Mesh data needed to do the Finite Area discretisation.
Definition: areaFaMesh.H:56
Abstract base class for edge interpolation schemes.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: faPatchField.H:82
Abstract base class for finite area calculus div schemes.
Definition: faDivScheme.H:70
divScheme(const faMesh &mesh)
Construct from mesh.
Definition: faDivScheme.H:106
divScheme(const faMesh &mesh, Istream &is)
Construct from mesh and Istream.
Definition: faDivScheme.H:113
divScheme(const divScheme &)=delete
No copy construct.
tmp< edgeInterpolationScheme< Type > > tinterpScheme_
Definition: faDivScheme.H:77
void operator=(const divScheme &)=delete
No copy assignment.
const faMesh & mesh_
Definition: faDivScheme.H:76
const faMesh & mesh() const
Return mesh reference.
Definition: faDivScheme.H:137
virtual tmp< GeometricField< typename innerProduct< vector, Type >::type, faPatchField, areaMesh > > facDiv(const GeometricField< Type, faPatchField, areaMesh > &)=0
virtual ~divScheme()
Destructor.
Definition: faDivScheme.C:90
static tmp< divScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new divScheme created on freestore.
Definition: faDivScheme.C:47
declareRunTimeSelectionTable(tmp, divScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
Central-differencing interpolation scheme class.
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
type
Volume classification types.
Definition: volumeType.H:66
Forwards for edge field types.
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)