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)
142 interpolator.interpolate
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>
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
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"
384 PtrList<fvPatchField<Type>> patchFields
386 boundaryAddressing_.size()
389 forAll(boundaryAddressing_, patchi)
397 toMesh_.boundary()[patchi],
399 patchFieldInterpolator
401 boundaryAddressing_[patchi]
414 "interpolated(" + fromVf.
name() +
')',
415 toMesh_.time().timeName(),
428template<
class Type,
class CombineOp>
static const this_type & null() noexcept
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
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
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void size(const label n)
Older name for setAddressableSize.
A topoSetCellSource to select all the cells from given cellSet(s) or cellZone(s).
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
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.
Foam::tmp< Foam::VolumeField< Type > > interpolate(const VolumeField< Type > &fromVf, meshToMesh0::order ord, const CombineOp &cop) const
void interpolate(VolumeField< Type > &, const VolumeField< Type > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate volume field.
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,...
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< scalarList > scalarListList
List of scalarList.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< scalar > scalarList
List of scalar.
#define forAll(list, i)
Loop across all elements in list.