fixedGradientFaPatchField.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::fixedGradientFaPatchField
28
29Description
30
31Author
32 Zeljko Tukovic, FMENA
33 Hrvoje Jasak, Wikki Ltd.
34
35SourceFiles
36 fixedGradientFaPatchField.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef fixedGradientFaPatchField_H
41#define fixedGradientFaPatchField_H
42
43#include "faPatchField.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class fixedGradientFaPatch Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class Type>
56:
57 public faPatchField<Type>
58{
59 // Private data
60
61 Field<Type> gradient_;
62
63
64public:
65
66 //- Runtime type information
67 TypeName("fixedGradient");
68
69
70 // Constructors
71
72 //- Construct from patch and internal field
74 (
75 const faPatch&,
77 );
78
79 //- Construct from patch, internal field and dictionary
81 (
82 const faPatch&,
84 const dictionary&
85 );
86
87 //- Construct by mapping the given fixedGradientFaPatchField<Type>
88 // onto a new patch
90 (
92 const faPatch&,
95 );
96
97 //- Construct as copy
99 (
101 );
102
103 //- Construct and return a clone
104 virtual tmp<faPatchField<Type>> clone() const
105 {
107 (
109 );
110 }
111
112 //- Construct as copy setting internal field reference
114 (
117 );
118
119 //- Construct and return a clone setting internal field reference
121 (
123 ) const
124 {
126 (
128 );
129 }
130
131
132 // Member functions
133
134 // Return defining fields
135
136 //- Return gradient at boundary
137 virtual Field<Type>& gradient()
138 {
139 return gradient_;
140 }
142 virtual const Field<Type>& gradient() const
143 {
144 return gradient_;
145 }
146
147
148 // Mapping functions
149
150 //- Map (and resize as needed) from self given a mapping object
151 virtual void autoMap
152 (
153 const faPatchFieldMapper&
154 );
155
156 //- Reverse map the given faPatchField onto this faPatchField
157 virtual void rmap
158 (
159 const faPatchField<Type>&,
160 const labelList&
161 );
162
163
164 // Evaluation functions
165
166 //- Return gradient at boundary
167 virtual tmp<Field<Type>> snGrad() const
168 {
169 return gradient_;
170 }
171
172 //- Evaluate the patch field
173 virtual void evaluate
174 (
175 const Pstream::commsTypes commsType =
177 );
178
179
180 //- Return the matrix diagonal coefficients corresponding to the
181 // evaluation of the value of this patchField with given weights
183 (
184 const tmp<scalarField>&
185 ) const;
186
187 //- Return the matrix source coefficients corresponding to the
188 // evaluation of the value of this patchField with given weights
190 (
191 const tmp<scalarField>&
192 ) const;
193
194 //- Return the matrix diagonal coefficients corresponding to the
195 // evaluation of the gradient of this patchField
197
198 //- Return the matrix source coefficients corresponding to the
199 // evaluation of the gradient of this patchField
201
202
203 //- Write
204 virtual void write(Ostream&) const;
205};
206
207
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210} // End namespace Foam
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214#ifdef NoRepository
216#endif
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#endif
221
222// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
commsTypes
Types of communications.
Definition: UPstream.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: faPatchField.H:82
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:78
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
virtual Field< Type > & gradient()
Return gradient at boundary.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual void rmap(const faPatchField< Type > &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
TypeName("fixedGradient")
Runtime type information.
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void autoMap(const faPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual const Field< Type > & gradient() const
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73