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>
115 mutable label timeIndex_;
118 mutable std::unique_ptr<this_type> field0Ptr_;
121 mutable std::unique_ptr<this_type> fieldPrevIterPtr_;
130 bool readIfPresent();
133 bool readOldTimeIfPresent();
144 template<
class... Args>
164 return NullObjectRef<GeometricField<Type, PatchField, GeoMesh>>();
246 const PtrList<PatchField<Type>>& ptfl
254 const PtrList<PatchField<Type>>& ptfl
262 const PtrList<PatchField<Type>>& ptfl
269 const PtrList<PatchField<Type>>& ptfl
276 const PtrList<PatchField<Type>>& ptfl
306 const PtrList<PatchField<Type>>& ptfl
316 const PtrList<PatchField<Type>>& ptfl
326 const PtrList<PatchField<Type>>& ptfl
334 const bool readOldTime =
true 390 const word& patchFieldType
400 const word& patchFieldType
527 const PtrList<PatchField<Type>>& pflds
542 const PtrList<PatchField<Type>>& pflds
558 const PtrList<PatchField<Type>>& pflds
573 const PtrList<PatchField<Type>>& pflds
722 const word& patchFieldType
733 const word& patchFieldType
766 template<
class AnyType>
781 template<
class AnyType>
831 const
bool updateAccessTime = true
976 void operator=(
const GeometricField<Type, PatchField, GeoMesh>&);
977 void operator=(
const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
978 void operator=(
const dimensioned<Type>&);
980 void operator==(
const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
983 void operator+=(
const GeometricField<Type, PatchField, GeoMesh>&);
984 void operator+=(
const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
986 void operator-=(
const GeometricField<Type, PatchField, GeoMesh>&);
987 void operator-=(
const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
989 void operator*=(
const GeometricField<scalar, PatchField, GeoMesh>&);
990 void operator*=(
const tmp<GeometricField<scalar,PatchField,GeoMesh>>&);
1022 friend Ostream& operator<< <Type, PatchField, GeoMesh>
1029 friend Ostream& operator<< <Type, PatchField, GeoMesh>
1065 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 Type & value() const noexcept
Return const reference to value.
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.
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.
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 > &)
static const GeometricField< Type, PatchField, GeoMesh > & null() noexcept
Return a null GeometricField (reference to a nullObject).
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
The mesh type for the DimensionedField.
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...
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))
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.
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 > &)
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.
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.
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.