Loading...
Searching...
No Matches
mappedFieldFvPatchField.C
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-2018 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
26\*---------------------------------------------------------------------------*/
27
29#include "volFields.H"
30#include "interpolationCell.H"
31
32// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33
34template<class Type>
36(
37 const fvPatch& p,
39)
40:
43 mappedPatchFieldBase<Type>(*this, *this)
44{}
45
46
47template<class Type>
49(
50 const fvPatch& p,
52 const dictionary& dict
53)
54:
57 mappedPatchFieldBase<Type>(*this, *this, dict, *this)
58{}
59
60
61template<class Type>
63(
65 const fvPatch& p,
67 const fvPatchFieldMapper& mapper
68)
69:
71 mappedPatchBase(p.patch(), ptf),
72 mappedPatchFieldBase<Type>(*this, *this, ptf)
73{}
74
75
76template<class Type>
78(
79 const fvPatch& p,
81
82 // mappedPatchBase
83 const word& sampleRegion,
84 const sampleMode sampleMode,
85 const word& samplePatch,
86 const scalar distance,
87
88 // My settings
89 const word& fieldName,
90 const bool setAverage,
91 const Type average,
92 const word& interpolationScheme
93)
94:
95 fixedValueFvPatchField<Type>(p, iF),
97 (
98 p.patch(),
99 sampleRegion,
100 sampleMode,
101 samplePatch,
103 ),
105 (
106 *this,
107 *this,
108 fieldName,
109 setAverage,
111 interpolationScheme
112 )
113{}
114
115
116template<class Type>
118(
120)
121:
123 mappedPatchBase(ptf.patch().patch(), ptf),
124 mappedPatchFieldBase<Type>(ptf)
125{}
126
127
128template<class Type>
130(
133)
134:
135 fixedValueFvPatchField<Type>(ptf, iF),
136 mappedPatchBase(ptf.patch().patch(), ptf),
137 mappedPatchFieldBase<Type>(*this, *this, ptf)
138{}
139
140
141// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
142
143template<class Type>
145(
146 const fvPatchFieldMapper& m
147)
157 const fvPatchField<Type>& ptf,
158 const labelList& addr
159)
163}
164
165
166template<class Type>
168{
169 if (this->updated())
170 {
171 return;
172 }
173
174 this->operator==(this->mappedField());
175
176 if (debug)
177 {
178 auto limits = gMinMax(*this);
179 auto avg = gAverage(*this);
180
181 Info<< "operating on field:" << this->internalField().name()
182 << " patch:" << this->patch().name()
183 << " avg:" << avg
184 << " min:" << limits.min()
185 << " max:" << limits.max()
186 << endl;
188
190}
191
192
193template<class Type>
195{
200}
201
202
203// ************************************************************************* //
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.
const fvPatch & patch() const noexcept
Return the patch.
bool updated() const noexcept
True if the boundary condition has already been updated.
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...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
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.
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.
virtual void write(Ostream &) const
Write.
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.
mappedFieldFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
sampleMode
Mesh items to sample.
virtual void write(Ostream &os) const
Write as a dictionary.
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...
virtual tmp< Field< Type > > mappedField() const
Map sampleField onto *this patch.
virtual void write(Ostream &os) const
Write.
static const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Check that patch is of correct type.
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 handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
auto limits
Definition setRDeltaT.H:186
OBJstream os(runTime.globalPath()/outputName)
Namespace for handling debugging switches.
Definition debug.C:45
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
scalar distance(const vector &p1, const vector &p2)
Definition curveTools.C:12
List< label > labelList
A List of labels.
Definition List.H:62
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dictionary dict