41 #ifndef Foam_DimensionedField_H 42 #define Foam_DimensionedField_H 55 template<
class Type,
class GeoMesh>
class DimensionedField;
57 template<
class Type,
class GeoMesh>
61 const DimensionedField<Type, GeoMesh>& df
64 template<
class Type,
class GeoMesh>
68 const tmp<DimensionedField<Type, GeoMesh>>& tdf
76 template<
class Type,
class GeoMesh>
77 class DimensionedField
119 void checkFieldSize()
const;
122 bool readIfPresent(
const word& fieldDictEntry =
"value");
125 void readField(
const word& fieldDictEntry =
"value");
130 template<
class... Args>
150 return NullObjectRef<this_type>();
200 const bool checkIOFlags =
true 211 const bool checkIOFlags =
true 222 const bool checkIOFlags =
true 230 const word& fieldDictEntry =
"value" 239 const word& fieldDictEntry =
"value" 506 template<
class AnyType>
519 template<
class AnyType>
539 const word& fieldDictEntry =
"value" 576 tmp<DimensionedField<cmptType, GeoMesh>>
component 585 const DimensionedField<cmptType, GeoMesh>& df
592 const tmp<DimensionedField<cmptType, GeoMesh>>& tdf
598 tmp<DimensionedField<Type, GeoMesh>>
T()
const;
606 const DimensionedField<scalar, GeoMesh>& weights,
613 const tmp<DimensionedField<scalar, GeoMesh>>& tweights,
622 bool writeData(Ostream&
os,
const word& fieldDictEntry)
const;
631 void operator=(
const DimensionedField<Type, GeoMesh>& df);
632 void operator=(
const tmp<DimensionedField<Type, GeoMesh>>& tdf);
635 void operator=(
const dimensioned<Type>& dt);
637 void operator+=(
const DimensionedField<Type, GeoMesh>& df);
638 void operator+=(
const tmp<DimensionedField<Type, GeoMesh>>& tdf);
640 void operator-=(
const DimensionedField<Type, GeoMesh>& df);
641 void operator-=(
const tmp<DimensionedField<Type, GeoMesh>>& tdf);
643 void operator*=(
const DimensionedField<scalar, GeoMesh>& df);
644 void operator*=(
const tmp<DimensionedField<scalar, GeoMesh>>& tdf);
646 void operator/=(
const DimensionedField<scalar, GeoMesh>& df);
647 void operator/=(
const tmp<DimensionedField<scalar, GeoMesh>>& tdf);
652 void operator*=(
const dimensioned<scalar>& dt);
653 void operator/=(
const dimensioned<scalar>& dt);
659 friend Ostream& operator<< <Type, GeoMesh>
662 const DimensionedField<Type, GeoMesh>& df
666 friend Ostream& operator<< <Type, GeoMesh>
tmp< DimensionedField< Type, GeoMesh > > clone() const
Clone.
static const this_type & null() noexcept
Return a null DimensionedField (reference to a nullObject).
dimensioned< Type > average(const label comm=UPstream::worldComm) const
Return the global arithmetic average.
void replace(const direction d, const DimensionedField< cmptType, GeoMesh > &df)
Replace a component field of the field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weights, const label comm=UPstream::worldComm) const
Return the global weighted average.
const word & name() const noexcept
Return the object name.
DimensionedField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &field)
Construct from components, copy initial field content.
pTraits< Type >::cmptType cmptType
Component type.
bool is_oriented() const noexcept
True if field is ORIENTED.
void operator-=(const DimensionedField< Type, GeoMesh > &df)
Class to determine the 'oriented' status of surface fields.
Generic dimensioned Type class.
Field< Type >::cmptType cmptType
Component type of the field elements.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
DimensionedField< Type, GeoMesh > this_type
The template instance used for this DimensionedField type.
Field< Type > FieldType
Type of the field from which this DimensionedField is derived.
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction d) const
Return a component field of the field.
orientedType oriented() const noexcept
Return oriented type.
void operator/=(const DimensionedField< scalar, GeoMesh > &df)
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic templated field type.
bool writeData(Ostream &os, const word &fieldDictEntry) const
Write dimensions, oriented flag (if valid) and the field data as a dictionary entry with the specifie...
A class for handling words, derived from Foam::string.
void operator*=(const DimensionedField< scalar, GeoMesh > &df)
void operator=(const DimensionedField< Type, GeoMesh > &df)
void setOriented(bool on=true) noexcept
Set the oriented flag: on/off.
void operator+=(const DimensionedField< Type, GeoMesh > &df)
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
TypeName("DimensionedField")
Runtime type information.
virtual ~DimensionedField()
Destructor.
GeoMesh::Mesh Mesh
The mesh type for the DimensionedField.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
const dimensionSet & dimensions() const noexcept
Return dimensions.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true)
const Field< Type > & field() const noexcept
Return const-reference to the primitive field values.
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const noexcept
Return const reference to mesh.
DimensionedField< Type, GeoMesh > Internal
The DimensionedField is usually synonymous with an internal field.
constexpr Field() noexcept
Default construct.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
A class for managing temporary objects.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
this_type & constCast() const noexcept
Return non-const reference to this field.