Go to the documentation of this file.
45 if (len != fcs.size())
49 <<
"sampled elements (" << len
50 <<
") != faces (" << fcs.size() <<
')'
55 auto&
values = tvalues.ref();
57 for (
label i=0; i < len; ++i)
59 const label celli = elements[i];
60 const point pt = fcs[i].centre(pts);
83 mesh.time().timeName(),
92 auto& cellAvg = tcellAvg.ref();
96 for (
label pointi = 0; pointi <
mesh.nPoints(); ++pointi)
98 const Type&
val = pfld[pointi];
101 for (
const label celli : pCells)
103 cellAvg[celli] +=
val;
104 ++nPointCells[celli];
110 cellAvg[celli] /= nPointCells[celli];
114 cellAvg.correctBoundaryConditions();
122 template<
class Type,
class GeoMeshType>
126 const word& fieldName,
132 polySurface* surfptr = this->getRegistrySurface(obr, lookupName);
146 template<
class Type,
class GeoMeshType>
150 const word& fieldName,
156 polySurface* surfptr = this->getRegistrySurface(obr, lookupName);
162 fieldName, dims, std::move(
values)
170 template<
class Type,
class GeoMeshType>
173 const word& fieldName,
179 surfMesh* surfptr = this->getSurfMesh(lookupName);
193 template<
class Type,
class GeoMeshType>
196 const word& fieldName,
202 surfMesh* surfptr = this->getSurfMesh(lookupName);
208 fieldName, dims, std::move(
values)
Defines the attributes of an object for which implicit objectRegistry management is supported,...
label ListType::const_reference val
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
A class for handling words, derived from Foam::string.
void storeField(const word &fieldName, const dimensionSet &dims, const Field< Type > &values)
Copy/store named field as face or point data (template parameter).
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 surface mesh consisting of general polygon faces.
void storeField(const word &fieldName, const dimensionSet &dims, const Field< Type > &values)
Copy/store named field as face or point data (template parameter).
Dimension set for the base types.
static tmp< GeometricField< Type, fvPatchField, volMesh > > pointAverage(const GeometricField< Type, pointPatchField, pointMesh > &pfld)
Create cell values by averaging the point values.
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
static tmp< Field< Type > > sampleOnFaces(const interpolation< Type > &sampler, const labelUList &elements, const faceList &fcs, const pointField &pts)
General loop for sampling elements to faces.
A surface mesh consisting of general polygon faces and capable of holding fields.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool storeRegistryField(const objectRegistry &obr, const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
Copy/store sampled field onto registered surface (if it exists)
Abstract base class for interpolation.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
Generic GeometricField class.
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.
bool storeSurfMeshField(const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
Copy/store sampled Face field onto surfMesh (if it exists)