37 template<
class Type,
class CombineOp>
52 cop(toF[celli], fromVf[adr[celli]]);
60 template<
class Type,
class CombineOp>
73 const labelList& overlapCells = adr[celli];
79 label fromCelli = overlapCells[i];
80 f += fromVf[fromCelli]*w[i];
87 template<
class Type,
class CombineOp>
91 const VolumeField<Type>& fromVf,
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];
122 template<
class Type,
class CombineOp>
126 const VolumeField<Type>& fromVf,
133 interpolationCellPoint<Type> interpolator(fromVf);
137 if (adr[celli] != -1)
142 interpolator.interpolate
153 template<
class Type,
class CombineOp>
157 const VolumeField<Type>& fromVf,
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
234 template<
class Type,
class CombineOp>
238 const tmp<VolumeField<Type>>& tfromVf,
243 interpolateInternalField(toF, tfromVf(), ord, cop);
248 template<
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
317 if (
isA<mixedFvPatchField<Type>>(toVfBf[patchi]))
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>
349 VolumeField<Type>& toVf,
350 const tmp<VolumeField<Type>>& tfromVf,
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" 384 PtrList<fvPatchField<Type>> patchFields
386 boundaryAddressing_.size()
389 forAll(boundaryAddressing_, patchi)
397 toMesh_.boundary()[patchi],
399 patchFieldInterpolator
401 boundaryAddressing_[patchi]
410 tmp<VolumeField<Type>>
::New 414 "interpolated(" + fromVf.
name() +
')',
415 toMesh_.time().timeName(),
428 template<
class Type,
class CombineOp>
List< scalar > scalarList
List of scalar.
void interpolate(VolumeField< Type > &, const VolumeField< Type > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate volume field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const DimensionedField< Type, GeoMesh > & null() noexcept
Return a null DimensionedField (reference to a nullObject).
void mapField(Field< Type > &, const Field< Type > &, const labelList &adr, const CombineOp &cop) const
Map field.
const word & name() const noexcept
Return the object name.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
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.
order
Enumeration specifying required accuracy.
Generic GeometricField class.
Ignore writing from objectRegistry::writeObject()
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
List< scalarList > scalarListList
List of scalarList.
const vectorField & Cf() const
Return face centres.
void interpolateField(Field< Type > &, const VolumeField< Type > &, const labelList &adr, const scalarListList &weights, const CombineOp &cop) const
Interpolate field using inverse-distance weights.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual const word & name() const
Return name.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
List< label > labelList
A List of labels.
A class for managing temporary objects.
void interpolateInternalField(Field< Type > &, const VolumeField< Type > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate internal volume field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
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.
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)