41 #ifndef Foam_GeometricField_H 42 #define Foam_GeometricField_H 55 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
58 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
62 const GeometricField<Type, PatchField, GeoMesh>&
65 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
69 const tmp<GeometricField<Type, PatchField, GeoMesh>>&
77 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
80 public DimensionedField<Type, GeoMesh>
111 mutable label timeIndex_;
126 bool readIfPresent();
129 bool readOldTimeIfPresent();
227 const PtrList<PatchField<Type>>& ptfl
235 const PtrList<PatchField<Type>>& ptfl
243 const PtrList<PatchField<Type>>& ptfl
250 const PtrList<PatchField<Type>>& ptfl
257 const PtrList<PatchField<Type>>& ptfl
287 const PtrList<PatchField<Type>>& ptfl
297 const PtrList<PatchField<Type>>& ptfl
307 const PtrList<PatchField<Type>>& ptfl
315 const bool readOldTime =
true 371 const word& patchFieldType
381 const word& patchFieldType
513 const word& patchFieldType
531 template<
class AnyType>
544 template<
class AnyType>
594 const
bool updateAccessTime = true
764 friend Ostream& operator<< <Type, PatchField, GeoMesh>
770 friend Ostream& operator<< <Type, PatchField, GeoMesh>
788 void clip(
const dimensioned<Type>& lo,
const dimensioned<Type>& hi)
806 void
maxMin(const dimensioned<Type>& lo, const dimensioned<Type>& hi)
813 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
817 const typename GeometricField<Type, PatchField, GeoMesh>::
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place)
void clamp_range(const dimensioned< MinMax< Type >> &range)
Clamp field values (in-place) to the specified range.
const labelList patchIDs(pbm.patchSet(polyPatchNames, false, true).sortedToc())
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
GeoMesh::BoundaryMesh BoundaryMesh
The boundary mesh type for the boundary fields.
void operator=(const GeometricField< Type, PatchField, GeoMesh > &)
void maxMin(const dimensioned< Type > &lo, const dimensioned< Type > &hi)
Deprecated(2019-01) identical to clamp_range()
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool writeData(Ostream &) const
WriteData member function required by regIOobject.
const word & name() const noexcept
Return the object name.
Field< Type >::cmptType cmptType
Component type of the field elements.
MESH::BoundaryMesh BoundaryMesh
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
pTraits< Type >::cmptType cmptType
Component type.
A min/max value pair with additional methods. In addition to conveniently storing values...
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct given IOobject, mesh, dimensions and patch type.
void operator/=(const GeometricField< scalar, PatchField, GeoMesh > &)
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
GeoMesh::Mesh Mesh
The mesh type for the GeometricField.
void clip(const dimensioned< MinMax< Type >> &range)
Clamp field values (in-place) to the specified range.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
TypeName("GeometricField")
Runtime type information.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
Generic dimensioned Type class.
label nOldTimes() const
Return the number of old time fields stored.
DimensionedField< Type, GeoMesh > Internal
The internal field type from which this GeometricField is derived.
Field< Type > FieldType
Type of the field from which this DimensionedField is derived.
word select(bool final) const
Select the final iteration parameters if final is true by returning the field name + "Final" otherwis...
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
const word calculatedType
A calculated patch field type.
bool needReference() const
Does the field need a reference level for solution.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
const Internal & v() const
Return a const-reference to the dimensioned internal field of a "vol" field.
void storeOldTimes() const
Store the old-time fields.
Generic templated field type.
A class for handling words, derived from Foam::string.
void storeOldTime() const
Store the old-time field.
void operator*=(const GeometricField< scalar, PatchField, GeoMesh > &)
void operator+=(const GeometricField< Type, PatchField, GeoMesh > &)
void writeMinMax(Ostream &os) const
Helper function to write the min and max to an Ostream.
void min(const dimensioned< Type > &upper)
Use minimum of the field and specified value. ie, clamp_max().
GeoMesh::Mesh Mesh
Type of mesh on which this DimensionedField is instantiated.
void negate()
Negate the field inplace. See notes in Field.
const Mesh & mesh() const noexcept
Return mesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Internal & internalFieldRef(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
void operator-=(const GeometricField< Type, PatchField, GeoMesh > &)
void normalise()
Normalise the field inplace. See notes in Field.
const GeometricField< Type, PatchField, GeoMesh > & prevIter() const
Return previous iteration field.
OBJstream os(runTime.globalPath()/outputName)
virtual ~GeometricField()
Destructor.
Generic GeometricBoundaryField class.
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))
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
void clamp_max(const Type &upper)
Impose upper (ceiling) clamp on the field values (in-place)
List< word > wordList
List of word.
void operator==(const tmp< GeometricField< Type, PatchField, GeoMesh >> &)
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
tmp< GeometricField< Type, PatchField, GeoMesh > > clone() const
Clone.
label timeIndex() const noexcept
Return the time index of the field.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
PatchField< Type > Patch
The patch field type for the GeometricBoundaryField.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
void max(const dimensioned< Type > &lower)
Use maximum of the field and specified value. ie, clamp_min().
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
friend Ostream & operator(Ostream &, const GeometricField< Type, PatchField, GeoMesh > &)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
void storePrevIter() const
Store the field as the previous iteration value.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
A class for managing temporary objects.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Defines the attributes of an object for which implicit objectRegistry management is supported...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
void relax()
Relax field (for steady-state solution).
void replace(const direction d, const GeometricField< cmptType, PatchField, GeoMesh > &gcf)
Replace specified field component with content from another field.