34 template<
class Type,
class CombineOp>
49 cop(toF[celli], fromVf[adr[celli]]);
57 template<
class Type,
class CombineOp>
70 const labelList& overlapCells = adr[celli];
76 label fromCelli = overlapCells[i];
77 f += fromVf[fromCelli]*w[i];
84 template<
class Type,
class CombineOp>
101 if (adr[celli] != -1)
103 const labelList& neighbours = cc[adr[celli]];
106 Type
f = fromVf[adr[celli]]*w[0];
108 for (
label ni = 1; ni < w.size(); ni++)
110 f += fromVf[neighbours[ni - 1]]*w[ni];
119 template<
class Type,
class CombineOp>
134 if (adr[celli] != -1)
150 template<
class Type,
class CombineOp>
159 if (fromVf.
mesh() != fromMesh_)
163 "meshToMesh0::interpolateInternalField(Field<Type>&, " 164 "const GeometricField<Type, fvPatchField, volMesh>&, " 165 "meshToMesh0::order, const CombineOp&) const" 166 ) <<
"the argument field does not correspond to the right mesh. " 167 <<
"Field size: " << fromVf.
size()
168 <<
" mesh size: " << fromMesh_.nCells()
172 if (toF.
size() != toMesh_.nCells())
176 "meshToMesh0::interpolateInternalField(Field<Type>&, " 177 "const GeometricField<Type, fvPatchField, volMesh>&, " 178 "meshToMesh0::order, const CombineOp&) const" 179 ) <<
"the argument field does not correspond to the right mesh. " 180 <<
"Field size: " << toF.
size()
181 <<
" mesh size: " << toMesh_.nCells()
188 mapField(toF, fromVf, cellAddressing_, cop);
198 inverseDistanceWeights(),
203 case CELL_POINT_INTERPOLATE:
210 toMesh_.cellCentres(),
216 case CELL_VOLUME_WEIGHT:
234 "meshToMesh0::interpolateInternalField(Field<Type>&, " 235 "const GeometricField<Type, fvPatchField, volMesh>&, " 236 "meshToMesh0::order, const CombineOp&) const" 237 ) <<
"unknown interpolation scheme " << ord
243 template<
class Type,
class CombineOp>
252 interpolateInternalField(toF, tfromVf(), ord, cop);
257 template<
class Type,
class CombineOp>
266 interpolateInternalField(toVf, fromVf, ord, cop);
272 if (cuttingPatches_.found(toPatch.
name()))
282 boundaryAddressing_[
patchi],
294 boundaryAddressing_[
patchi],
301 case CELL_POINT_INTERPOLATE:
307 boundaryAddressing_[
patchi],
313 case CELL_VOLUME_WEIGHT:
322 "meshToMesh0::interpolate(" 323 "GeometricField<Type, fvPatchField, volMesh>&, " 324 "const GeometricField<Type, fvPatchField, volMesh>&, " 325 "meshToMesh0::order, const CombineOp&) const" 326 ) <<
"unknown interpolation scheme " << ord
332 refCast<mixedFvPatchField<Type> >
340 patchMap_.found(toPatch.
name())
341 && fromMeshPatches_.found(patchMap_.find(toPatch.
name())())
360 fromMeshPatches_.find(patchMap_.find(toPatch.
name())())()
362 boundaryAddressing_[
patchi],
370 template<
class Type,
class CombineOp>
384 template<
class Type,
class CombineOp>
399 if (fromMesh_.boundary().size() != toMesh_.boundary().size())
403 "meshToMesh0::interpolate" 404 "(const GeometricField<Type, fvPatchField, volMesh>&," 405 "meshToMesh0::order, const CombineOp&) const" 406 ) <<
"Incompatible meshes: different number of boundaries, " 407 "only internal field may be interpolated" 414 boundaryAddressing_.size()
417 forAll(boundaryAddressing_, patchI)
425 toMesh_.boundary()[patchI],
429 boundaryAddressing_[patchI]
443 "interpolated(" + fromVf.
name() +
')',
444 toMesh_.time().timeName(),
460 template<
class Type,
class CombineOp>
This boundary condition provides a base class for 'mixed' type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
const vectorField & Cf() const
Return face centres.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void interpolateInternalField(Field< Type > &, const GeometricField< Type, fvPatchField, volMesh > &, order=INTERPOLATE, const CombineOp &cop=eqOp< Type >()) const
Interpolate internal volume field.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< surfaceScalarField > interpolate(const RhoType &rho)
const Mesh & mesh() const
Return mesh.
const word & name() const
Return name.
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.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void mapField(Field< Type > &, const Field< Type > &, const labelList &adr, const CombineOp &cop) const
Map field.
const dimensionSet & dimensions() const
Return dimensions.
Type interpolate(const cellPointWeight &cpw) const
Interpolate field for the given cellPointWeight.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Pre-declare SubField and related Field type.
const word & name() const
Return name.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
Generic GeometricField class.
Traits class for primitives.
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.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Patch-field interpolation class.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
A class for managing temporary objects.
conserve internalField()+
A topoSetSource to select the cells from another cellSet.