35#define checkField(df1, df2, op) \
36if (&(df1).mesh() != &(df2).mesh()) \
38 FatalErrorInFunction \
39 << "different mesh for fields " \
40 << (df1).name() << " and " << (df2).name() \
41 << " during operation " << op \
42 << abort(FatalError); \
48template<
class Type,
class GeoMesh>
51 const label fieldSize = this->size();
54 const label meshSize = GeoMesh::size(this->mesh_);
55 if (fieldSize != meshSize)
58 <<
"size of field = " << fieldSize
59 <<
" is not the same as the size of mesh = "
69template<
class Type,
class GeoMesh>
88template<
class Type,
class GeoMesh>
106template<
class Type,
class GeoMesh>
124template<
class Type,
class GeoMesh>
134 Field<Type>(tfield.constCast(), tfield.movable()),
144template<
class Type,
class GeoMesh>
150 const bool checkIOFlags
166template<
class Type,
class GeoMesh>
172 const bool checkIOFlags
178 dimensions_(dt.dimensions()),
188template<
class Type,
class GeoMesh>
197 dimensions_(df.dimensions_),
198 oriented_(df.oriented_)
202template<
class Type,
class GeoMesh>
212template<
class Type,
class GeoMesh>
220 Field<Type>(df, reuse),
222 dimensions_(df.dimensions_),
223 oriented_(df.oriented_)
227template<
class Type,
class GeoMesh>
239template<
class Type,
class GeoMesh>
249 dimensions_(df.dimensions_),
250 oriented_(df.oriented_)
254template<
class Type,
class GeoMesh>
265template<
class Type,
class GeoMesh>
276 dimensions_(df.dimensions_),
277 oriented_(df.oriented_)
281template<
class Type,
class GeoMesh>
294template<
class Type,
class GeoMesh>
304 dimensions_(df.dimensions_),
305 oriented_(df.oriented_)
309template<
class Type,
class GeoMesh>
320template<
class Type,
class GeoMesh>
329 Field<Type>(df, reuse),
331 dimensions_(df.dimensions_),
332 oriented_(df.oriented_)
336template<
class Type,
class GeoMesh>
349template<
class Type,
class GeoMesh>
359template<
class Type,
class GeoMesh>
390template<
class Type,
class GeoMesh>
404template<
class Type,
class GeoMesh>
422template<
class Type,
class GeoMesh>
444template<
class Type,
class GeoMesh>
450 this->
name() +
".average()",
457template<
class Type,
class GeoMesh>
466 this->
name() +
".weightedAverage(weights)",
473template<
class Type,
class GeoMesh>
480 tweightField.clear();
487template<
class Type,
class GeoMesh>
500 dimensions_ = df.dimensions();
501 oriented_ = df.oriented();
506template<
class Type,
class GeoMesh>
512 auto& df = tdf.constCast();
521 dimensions_ = df.dimensions();
522 oriented_ = df.oriented();
528template<
class Type,
class GeoMesh>
539#define COMPUTED_ASSIGNMENT(TYPE, op) \
541template<class Type, class GeoMesh> \
542void Foam::DimensionedField<Type, GeoMesh>::operator op \
544 const DimensionedField<TYPE, GeoMesh>& df \
547 checkField(*this, df, #op); \
549 dimensions_ op df.dimensions(); \
550 oriented_ op df.oriented(); \
551 Field<Type>::operator op(df); \
554template<class Type, class GeoMesh> \
555void Foam::DimensionedField<Type, GeoMesh>::operator op \
557 const tmp<DimensionedField<TYPE, GeoMesh>>& tdf \
560 operator op(tdf()); \
564template<class Type, class GeoMesh> \
565void Foam::DimensionedField<Type, GeoMesh>::operator op \
567 const dimensioned<TYPE>& dt \
570 dimensions_ op dt.dimensions(); \
571 Field<Type>::operator op(dt.value()); \
579#undef COMPUTED_ASSIGNMENT
#define checkField(df1, df2, op)
#define COMPUTED_ASSIGNMENT(TYPE, op)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
tmp< DimensionedField< Type, GeoMesh > > clone() const
Clone.
GeoMesh::Mesh Mesh
Type of mesh on which this DimensionedField is instantiated.
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
Calculate and return weighted average.
void replace(const direction d, const DimensionedField< cmptType, GeoMesh > &df)
Replace a component field of the field.
dimensioned< Type > average() const
Calculate and return arithmetic average.
Generic templated field type.
void operator=(const Field< Type > &)
Copy assignment.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void clear()
Clear the list, i.e. set size to zero.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic dimensioned Type class.
const dimensionSet & dimensions() const
Return const reference to dimensions.
const Type & value() const
Return const reference to value.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Type gSum(const FieldField< Field, Type > &f)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Type gAverage(const FieldField< Field, Type > &f)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
propsDict readIfPresent("fields", acceptFields)