41 #ifndef Foam_GeometricField_H 42 #define Foam_GeometricField_H 53 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
56 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
60 const GeometricField<Type, PatchField, GeoMesh>&
63 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
67 const tmp<GeometricField<Type, PatchField, GeoMesh>>&
75 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
78 public DimensionedField<Type, GeoMesh>
100 typedef PatchField<Type>
Patch;
112 mutable label timeIndex_;
115 mutable std::unique_ptr<this_type> field0Ptr_;
118 mutable std::unique_ptr<this_type> fieldPrevIterPtr_;
127 bool readIfPresent();
130 bool readOldTimeIfPresent();
141 template<
class... Args>
161 return NullObjectRef<this_type>();
243 const PtrList<PatchField<Type>>& ptfl
251 const PtrList<PatchField<Type>>& ptfl
259 const PtrList<PatchField<Type>>& ptfl
266 const PtrList<PatchField<Type>>& ptfl
273 const PtrList<PatchField<Type>>& ptfl
313 const PtrList<PatchField<Type>>& ptfl
323 const PtrList<PatchField<Type>>& ptfl
333 const PtrList<PatchField<Type>>& ptfl
341 const bool readOldTime =
true 397 const word& patchFieldType
407 const word& patchFieldType
565 const PtrList<PatchField<Type>>& pflds
580 const PtrList<PatchField<Type>>& pflds
596 const PtrList<PatchField<Type>>& pflds
611 const PtrList<PatchField<Type>>& pflds
760 const word& patchFieldType
771 const word& patchFieldType
804 template<
class AnyType>
819 template<
class AnyType>
875 const
bool updateAccessTime = true
951 word
select(
bool final) const;
955 void writeMinMax(Ostream&
os, label comm = UPstream::worldComm) const;
1018 const dimensioned<Type>&
lower,
1019 const dimensioned<Type>&
upper 1075 friend Ostream& operator<< <Type, PatchField, GeoMesh>
1082 friend Ostream& operator<< <Type, PatchField, GeoMesh>
1122 void
maxMin(const dimensioned<Type>& lo, const dimensioned<Type>& hi)
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place)
const labelList patchIDs(pbm.indices(polyPatchNames, true))
void clamp_range(const dimensioned< MinMax< Type >> &range)
Clamp field values (in-place) to the specified range.
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...
void clearOldTimes()
Remove old-time and prev-iter fields.
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.
label nOldTimes() const noexcept
The number of old time fields stored.
void writeMinMax(Ostream &os, label comm=UPstream::worldComm) const
Helper function to write the min and max to an Ostream.
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.
TypeName("GeometricField")
Runtime type information.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
Generic dimensioned Type class.
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.
bool writeData(Ostream &os) const
The writeData function (required by regIOobject)
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.
bool operator!=(const GeometricField< Type, PatchField, GeoMesh > &)=delete
void storeOldTime() const
Store the old-time field.
void operator*=(const GeometricField< scalar, PatchField, GeoMesh > &)
void operator+=(const GeometricField< Type, PatchField, GeoMesh > &)
void min(const dimensioned< Type > &upper)
Use minimum of the field and specified value. ie, clamp_max().
GeoMesh::Mesh Mesh
The mesh type for the DimensionedField.
#define FOAM_DEPRECATED_STRICT(since, replacement)
void negate()
Negate the field inplace. See notes in Field.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
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 > &)
this_type & constCast() const noexcept
Return non-const reference to this field.
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)
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
label timeIndex() const noexcept
The time index of the field.
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))
void clamp_max(const Type &upper)
Impose upper (ceiling) clamp on the field values (in-place)
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true)
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.
static const this_type & null() noexcept
Return a null GeometricField (reference to a nullObject).
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...
const Mesh & mesh() const noexcept
Return const reference to mesh.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
friend Ostream & operator(Ostream &, const GeometricField< Type, PatchField, GeoMesh > &)
Calls GeometricField::writeData()
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
GeometricField< Type, PatchField, GeoMesh > this_type
The template instance used for this GeometricField type.
A class for managing temporary objects.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Foam::argList args(argc, argv)
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 correctLocalBoundaryConditions()
Correct boundary conditions after a purely local operation.
void replace(const direction d, const GeometricField< cmptType, PatchField, GeoMesh > &gcf)
Replace specified field component with content from another field.