Go to the documentation of this file.
37 const word& fieldName,
38 const word& sampleScheme
45 const auto* volFldPtr =
mesh().findObject<VolFieldType>(fieldName);
52 const auto& volFld = *volFldPtr;
58 if (isA<surfMesh>(obr))
60 const surfMesh& surf = dynamicCast<const surfMesh>(obr);
62 SurfFieldType* ptr = surf.
getObjectPtr<SurfFieldType>(fieldName);
66 ptr =
new SurfFieldType
79 ptr->writeOpt() = IOobject::NO_WRITE;
84 ptr->field() = tfield;
88 TmpFieldType* ptr = obr.
getObjectPtr<TmpFieldType>(fieldName);
92 ptr =
new TmpFieldType
104 ptr->writeOpt() = IOobject::NO_WRITE;
120 const word& fieldName,
121 const word& sampleScheme
126 const auto* volFldPtr =
mesh().findObject<VolFieldType>(fieldName);
131 return sampleOnFaces(*samplerPtr);
145 const labelList& elements = sampleElements_;
147 const auto& vField = sampler.
psi();
148 const label len = elements.size();
152 auto&
values = tvalues.ref();
158 const faceList& fcs = this->surfFaces();
161 for (
label i=0; i < len; ++i)
163 const label celli = elements[i];
164 const point pt = fcs[i].centre(pts);
174 const label nBnd =
mesh().nBoundaryFaces();
180 const auto& bField = vField.boundaryField();
184 const label bFacei = pbm[patchi].
start() -
mesh().nInternalFaces();
189 bField[patchi].size(),
196 for (
label i=0; i < len; ++i)
198 const label bFacei = (elements[i] -
mesh().nInternalFaces());
199 values[i] = bVals[bFacei];
216 auto&
values = tvalues.ref();
222 forAll(sampleElements_, pointi)
226 samplePoints_[pointi],
227 sampleElements_[pointi]
235 forAll(samplePoints_, pointi)
237 const label facei = sampleElements_[pointi];
241 samplePoints_[pointi],
242 mesh().faceOwner()[facei],
Type * getObjectPtr(const word &name, const bool recursive=false) const
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool sampleType(const objectRegistry &store, const word &fieldName, const word &sampleScheme) const
Sample the volume field onto surface,.
A class for handling words, derived from Foam::string.
A primitive field of type <T> with automated input and output.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A class for managing temporary objects.
static constexpr const zero Zero
Global zero.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
A List obtained as a section of another List.
const Time & time() const
Return time.
static word timeName(const scalar t, const int precision=precision_)
A surface mesh consisting of general polygon faces.
label start() const
The start label of the boundary faces in the polyMesh face list.
#define forAll(list, i)
Loop across all elements in list.
const GeometricField< Type, fvPatchField, volMesh > & psi() const
Return the field to be interpolated.
Registry of regIOobjects.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Abstract base class for interpolation.
Generic dimensioned Type class.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
void store()
Transfer ownership of this object to its registry.
tmp< Field< Type > > sampleOnPoints(const interpolation< Type > &interpolator) const
Sample field on surface points.
virtual Type interpolate(const vector &position, const label celli, const label facei=-1) const =0
Interpolate field to the given point in the given cell.
tmp< Field< Type > > sampleOnFaces(const interpolation< Type > &sampler) const
Sample field on surface faces.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...