38 const Field<Type>& fromVf,
48 toF[celli] = fromVf[adr[celli]];
60 const VolField<Type>& fromVf,
68 const labelList& overlapCells = adr[celli];
74 label fromCelli = overlapCells[i];
75 f += fromVf[fromCelli]*w[i];
86 const VolField<Type>& fromVf,
100 const labelList& neighbours = cc[adr[celli]];
103 Type
f = fromVf[adr[celli]]*w[0];
105 for (
label ni = 1; ni < w.size(); ni++)
107 f += fromVf[neighbours[ni - 1]]*w[ni];
120 const VolField<Type>& fromVf,
126 interpolationCellPoint<Type> interpolator(fromVf);
130 if (adr[celli] != -1)
132 toF[celli] = interpolator.interpolate(centres[celli], adr[celli]);
142 const VolField<Type>& fromVf,
146 if (fromVf.mesh() != fromMesh_)
149 <<
"the argument field does not correspond to the right mesh. "
150 <<
"Field size: " << fromVf.size()
151 <<
" mesh size: " << fromMesh_.nCells()
155 if (toF.size() != toMesh_.nCells())
158 <<
"the argument field does not correspond to the right mesh. "
159 <<
"Field size: " << toF.size()
160 <<
" mesh size: " << toMesh_.nCells()
167 mapField(toF, fromVf, cellAddressing_);
177 inverseDistanceWeights()
181 case CELL_POINT_INTERPOLATE:
188 toMesh_.cellCentres()
193 case CELL_VOLUME_WEIGHT:
209 <<
"unknown interpolation scheme " << ord
219 const tmp<VolField<Type>>& tfromVf,
223 interpolateInternalField(toF, tfromVf(), ord);
231 VolField<Type>& toVf,
232 const VolField<Type>& fromVf,
236 interpolateInternalField(toVf, fromVf, ord);
238 typename VolField<Type>::
239 Boundary& toVfBf = toVf.boundaryFieldRef();
243 const fvPatch& toPatch = toMesh_.boundary()[
patchi];
245 if (cuttingPatches_.found(toPatch.name()))
255 boundaryAddressing_[
patchi]
266 boundaryAddressing_[
patchi],
272 case CELL_POINT_INTERPOLATE:
278 boundaryAddressing_[
patchi],
283 case CELL_VOLUME_WEIGHT:
290 <<
"unknown interpolation scheme " << ord
294 if (
isA<mixedFvPatchField<Type>>(toVfBf[
patchi]))
296 refCast<mixedFvPatchField<Type>>
299 ).refValue() = toVfBf[
patchi];
304 patchMap_.found(toPatch.name())
305 && fromMeshPatches_.found(patchMap_.find(toPatch.name())())
311 fromVf.boundaryField()
313 fromMeshPatches_.find(patchMap_.find(toPatch.name())())()
315 boundaryAddressing_[
patchi]
325 VolField<Type>& toVf,
326 const tmp<VolField<Type>>& tfromVf,
339 const VolField<Type>& fromVf,
344 Field<Type> internalField(toMesh_.nCells());
345 interpolateInternalField(internalField, fromVf, ord);
349 if (fromMesh_.boundary().size() != toMesh_.boundary().size())
352 <<
"Incompatible meshes: different number of boundaries, "
353 "only internal field may be interpolated"
358 PtrList<fvPatchField<Type>> patchFields
360 boundaryAddressing_.size()
370 fromVf.boundaryField()[
patchi],
371 toMesh_.boundary()[
patchi],
373 patchFieldInterpolator
375 boundaryAddressing_[
patchi]
383 tmp<VolField<Type>> ttoF
389 "interpolated(" + fromVf.name() +
')',
390 toMesh_.time().name(),
411 const tmp<VolField<Type>>& tfromVf,
415 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.