39 const Field<Type>& fromVf,
49 toF[celli] = fromVf[adr[celli]];
61 const VolField<Type>& fromVf,
69 const labelList& overlapCells = adr[celli];
75 label fromCelli = overlapCells[i];
76 f += fromVf[fromCelli]*w[i];
87 const VolField<Type>& fromVf,
101 const labelList& neighbours = cc[adr[celli]];
104 Type
f = fromVf[adr[celli]]*w[0];
106 for (
label ni = 1; ni < w.size(); ni++)
108 f += fromVf[neighbours[ni - 1]]*w[ni];
121 const VolField<Type>& fromVf,
127 interpolationCellPoint<Type> interpolator(fromVf);
131 if (adr[celli] != -1)
133 toF[celli] = interpolator.interpolate(centres[celli], adr[celli]);
143 const VolField<Type>& fromVf,
147 if (fromVf.mesh() != fromMesh_)
150 <<
"the argument field does not correspond to the right mesh. "
151 <<
"Field size: " << fromVf.size()
152 <<
" mesh size: " << fromMesh_.nCells()
156 if (toF.size() != toMesh_.nCells())
159 <<
"the argument field does not correspond to the right mesh. "
160 <<
"Field size: " << toF.size()
161 <<
" mesh size: " << toMesh_.nCells()
168 mapField(toF, fromVf, cellAddressing_);
178 inverseDistanceWeights()
182 case CELL_POINT_INTERPOLATE:
189 toMesh_.cellCentres()
194 case CELL_VOLUME_WEIGHT:
210 <<
"unknown interpolation scheme " << ord
220 const tmp<VolField<Type>>& tfromVf,
224 interpolateInternalField(toF, tfromVf(), ord);
232 VolField<Type>& toVf,
233 const VolField<Type>& fromVf,
237 interpolateInternalField(toVf, fromVf, ord);
239 typename VolField<Type>::
240 Boundary& toVfBf = toVf.boundaryFieldRef();
244 const fvPatch& toPatch = toMesh_.boundary()[
patchi];
246 if (cuttingPatches_.found(toPatch.name()))
256 boundaryAddressing_[
patchi]
267 boundaryAddressing_[
patchi],
273 case CELL_POINT_INTERPOLATE:
279 boundaryAddressing_[
patchi],
284 case CELL_VOLUME_WEIGHT:
291 <<
"unknown interpolation scheme " << ord
295 if (
isA<mixedFvPatchField<Type>>(toVfBf[
patchi]))
297 refCast<mixedFvPatchField<Type>>
300 ).refValue() = toVfBf[
patchi];
305 patchMap_.found(toPatch.name())
306 && fromMeshPatches_.found(patchMap_.find(toPatch.name())())
312 fromVf.boundaryField()
314 fromMeshPatches_.find(patchMap_.find(toPatch.name())())()
316 boundaryAddressing_[
patchi]
326 VolField<Type>& toVf,
327 const tmp<VolField<Type>>& tfromVf,
340 const VolField<Type>& fromVf,
345 Field<Type> internalField(toMesh_.nCells());
346 interpolateInternalField(internalField, fromVf, ord);
350 if (fromMesh_.boundary().size() != toMesh_.boundary().size())
353 <<
"Incompatible meshes: different number of boundaries, "
354 "only internal field may be interpolated"
359 PtrList<fvPatchField<Type>> patchFields
361 boundaryAddressing_.size()
371 fromVf.boundaryField()[
patchi],
372 toMesh_.boundary()[
patchi],
374 forwardFieldMapper(boundaryAddressing_[
patchi])
381 tmp<VolField<Type>> ttoF
387 "interpolated(" + fromVf.name() +
')',
388 toMesh_.time().name(),
409 const tmp<VolField<Type>>& tfromVf,
413 tmp<VolField<Type>> tint =
#define forAll(list, i)
Loop across all elements in list.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
static tmp< fvPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
void interpolateField(Field< Type > &, const VolField< Type > &, const labelList &adr, const scalarListList &weights) const
Interpolate field using inverse-distance weights.
void interpolateInternalField(Field< Type > &, const VolField< Type > &, order=INTERPOLATE) const
Interpolate internal volume field.
order
Enumeration specifying required accuracy.
void mapField(Field< Type > &, const Field< Type > &, const labelList &adr) const
Map field.
void interpolate(VolField< Type > &, const VolField< Type > &, order=INTERPOLATE) const
Interpolate volume field.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
List< scalarList > scalarListList
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List< scalar > scalarList
A List of scalars.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
List< labelList > labelListList
A List of labelList.
Field< vector > vectorField
Specialisation of Field<T> for vector.