variablesSet Class Reference

Base class for creating a set of variables. More...

Inheritance diagram for variablesSet:
[legend]
Collaboration diagram for variablesSet:
[legend]

Public Member Functions

 TypeName ("variablesSet")
 Run-time type information. More...
 
 variablesSet (fvMesh &mesh, const dictionary &dict)
 Construct from mesh and solver name. More...
 
virtual autoPtr< variablesSetclone () const
 Clone the variablesSet. More...
 
virtual ~variablesSet ()=default
 Destructor. More...
 
const wordsolverName () const
 Return solver name. More...
 
bool useSolverNameForFields () const
 Append solver name to fields? More...
 
template<class Type >
tmp< GeometricField< Type, fvPatchField, volMesh > > allocateField (const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 
template<class Type >
void renameTurbulenceField (GeometricField< Type, fvPatchField, volMesh > &baseField, const word &solverName)
 
tmp< surfaceScalarFieldallocateFluxField (const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 
virtual void transfer (variablesSet &vars)
 Transfer the fields of another variablesSet to this. More...
 

Static Public Member Functions

template<class Type >
static void setField (autoPtr< GeometricField< Type, fvPatchField, volMesh >> &fieldPtr, const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 Read vol fields. More...
 
static void setFluxField (autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 Set flux field. More...
 
static tmp< volVectorFieldautoCreateMeshMovementField (const fvMesh &mesh, const word &name, const dimensionSet &dims)
 Auto create variable for mesh movement. More...
 
template<class Type , template< class > class PatchField, class GeoMesh >
static void nullifyField (GeometricField< Type, PatchField, GeoMesh > &fieldPtr)
 Nullify field and old times, if present. More...
 

Protected Member Functions

template<class Type , template< class > class PatchField, class GeoMesh >
autoPtr< GeometricField< Type, PatchField, GeoMesh > > allocateRenamedField (const autoPtr< GeometricField< Type, PatchField, GeoMesh >> &bf)
 
template<class Type , template< class > class PatchField, class GeoMesh >
void swapAndRename (autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p1, autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p2)
 Swap autoPtrs and rename managed fields. More...
 

Protected Attributes

fvMeshmesh_
 Reference to the mesh database. More...
 
word solverName_
 Solver name owning the variables set. More...
 
bool useSolverNameForFields_
 Append the solver name to the variables names? More...
 

Detailed Description

Base class for creating a set of variables.

Definition at line 49 of file variablesSet.H.

Constructor & Destructor Documentation

◆ variablesSet()

variablesSet ( fvMesh mesh,
const dictionary dict 
)

Construct from mesh and solver name.

Definition at line 61 of file variablesSet.C.

◆ ~variablesSet()

virtual ~variablesSet ( )
virtualdefault

Destructor.

Member Function Documentation

◆ allocateRenamedField()

autoPtr< GeometricField< Type, PatchField, GeoMesh > > allocateRenamedField ( const autoPtr< GeometricField< Type, PatchField, GeoMesh >> &  bf)
protected

Definition at line 167 of file variablesSetTemplates.C.

References Foam::name(), autoPtr< T >::reset(), and timeName.

Here is the call graph for this function:

◆ swapAndRename()

void swapAndRename ( autoPtr< GeometricField< Type, PatchField, GeoMesh >> &  p1,
autoPtr< GeometricField< Type, PatchField, GeoMesh >> &  p2 
)
protected

Swap autoPtrs and rename managed fields.

Definition at line 191 of file variablesSetTemplates.C.

Referenced by incompressibleVars::transfer().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "variablesSet"  )

Run-time type information.

◆ clone()

autoPtr< variablesSet > clone ( ) const
virtual

Clone the variablesSet.

Not implemented in base. Should be overloaded in derived classes

Reimplemented in incompressibleVars.

Definition at line 75 of file variablesSet.C.

References NotImplemented.

◆ solverName()

◆ useSolverNameForFields()

bool useSolverNameForFields ( ) const

Append solver name to fields?

Definition at line 90 of file variablesSet.C.

References variablesSet::useSolverNameForFields_.

Referenced by adjointSpalartAllmaras::adjointSpalartAllmaras().

Here is the caller graph for this function:

◆ setField()

void setField ( autoPtr< GeometricField< Type, fvPatchField, volMesh >> &  fieldPtr,
const fvMesh mesh,
const word baseName,
const word solverName,
const bool  useSolverNameForFields 
)
static

Read vol fields.

Definition at line 222 of file variablesSetTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and mesh.

Referenced by adjointSpalartAllmaras::adjointSpalartAllmaras(), incompressibleVars::setFields(), and incompressibleAdjointMeanFlowVars::setFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocateField()

tmp< GeometricField< Type, fvPatchField, volMesh > > allocateField ( const fvMesh mesh,
const word baseName,
const word solverName,
const bool  useSolverNameForFields 
)

Definition at line 257 of file variablesSetTemplates.C.

References mesh, autoPtr< T >::ptr(), and setField().

Here is the call graph for this function:

◆ renameTurbulenceField()

void renameTurbulenceField ( GeometricField< Type, fvPatchField, volMesh > &  baseField,
const word solverName 
)

Turbulence model always reads fields with the prescribed name If a custom name is supplied, check whether this field exists, copy it to the field known by the turbulence model and re-name the latter

Definition at line 275 of file variablesSetTemplates.C.

References IOobject::AUTO_WRITE, GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), Foam::endl(), forAll, Foam::Info, mesh, IOobject::MUST_READ, Foam::nl, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), GeometricField< Type, PatchField, GeoMesh >::ref(), fvMesh::time(), and Time::timeName().

Referenced by incompressibleVars::renameTurbulenceFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFluxField()

void setFluxField ( autoPtr< surfaceScalarField > &  fieldPtr,
const fvMesh mesh,
const volVectorField velocity,
const word baseName,
const word solverName,
const bool  useSolverNameForFields 
)
static

Set flux field.

Definition at line 97 of file variablesSet.C.

References IOobject::AUTO_WRITE, Foam::linearInterpolate(), mesh, IOobject::READ_IF_PRESENT, autoPtr< T >::reset(), fvMesh::Sf(), fvMesh::time(), and Time::timeName().

Referenced by incompressibleVars::setFields(), and incompressibleAdjointMeanFlowVars::setFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocateFluxField()

tmp< surfaceScalarField > allocateFluxField ( const fvMesh mesh,
const volVectorField velocity,
const word baseName,
const word solverName,
const bool  useSolverNameForFields 
)

Definition at line 149 of file variablesSet.C.

References mesh, and autoPtr< T >::ptr().

Here is the call graph for this function:

◆ autoCreateMeshMovementField()

tmp< volVectorField > autoCreateMeshMovementField ( const fvMesh mesh,
const word name,
const dimensionSet dims 
)
static

Auto create variable for mesh movement.

Definition at line 173 of file variablesSet.C.

References mesh, tmp< T >::New(), IOobject::NO_WRITE, IOobject::READ_IF_PRESENT, fvMesh::time(), Time::timeName(), and Foam::Zero.

Here is the call graph for this function:

◆ nullifyField()

void nullifyField ( GeometricField< Type, PatchField, GeoMesh > &  fieldPtr)
static

Nullify field and old times, if present.

Definition at line 347 of file variablesSetTemplates.C.

References field(), oldTime, and Foam::Zero.

Referenced by incompressibleAdjointMeanFlowVars::nullify(), and adjointSpalartAllmaras::nullify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transfer()

void transfer ( variablesSet vars)
virtual

Transfer the fields of another variablesSet to this.

Reimplemented in incompressibleVars.

Definition at line 196 of file variablesSet.C.

Member Data Documentation

◆ mesh_

◆ solverName_

word solverName_
protected

◆ useSolverNameForFields_

bool useSolverNameForFields_
protected

The documentation for this class was generated from the following files: