Loading...
Searching...
No Matches
mappedFieldFvPatchField.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-2016 OpenFOAM Foundation
9 Copyright (C) 2018 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::mappedFieldFvPatchField
29
30Group
31 grpGenericBoundaryConditions grpCoupledBoundaryConditions
32
33Description
34 This boundary condition provides a self-contained version of the \c mapped
35 condition. It does not use information on the patch; instead it holds
36 the data locally.
37
38Usage
39 \table
40 Property | Description | Required | Default
41 field | Name of field to be mapped | no | this field name
42 setAverage | Use average value | no | false |
43 average | Average value to use if \c setAverage = yes | partly |
44 \endtable
45
46 Example of the boundary condition specification:
47 \verbatim
48 <patchName>
49 {
50 type mappedField;
51 field T; // optional field name
52 setAverage no; // apply an average value
53 average 0; // average to apply if setAverage
54 value uniform 0; // place holder
55 }
56 \endverbatim
57
58Note
59 Since this condition can be applied on a per-field and per-patch basis,
60 it is possible to duplicate the mapping information. If possible, employ
61 the \c mapped condition in preference to avoid this situation, and only
62 employ this condition if it is not possible to change the underlying
63 geometric (poly) patch type to \c mapped.
64
65See also
66 Foam::mappedPatchBase
67 Foam::mappedPolyPatch
68 Foam::mappedFvPatch
69 Foam::fixedValueFvPatchField
70
71SourceFiles
72 mappedFieldFvPatchField.C
73
74\*---------------------------------------------------------------------------*/
75
76#ifndef mappedFieldFvPatchField_H
77#define mappedFieldFvPatchField_H
78
79#include "mappedPatchBase.H"
82#include "interpolation.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88
89/*---------------------------------------------------------------------------*\
90 Class mappedFieldFvPatchField Declaration
91\*---------------------------------------------------------------------------*/
92
93template<class Type>
95:
96 public fixedValueFvPatchField<Type>,
97 public mappedPatchBase,
98 public mappedPatchFieldBase<Type>
99{
100
101public:
102
103 //- Runtime type information
104 TypeName("mappedField");
105
106
107 // Constructors
108
109 //- Construct from patch and internal field
111 (
112 const fvPatch&,
114 );
115
116 //- Construct from patch, internal field and dictionary
118 (
119 const fvPatch&,
121 const dictionary&
122 );
123
124 //- Construct from patch, internal field and distance for normal type
125 // sampling
127 (
128 const fvPatch&,
130
131 // mappedPatchBase
132 const word& sampleRegion,
134 const word& samplePatch,
135 const scalar distance,
136
137 // My settings
138 const word& fieldName,
139 const bool setAverage,
140 const Type average,
141 const word& interpolationScheme
142 );
143
144 //- Construct by mapping given
145 // mappedFieldFvPatchField
146 // onto a new patch
148 (
150 const fvPatch&,
152 const fvPatchFieldMapper&
153 );
154
155 //- Construct as copy
157 (
159 );
160
161 //- Construct as copy setting internal field reference
163 (
166 );
167
168 //- Return a clone
169 virtual tmp<fvPatchField<Type>> clone() const
170 {
171 return fvPatchField<Type>::Clone(*this);
172 }
173
174 //- Clone with an internal field reference
176 (
178 ) const
179 {
180 return fvPatchField<Type>::Clone(*this, iF);
181 }
182
183
184 // Member functions
185
186 // Mapping functions
187
188 //- Map (and resize as needed) from self given a mapping object
189 virtual void autoMap
190 (
191 const fvPatchFieldMapper&
192 );
193
194 //- Reverse map the given fvPatchField onto this fvPatchField
195 virtual void rmap
196 (
197 const fvPatchField<Type>&,
198 const labelList&
199 );
200
201
202 // Evaluation functions
204 //- Update the coefficients associated with the patch field
205 virtual void updateCoeffs();
206
207
208 //- Write
209 virtual void write(Ostream&) const;
210};
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215} // End namespace Foam
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219#ifdef NoRepository
221#endif
222
223// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224
225#endif
226
227// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
This boundary condition provides a self-contained version of the mapped condition....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("mappedField")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
sampleMode
Mesh items to sample.
mappedPatchBase(const polyPatch &)
Construct from patch.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE).
const word & sampleRegion() const
Region to sample.
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
mappedPatchFieldBase(const mappedPatchBase &mapper, const fvPatchField< Type > &patchField, const word &fieldName, const bool setAverage, const Type average, const word &interpolationScheme)
Construct from components.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
scalar distance(const vector &p1, const vector &p2)
Definition curveTools.C:12
List< label > labelList
A List of labels.
Definition List.H:62
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68