Go to the documentation of this file.
36 template<
class Type,
class CombineOp>
51 cop(toF[celli], fromVf[adr[celli]]);
59 template<
class Type,
class CombineOp>
72 const labelList& overlapCells = adr[celli];
78 label fromCelli = overlapCells[i];
79 f += fromVf[fromCelli]*w[i];
86 template<
class Type,
class CombineOp>
103 if (adr[celli] != -1)
105 const labelList& neighbours = cc[adr[celli]];
108 Type
f = fromVf[adr[celli]]*w[0];
110 for (label ni = 1; ni < w.size(); ni++)
112 f += fromVf[neighbours[ni - 1]]*w[ni];
121 template<
class Type,
class CombineOp>
136 if (adr[celli] != -1)
152 template<
class Type,
class CombineOp>
161 if (fromVf.mesh() != fromMesh_)
164 <<
"the argument field does not correspond to the right mesh. "
165 <<
"Field size: " << fromVf.size()
166 <<
" mesh size: " << fromMesh_.nCells()
170 if (toF.size() != toMesh_.nCells())
173 <<
"the argument field does not correspond to the right mesh. "
174 <<
"Field size: " << toF.size()
175 <<
" mesh size: " << toMesh_.nCells()
182 mapField(toF, fromVf, cellAddressing_, cop);
192 inverseDistanceWeights(),
197 case CELL_POINT_INTERPOLATE:
204 toMesh_.cellCentres(),
210 case CELL_VOLUME_WEIGHT:
227 <<
"unknown interpolation scheme " << ord
233 template<
class Type,
class CombineOp>
242 interpolateInternalField(toF, tfromVf(), ord, cop);
247 template<
class Type,
class CombineOp>
256 interpolateInternalField(toVf, fromVf, ord, cop);
261 forAll(toMesh_.boundaryMesh(), patchi)
263 const fvPatch& toPatch = toMesh_.boundary()[patchi];
265 if (cuttingPatches_.found(toPatch.
name()))
275 boundaryAddressing_[patchi],
287 boundaryAddressing_[patchi],
294 case CELL_POINT_INTERPOLATE:
300 boundaryAddressing_[patchi],
306 case CELL_VOLUME_WEIGHT:
313 <<
"unknown interpolation scheme " << ord
319 refCast<mixedFvPatchField<Type>>
322 ).refValue() = toVfBf[patchi];
327 patchMap_.found(toPatch.
name())
328 && fromMeshPatches_.found(patchMap_.find(toPatch.
name())())
336 fromMeshPatches_.find(patchMap_.find(toPatch.
name())())()
338 boundaryAddressing_[patchi],
346 template<
class Type,
class CombineOp>
360 template<
class Type,
class CombineOp>
371 interpolateInternalField(internalField, fromVf, ord, cop);
375 if (fromMesh_.boundary().size() != toMesh_.boundary().size())
378 <<
"Incompatible meshes: different number of boundaries, "
379 "only internal field may be interpolated"
386 boundaryAddressing_.size()
389 forAll(boundaryAddressing_, patchi)
397 toMesh_.boundary()[patchi],
401 boundaryAddressing_[patchi]
415 "interpolated(" + fromVf.name() +
')',
416 toMesh_.time().timeName(),
432 template<
class Type,
class CombineOp>
Patch-field interpolation class.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
void interpolateField(Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, const labelList &adr, const scalarListList &weights, const CombineOp &cop) const
Interpolate field using inverse-distance weights.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
virtual const word & name() const
Return name.
#define forAll(list, i)
Loop across all elements in list.
void interpolate(GeometricField< Type, fvPatchField, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate volume field.
order
Enumeration specifying required accuracy.
void mapField(Field< Type > &, const Field< Type > &, const labelList &adr, const CombineOp &cop) const
Map field.
Generic templated field type.
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const vectorField & Cf() const
Return face centres.
Type interpolate(const cellPointWeight &cpw) const
Interpolate field for the given cellPointWeight.
This boundary condition provides a base class for 'mixed' type boundary conditions,...
void interpolateInternalField(Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate internal volume field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const TargetType * isA(const Type &t)
Check if dynamic_cast to TargetType is possible.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...