37template<
class Type,
class CombineOp>
52 cop(toF[celli], fromVf[adr[celli]]);
60template<
class Type,
class CombineOp>
73 const labelList& overlapCells = adr[celli];
79 label fromCelli = overlapCells[i];
80 f += fromVf[fromCelli]*w[i];
87template<
class Type,
class CombineOp>
104 if (adr[celli] != -1)
106 const labelList& neighbours = cc[adr[celli]];
109 Type
f = fromVf[adr[celli]]*w[0];
111 for (label ni = 1; ni < w.
size(); ni++)
113 f += fromVf[neighbours[ni - 1]]*w[ni];
122template<
class Type,
class CombineOp>
137 if (adr[celli] != -1)
153template<
class Type,
class CombineOp>
162 if (fromVf.
mesh() != fromMesh_)
165 <<
"the argument field does not correspond to the right mesh. "
166 <<
"Field size: " << fromVf.
size()
167 <<
" mesh size: " << fromMesh_.nCells()
171 if (toF.
size() != toMesh_.nCells())
174 <<
"the argument field does not correspond to the right mesh. "
175 <<
"Field size: " << toF.
size()
176 <<
" mesh size: " << toMesh_.nCells()
183 mapField(toF, fromVf, cellAddressing_, cop);
193 inverseDistanceWeights(),
198 case CELL_POINT_INTERPOLATE:
205 toMesh_.cellCentres(),
211 case CELL_VOLUME_WEIGHT:
228 <<
"unknown interpolation scheme " << ord
234template<
class Type,
class CombineOp>
243 interpolateInternalField(toF, tfromVf(), ord, cop);
248template<
class Type,
class CombineOp>
257 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],
346template<
class Type,
class CombineOp>
360template<
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]
414 "interpolated(" + fromVf.
name() +
')',
415 toMesh_.time().timeName(),
428template<
class Type,
class CombineOp>
const dimensionSet & dimensions() const
Return dimensions.
const Mesh & mesh() const
Return mesh.
Generic templated field type.
Generic GeometricField class.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
void size(const label n)
Older name for setAddressableSize.
A topoSetCellSource to select all the cells from given cellSet(s).
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
const vectorField & Cf() const
Return face centres.
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
Type interpolate(const cellPointWeight &cpw) const
Interpolate field for the given cellPointWeight.
Patch-field interpolation class.
void mapField(Field< Type > &, const Field< Type > &, const labelList &adr, const CombineOp &cop) const
Map field.
order
Enumeration specifying required accuracy.
void interpolateInternalField(Field< Type > &, const VolumeField< Type > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate internal volume field.
void interpolateField(Field< Type > &, const VolumeField< Type > &, const labelList &adr, const scalarListList &weights, const CombineOp &cop) const
Interpolate field using inverse-distance weights.
This boundary condition provides a base class for 'mixed' type boundary conditions,...
bool interpolate() const noexcept
Same as isPointData()
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const TargetType * isA(const Type &t)
Check if dynamic_cast to TargetType is possible.
static constexpr const zero Zero
Global zero (0)
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.