36 if (mapperPtr_.valid())
41 if (isA<mappedInternalPatchBase>(this->patch().patch()))
43 return refCast<const mappedInternalPatchBase>(this->patch().patch());
47 <<
"Field " << this->internalField().name() <<
" on patch "
48 << this->patch().name() <<
" in file "
49 << this->internalField().objectPath()
50 <<
" has neither a mapper specified nor is the patch of "
51 << mappedInternalPatchBase::typeName <<
" type"
54 return NullObjectRef<mappedInternalPatchBase>();
70 fieldName_(
dict.lookupOrDefault<
word>(
"field", iF.
name())),
73 dict.lookupOrDefault<bool>(
"setAverage",
dict.
found(
"average"))
81 interpolationScheme_(
dict.lookup<
word>(
"interpolationScheme")),
102 fieldName_(ptf.fieldName_),
103 setAverage_(ptf.setAverage_),
104 average_(ptf.average_),
105 interpolationScheme_(ptf.interpolationScheme_),
108 ptf.mapperPtr_.
valid()
124 fieldName_(ptf.fieldName_),
125 setAverage_(ptf.setAverage_),
126 average_(ptf.average_),
127 interpolationScheme_(ptf.interpolationScheme_),
130 ptf.mapperPtr_.
valid()
148 if (mapperPtr_.valid())
150 mapperPtr_->clearOut();
163 if (mapperPtr_.valid())
165 mapperPtr_->clearOut();
183 const fvMesh& nbrMesh = refCast<const fvMesh>(this->mapper().nbrMesh());
186 this->mapper().sameRegion()
187 && this->fieldName_ == this->internalField().
name()
188 ? refCast<const VolField<Type>>(this->internalField())
189 : nbrMesh.template lookupObject<
VolField<Type>>(this->fieldName_);
201 interpolationScheme_,
208 const labelList& sampleCells = mapper().cellIndices();
211 pointField samplePoints(mapper().samplePoints());
212 mapper().map().reverseDistribute
222 if (sampleCells[i] != -1)
234 mapper().map().distribute(sampleValues);
239 sampleValues = mapper().distribute(nbrField);
245 const Type sampleAverageValue =
246 gSum(this->patch().magSf()*sampleValues)
247 /
gSum(this->patch().magSf());
249 if (
mag(sampleAverageValue)/
mag(average_) > 0.5)
251 sampleValues *=
mag(average_)/
mag(sampleAverageValue);
255 sampleValues += average_ - sampleAverageValue;
278 this->internalField().
name(),
287 writeEntry(os,
"interpolationScheme", interpolationScheme_);
289 if (mapperPtr_.valid())
291 mapperPtr_->write(os);
#define forAll(list, i)
Loop across all elements in list.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Generic GeometricField class.
const word & name() const
Return name.
void resize(const label)
Alias for setSize(const label)
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static int & msgType()
Message tag of standard messages.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for field mapping.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Mesh data needed to do the Finite Volume discretisation.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Uses the cell value for any point in the cell.
Abstract base class for interpolation.
virtual Type interpolate(const vector &position, const label celli, const label facei=-1) const =0
Interpolate field to the given point in the given cell.
Engine which provides mapping from cells to patch faces.
This boundary condition maps the values from a internal cells to this patch.
virtual void write(Ostream &) const
Write.
mappedInternalValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
const mappedInternalPatchBase & mapper() const
Return the mapping engine.
virtual void map(const fvPatchField< Type > &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(const PtrList< ModelType > &l)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
void writeEntryIfDifferent(Ostream &os, const word &entryName, const EntryType &value1, const EntryType &value2)
Helper function to write the keyword and entry only if the.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const HashTable< dimensionSet > & dimensions()
Get the table of dimension sets.
word name(const bool)
Return a word representation of a bool.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< scalar > mag(const dimensioned< Type > &)