mixedFaPatchField.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::mixedFaPatchField
28
29Description
30
31Author
32 Zeljko Tukovic, FMENA
33 Hrvoje Jasak, Wikki Ltd.
34
35SourceFiles
36 mixedFaPatchField.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef mixedFaPatchField_H
41#define mixedFaPatchField_H
42
43#include "faPatchField.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class mixedFaPatchField Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class Type>
56:
57 public faPatchField<Type>
58{
59 // Private data
60
61 //- Value field
62 Field<Type> refValue_;
63
64 //- Normal gradient field
65 Field<Type> refGrad_;
66
67 //- Fraction (0-1) of value used for boundary condition
68 scalarField valueFraction_;
69
70
71public:
72
73 //- Runtime type information
74 TypeName("mixed");
75
76
77 // Constructors
78
79 //- Construct from patch and internal field
81 (
82 const faPatch&,
84 );
85
86 //- Construct from patch, internal field and dictionary
88 (
89 const faPatch&,
91 const dictionary&
92 );
93
94 //- Construct by mapping the given mixedFaPatchField onto a new patch
96 (
98 const faPatch&,
100 const faPatchFieldMapper&
101 );
102
103 //- Construct as copy
105 (
107 );
108
109 //- Construct and return a clone
110 virtual tmp<faPatchField<Type>> clone() const
111 {
113 (
114 new mixedFaPatchField<Type>(*this)
115 );
116 }
117
118 //- Construct as copy setting internal field reference
120 (
123 );
124
125 //- Construct and return a clone setting internal field reference
127 (
129 ) const
130 {
132 (
133 new mixedFaPatchField<Type>(*this, iF)
134 );
135 }
136
137
138 // Member functions
139
140 // Access
141
142 //- Return true if this patch field fixes a value.
143 // Needed to check if a level has to be specified while solving
144 // Poissons equations.
145 virtual bool fixesValue() const
146 {
147 return true;
148 }
149
150
151 // Return defining fields
153 virtual Field<Type>& refValue()
154 {
155 return refValue_;
156 }
158 virtual const Field<Type>& refValue() const
159 {
160 return refValue_;
161 }
163 virtual Field<Type>& refGrad()
164 {
165 return refGrad_;
166 }
168 virtual const Field<Type>& refGrad() const
169 {
170 return refGrad_;
171 }
173 virtual scalarField& valueFraction()
174 {
175 return valueFraction_;
176 }
178 virtual const scalarField& valueFraction() const
179 {
180 return valueFraction_;
181 }
182
183
184 // Mapping functions
185
186 //- Map (and resize as needed) from self given a mapping object
187 virtual void autoMap
188 (
189 const faPatchFieldMapper&
190 );
191
192 //- Reverse map the given faPatchField onto this faPatchField
193 virtual void rmap
194 (
195 const faPatchField<Type>&,
196 const labelList&
197 );
198
199
200 // Evaluation functions
201
202 //- Return gradient at boundary
203 virtual tmp<Field<Type>> snGrad() const;
204
205 //- Evaluate the patch field
206 virtual void evaluate
207 (
209 );
210
211 //- Return the matrix diagonal coefficients corresponding to the
212 // evaluation of the value of this patchField with given weights
214 (
215 const tmp<scalarField>&
216 ) const;
217
218 //- Return the matrix source coefficients corresponding to the
219 // evaluation of the value of this patchField with given weights
221 (
222 const tmp<scalarField>&
223 ) const;
224
225 //- Return the matrix diagonal coefficients corresponding to the
226 // evaluation of the gradient of this patchField
228
229 //- Return the matrix source coefficients corresponding to the
230 // evaluation of the gradient of this patchField
232
233
234 //- Write
235 virtual void write(Ostream&) const;
236
237
238 // Member operators
240 virtual void operator=(const UList<Type>&) {}
242 virtual void operator=(const faPatchField<Type>&) {}
243 virtual void operator+=(const faPatchField<Type>&) {}
244 virtual void operator-=(const faPatchField<Type>&) {}
245 virtual void operator*=(const faPatchField<scalar>&) {}
246 virtual void operator/=(const faPatchField<scalar>&) {}
248 virtual void operator+=(const Field<Type>&) {}
249 virtual void operator-=(const Field<Type>&) {}
251 virtual void operator*=(const Field<scalar>&) {}
252 virtual void operator/=(const Field<scalar>&) {}
254 virtual void operator=(const Type&) {}
255 virtual void operator+=(const Type&) {}
256 virtual void operator-=(const Type&) {}
257 virtual void operator*=(const scalar) {}
258 virtual void operator/=(const scalar) {}
259};
260
261
262// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263
264} // End namespace Foam
265
266// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267
268#ifdef NoRepository
269 #include "mixedFaPatchField.C"
270#endif
271
272// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
273
274#endif
275
276// ************************************************************************* //
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
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
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 void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
Return true if this patch field fixes a value.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
virtual const Field< Type > & refGrad() const
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual void operator+=(const Field< Type > &)
virtual void operator-=(const faPatchField< Type > &)
virtual void rmap(const faPatchField< Type > &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
virtual void operator=(const Type &)
virtual void operator+=(const faPatchField< Type > &)
virtual void operator*=(const Field< scalar > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void operator/=(const scalar)
virtual Field< Type > & refGrad()
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void operator-=(const Type &)
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 scalarField & valueFraction() const
virtual void operator=(const faPatchField< Type > &)
virtual const Field< Type > & refValue() const
virtual Field< Type > & refValue()
TypeName("mixed")
Runtime type information.
virtual void operator*=(const scalar)
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
virtual scalarField & valueFraction()
virtual void operator*=(const faPatchField< scalar > &)
virtual void operator/=(const faPatchField< scalar > &)
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