faGradScheme.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::gradScheme
28
29Description
30 Abstract base class for finite area calculus gradient schemes.
31
32SourceFiles
33 faGradScheme.C
34 faGradSchemes.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef faGradScheme_H
39#define faGradScheme_H
40
41#include "tmp.H"
42#include "areaFieldsFwd.H"
43#include "edgeFieldsFwd.H"
44#include "typeInfo.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52class faMesh;
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace fa
57{
58
59/*---------------------------------------------------------------------------*\
60 Class gradScheme Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class Type>
64class gradScheme
65:
66 public refCount
67{
68 // Private data
69
70 const faMesh& mesh_;
71
72
73 // Private Member Functions
74
75 //- No copy construct
76 gradScheme(const gradScheme&) = delete;
77
78 //- No copy assignment
79 void operator=(const gradScheme&) = delete;
80
81
82public:
83
84 // Declare run-time constructor selection tables
87 (
88 tmp,
90 Istream,
91 (const faMesh& mesh, Istream& schemeData),
92 (mesh, schemeData)
93 );
94
95
96 // Constructors
97
98 //- Construct from mesh
99 gradScheme(const faMesh& mesh)
100 :
101 mesh_(mesh)
102 {}
103
104
105 // Selectors
106
107 //- Return a pointer to a new gradScheme created on freestore
109 (
110 const faMesh& mesh,
111 Istream& schemeData
112 );
113
114
115 //- Destructor
116 virtual ~gradScheme();
117
118
119 // Member Functions
120
121 //- Return mesh reference
122 const faMesh& mesh() const
123 {
124 return mesh_;
125 }
126
127 //- Calculate and return the grad of the given field
128 virtual tmp
129 <
132 > grad
133 (
135 ) const = 0;
136};
137
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141} // End namespace fa
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145} // End namespace Foam
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149// Add the patch constructor functions to the hash tables
151#define makeFaGradTypeScheme(SS, Type) \
152 \
153 defineNamedTemplateTypeNameAndDebug(Foam::fa::SS<Foam::Type>, 0); \
154 \
155 namespace Foam \
156 { \
157 namespace fa \
158 { \
159 gradScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
160 add##SS##Type##IstreamConstructorToTable_; \
161 } \
162 }
163
165#define makeFaGradScheme(SS) \
166 \
167makeFaGradTypeScheme(SS, scalar) \
168makeFaGradTypeScheme(SS, vector)
169
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#ifdef NoRepository
174 #include "faGradScheme.C"
175#endif
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179#endif
180
181// ************************************************************************* //
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
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 gradient schemes.
Definition: faGradScheme.H:66
virtual ~gradScheme()
Destructor.
Definition: faGradScheme.C:89
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > > grad(const GeometricField< Type, faPatchField, areaMesh > &) const =0
Calculate and return the grad of the given field.
static tmp< gradScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
Definition: faGradScheme.C:46
const faMesh & mesh() const
Return mesh reference.
Definition: faGradScheme.H:121
declareRunTimeSelectionTable(tmp, gradScheme, Istream,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
gradScheme(const faMesh &mesh)
Construct from mesh.
Definition: faGradScheme.H:98
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)