31 bool Foam::sampledSurface::checkFieldSize(
const Field<Type>& field)
const 42 <<
"field (" << field.size()
43 <<
") != surface (" <<
faces().
size() <<
")" 56 if (checkFieldSize(field))
80 if (checkFieldSize(field))
108 template<
class ReturnType,
class Type>
109 void Foam::sampledSurface::project
115 if (checkFieldSize(field))
121 res[facei] = field[facei] & (norm[facei]/
mag(norm[facei]));
131 template<
class ReturnType,
class Type>
132 void Foam::sampledSurface::project
138 project(res,
field());
143 template<
class ReturnType,
class Type>
145 Foam::sampledSurface::project
151 project(tRes(), field);
178 for (
label pointi = 0; pointi < mesh.
nPoints(); pointi++)
184 label celli = pCells[i];
186 cellAvg[celli] += pfld[pointi];
187 nPointCells[celli]++;
193 cellAvg[celli] /= nPointCells[celli];
Type integrate(const Field< Type > &) const
Integration of a field across the surface.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
T & ref() const
Return non-const reference or generate a fatal error.
void size(const label)
Override size to be inconsistent with allocated storage.
const dimensionSet dimless
Generic dimensioned Type class.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual const faceList & faces() const =0
Faces of surface.
tmp< GeometricField< Type, fvPatchField, volMesh > > pointAverage(const GeometricField< Type, pointPatchField, pointMesh > &pfld) const
Interpolate from points to cell centre.
Pre-declare SubField and related Field type.
void clear()
Clear the list, i.e. set size to zero.
Type average(const Field< Type > &) const
Area-averaged value of a field across the surface.
scalar area() const
The total surface area.
const polyMesh & mesh() const
Access to the underlying mesh.
const labelListList & pointCells() const
const Mesh & mesh() const
Return mesh.
virtual const vectorField & Sf() const
Return face area vectors.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
virtual const scalarField & magSf() const
Return face area magnitudes.
Mesh data needed to do the Finite Volume discretisation.
void correctBoundaryConditions()
Correct boundary field.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.