39template<
class FromPatch,
class ToPatch>
47 if (pf.
size() != fromPatch_.nPoints())
50 <<
"given field does not correspond to patch. Patch size: "
51 << fromPatch_.nPoints() <<
" field size: " << pf.
size()
56 auto& result = tresult.ref();
58 const auto& fromPatchLocalFaces = fromPatch_.localFaces();
68 if (addr[pointi] > -1)
71 fromPatchLocalFaces[addr[pointi]];
75 result[pointi] += curWeights[wI]*pf[hitFacePoints[wI]];
84template<
class FromPatch,
class ToPatch>
98template<
class FromPatch,
class ToPatch>
106 if (ff.size() != fromPatch_.size())
109 <<
"given field does not correspond to patch. Patch size: "
110 << fromPatch_.size() <<
" field size: " << ff.size()
114 auto tresult = tmp<Field<Type>>
::New(toPatch_.size(),
Zero);
115 auto& result = tresult.ref();
117 const labelListList& fromPatchFaceFaces = fromPatch_.faceFaces();
119 const FieldField<Field, scalar>& weights = faceWeights();
127 if (addr[facei] > -1)
130 fromPatchFaceFaces[addr[facei]];
133 result[facei] += ff[addr[facei]]*curWeights[0];
135 for (label wI = 1; wI < curWeights.size(); wI++)
137 result[facei] += ff[hitFaceFaces[wI - 1]]*curWeights[wI];
146template<
class FromPatch,
class ToPatch>
A field of fields is a PtrList of fields with reference counting.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
tmp< Field< Type > > pointInterpolate(const Field< Type > &pf) const
Interpolate point field.
tmp< Field< Type > > faceInterpolate(const Field< Type > &pf) const
Interpolate face field.
void size(const label n)
Older name for setAddressableSize.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define forAll(list, i)
Loop across all elements in list.