directionMixedFvPatchField.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) 2011-2017 OpenFOAM Foundation
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::directionMixedFvPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 Base class for direction-mixed boundary conditions.
34
35SourceFiles
36 directionMixedFvPatchField.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef directionMixedFvPatchField_H
41#define directionMixedFvPatchField_H
42
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class directionMixedFvPatchField Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class Type>
56:
57 public transformFvPatchField<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 symmTensorField valueFraction_;
69
70
71public:
72
73 //- Runtime type information
74 TypeName("directionMixed");
75
76
77 // Constructors
78
79 //- Construct from patch and internal field
81 (
82 const fvPatch&,
84 );
85
86 //- Construct from patch, internal field and dictionary
88 (
89 const fvPatch&,
91 const dictionary&
92 );
93
94 //- Construct by mapping given directionMixedFvPatchField onto
95 // a new patch
97 (
99 const fvPatch&,
101 const fvPatchFieldMapper&
102 );
103
104 //- Construct and return a clone
105 virtual tmp<fvPatchField<Type>> clone() const
106 {
108 (
110 );
111 }
112
113 //- Construct as copy setting internal field reference
115 (
118 );
119
120 //- Construct and return a clone setting internal field reference
122 (
124 ) const
125 {
127 (
129 );
130 }
131
132
133 // Member functions
134
135 // Attributes
136
137 //- Return true: this patch field fixes a value.
138 // Needed to check if a level has to be specified while solving
139 // Poissons equations.
140 virtual bool fixesValue() const
141 {
142 return true;
143 }
144
145 //- Return false: this patch field is not altered by assignment
146 virtual bool assignable() const
147 {
148 return false;
149 }
150
151
152 // Mapping functions
153
154 //- Map (and resize as needed) from self given a mapping object
155 virtual void autoMap
156 (
157 const fvPatchFieldMapper&
158 );
159
160 //- Reverse map the given fvPatchField onto this fvPatchField
161 virtual void rmap
162 (
163 const fvPatchField<Type>&,
164 const labelList&
165 );
166
167
168 // Return defining fields
170 virtual Field<Type>& refValue()
171 {
172 return refValue_;
173 }
175 virtual const Field<Type>& refValue() const
176 {
177 return refValue_;
178 }
180 virtual Field<Type>& refGrad()
181 {
182 return refGrad_;
183 }
185 virtual const Field<Type>& refGrad() const
186 {
187 return refGrad_;
188 }
191 {
192 return valueFraction_;
193 }
195 virtual const symmTensorField& valueFraction() const
196 {
197 return valueFraction_;
198 }
199
200
201 // Evaluation functions
202
203 //- Return gradient at boundary
204 virtual tmp<Field<Type>> snGrad() const;
205
206 //- Evaluate the patch field
207 virtual void evaluate
208 (
209 const Pstream::commsTypes commsType =
211 );
212
213 //- Return face-gradient transform diagonal
214 virtual tmp<Field<Type>> snGradTransformDiag() const;
215
216
217 //- Write
218 virtual void write(Ostream&) const;
219
220
221 // Member operators
223 virtual void operator=(const fvPatchField<Type>&) {}
224 virtual void operator+=(const fvPatchField<Type>&) {}
225 virtual void operator-=(const fvPatchField<Type>&) {}
226 virtual void operator*=(const fvPatchField<Type>&) {}
227 virtual void operator/=(const fvPatchField<Type>&) {}
229 virtual void operator=(const Field<Type>&) {}
230 virtual void operator+=(const Field<Type>&) {}
231 virtual void operator-=(const Field<Type>&) {}
232 virtual void operator*=(const Field<scalar>&) {}
233 virtual void operator/=(const Field<scalar>&) {}
235 virtual void operator=(const Type&) {}
236 virtual void operator+=(const Type&) {}
237 virtual void operator-=(const Type&) {}
238 virtual void operator*=(const scalar) {}
239 virtual void operator/=(const scalar) {}
240};
241
242
243// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244
245} // End namespace Foam
246
247// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248
249#ifdef NoRepository
251#endif
252
253// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254
255#endif
256
257// ************************************************************************* //
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
Base class for direction-mixed boundary conditions.
virtual void operator/=(const Field< scalar > &)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual bool fixesValue() const
Return true: 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 void operator+=(const Field< Type > &)
virtual const symmTensorField & valueFraction() const
virtual void operator*=(const Field< scalar > &)
virtual void operator+=(const fvPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return gradient at boundary.
virtual symmTensorField & valueFraction()
virtual void operator=(const fvPatchField< Type > &)
virtual void operator-=(const fvPatchField< Type > &)
virtual void operator/=(const fvPatchField< Type > &)
TypeName("directionMixed")
Runtime type information.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual const Field< Type > & refValue() const
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual bool assignable() const
Return false: this patch field is not altered by assignment.
virtual tmp< Field< Type > > snGradTransformDiag() const
Return face-gradient transform diagonal.
virtual void operator=(const Field< Type > &)
virtual void operator*=(const fvPatchField< Type > &)
virtual void operator-=(const Field< Type > &)
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
Foam::transformFvPatchField.
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73