Go to the documentation of this file.
35 #define checkField(df1, df2, op) \
36 if (&(df1).mesh() != &(df2).mesh()) \
38 FatalErrorInFunction \
39 << "different mesh for fields " \
40 << (df1).name() << " and " << (df2).name() \
41 << " during operation " << op \
42 << abort(FatalError); \
48 template<
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 = "
69 template<
class Type,
class GeoMesh>
88 template<
class Type,
class GeoMesh>
107 template<
class Type,
class GeoMesh>
126 template<
class Type,
class GeoMesh>
146 template<
class Type,
class GeoMesh>
152 const bool checkIOFlags
168 template<
class Type,
class GeoMesh>
174 const bool checkIOFlags
190 template<
class Type,
class GeoMesh>
199 dimensions_(df.dimensions_),
200 oriented_(df.oriented_)
204 template<
class Type,
class GeoMesh>
214 template<
class Type,
class GeoMesh>
224 dimensions_(df.dimensions_),
225 oriented_(df.oriented_)
229 template<
class Type,
class GeoMesh>
241 template<
class Type,
class GeoMesh>
251 dimensions_(df.dimensions_),
252 oriented_(df.oriented_)
256 template<
class Type,
class GeoMesh>
267 template<
class Type,
class GeoMesh>
278 dimensions_(df.dimensions_),
279 oriented_(df.oriented_)
283 template<
class Type,
class GeoMesh>
296 template<
class Type,
class GeoMesh>
306 dimensions_(df.dimensions_),
307 oriented_(df.oriented_)
311 template<
class Type,
class GeoMesh>
322 template<
class Type,
class GeoMesh>
333 dimensions_(df.dimensions_),
334 oriented_(df.oriented_)
338 template<
class Type,
class GeoMesh>
351 template<
class Type,
class GeoMesh>
361 template<
class Type,
class GeoMesh>
392 template<
class Type,
class GeoMesh>
396 const DimensionedField
398 typename DimensionedField<Type, GeoMesh>::cmptType, GeoMesh
402 Field<Type>::replace(d, df);
406 template<
class Type,
class GeoMesh>
414 typename DimensionedField<Type, GeoMesh>::cmptType, GeoMesh
424 template<
class Type,
class GeoMesh>
446 template<
class Type,
class GeoMesh>
452 this->
name() +
".average()",
459 template<
class Type,
class GeoMesh>
468 this->
name() +
".weightedAverage(weights)",
475 template<
class Type,
class GeoMesh>
482 tweightField.clear();
489 template<
class Type,
class GeoMesh>
508 template<
class Type,
class GeoMesh>
514 auto& df = tdf.constCast();
530 template<
class Type,
class GeoMesh>
541 #define COMPUTED_ASSIGNMENT(TYPE, op) \
543 template<class Type, class GeoMesh> \
544 void Foam::DimensionedField<Type, GeoMesh>::operator op \
546 const DimensionedField<TYPE, GeoMesh>& df \
549 checkField(*this, df, #op); \
551 dimensions_ op df.dimensions(); \
552 oriented_ op df.oriented(); \
553 Field<Type>::operator op(df); \
556 template<class Type, class GeoMesh> \
557 void Foam::DimensionedField<Type, GeoMesh>::operator op \
559 const tmp<DimensionedField<TYPE, GeoMesh>>& tdf \
562 operator op(tdf()); \
566 template<class Type, class GeoMesh> \
567 void Foam::DimensionedField<Type, GeoMesh>::operator op \
569 const dimensioned<TYPE>& dt \
572 dimensions_ op dt.dimensions(); \
573 Field<Type>::operator op(dt.value()); \
581 #undef COMPUTED_ASSIGNMENT
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
#define checkField(df1, df2, op)
Type gAverage(const FieldField< Field, Type > &f)
DimensionedField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &field)
Construct from components.
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.
const Type & value() const
Return const reference to value.
Type gSum(const FieldField< Field, Type > &f)
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
tmp< DimensionedField< Type, GeoMesh > > clone() const
Clone.
Foam::pointMesh ::Mesh Mesh
Type of mesh on which this DimensionedField is instantiated.
Generic templated field type.
Field< Type >::cmptType cmptType
Component type of the elements of the field.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Generic dimensioned Type class.
#define COMPUTED_ASSIGNMENT(TYPE, op)
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
errorManip< error > abort(error &err)
const orientedType & oriented() const noexcept
Return oriented type.
const dimensionSet & dimensions() const
Return dimensions.
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
Calculate and return weighted average.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction d) const
Return a component field of the field.
const dimensionSet & dimensions() const
Return const reference to dimensions.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...