31 bool Foam::sampledSurface::checkFieldSize(
const Field<Type>& field)
const
38 if (field.size() !=
faces().size())
42 <<
"field (" << field.size()
43 <<
") != surface (" <<
faces().
size() <<
")"
56 if (checkFieldSize(field))
58 value =
sum(field*magSf());
69 Type value = integrate(field());
80 if (checkFieldSize(field))
82 value =
sum(field*magSf());
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
134 Field<ReturnType>& res,
135 const tmp<Field<Type>>& field
138 project(res, field());
143 template<
class ReturnType,
class Type>
145 Foam::sampledSurface::project
151 project(tRes(), field);
#define forAll(list, i)
Loop across all elements in list.
Pre-declare SubField and related Field type.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
virtual const faceList & faces() const =0
Faces of surface.
Type average(const Field< Type > &) const
Area-averaged value of a field across the surface.
Type integrate(const Field< Type > &) const
Integration of a field across the surface.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensioned< scalar > mag(const dimensioned< Type > &)