gaussFaGrad.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::gaussGrad
28
29Description
30 Basic second-order gradient scheme using face-interpolation
31 and Gauss' theorem.
32
33SourceFiles
34 gaussFaGrad.C
35 gaussFaGrads.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef gaussFaGrad_H
40#define gaussFaGrad_H
41
42#include "faGradScheme.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace fa
54{
55
56/*---------------------------------------------------------------------------*\
57 Class gaussGrad Declaration
58\*---------------------------------------------------------------------------*/
59
60template<class Type>
61class gaussGrad
62:
63 public fa::gradScheme<Type>
64{
65 // Private data
66
68
69
70 // Private Member Functions
71
72 //- No copy construct
73 gaussGrad(const gaussGrad&) = delete;
74
75 //- No copy assignment
76 void operator=(const gaussGrad&) = delete;
77
78
79public:
80
81 //- Runtime type information
82 TypeName("Gauss");
83
84
85 // Constructors
86
87 //- Construct from mesh
88 gaussGrad(const faMesh& mesh)
89 :
90 gradScheme<Type>(mesh),
91 tinterpScheme_(new linearEdgeInterpolation<Type>(mesh))
92 {}
93
94 //- Construct from Istream
95 gaussGrad(const faMesh& mesh, Istream& is)
96 :
97 gradScheme<Type>(mesh),
98 tinterpScheme_(nullptr)
99 {
100 if (is.eof())
101 {
102 tinterpScheme_ =
104 (
106 );
107 }
108 else
109 {
110 tinterpScheme_ =
112 (
114 );
115 }
116 }
117
118
119 // Member Functions
120
121 //- Return the gradient of the given field calculated
122 // using Gauss' theorem on the interpolated field
123 tmp
124 <
127 > grad
128 (
130 ) const;
131
132 //- Correct the boundary values of the gradient using the patchField
133 // snGrad functions
134 static void correctBoundaryConditions
135 (
139 );
140};
141
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145} // End namespace fa
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149} // End namespace Foam
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153#ifdef NoRepository
154 #include "gaussFaGrad.C"
155#endif
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159#endif
160
161// ************************************************************************* //
Generic GeometricField class.
bool eof() const noexcept
True if end of input seen.
Definition: IOstream.H:239
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
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
Basic second-order gradient scheme using face-interpolation and Gauss' theorem.
Definition: gaussFaGrad.H:63
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > > grad(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the gradient of the given field calculated.
Definition: gaussFaGrad.C:54
gaussGrad(const faMesh &mesh)
Construct from mesh.
Definition: gaussFaGrad.H:87
TypeName("Gauss")
Runtime type information.
gaussGrad(const faMesh &mesh, Istream &is)
Construct from Istream.
Definition: gaussFaGrad.H:94
Abstract base class for finite area calculus gradient schemes.
Definition: faGradScheme.H:66
const faMesh & mesh() const
Return mesh reference.
Definition: faGradScheme.H:121
Central-differencing interpolation scheme class.
A class for managing temporary objects.
Definition: tmp.H:65
type
Volume classification types.
Definition: volumeType.H:66
Namespace for OpenFOAM.
cellMask correctBoundaryConditions()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73