Loading...
Searching...
No Matches
variablesSet Class Reference

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

#include <variablesSet.H>

Inheritance diagram for variablesSet:
Collaboration diagram for variablesSet:

Public Member Functions

 TypeName ("variablesSet")
 Run-time type information.
 variablesSet (fvMesh &mesh, const dictionary &dict)
 Construct from mesh and solver name.
virtual autoPtr< variablesSet > clone () const
 Clone the variablesSet.
virtual ~variablesSet ()=default
 Destructor.
const wordsolverName () const
 Return solver name.
bool useSolverNameForFields () const
 Append solver name to fields?
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)
 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.
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.

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.
static void setFluxField (autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 Set flux field.
static tmp< volVectorFieldautoCreateMeshMovementField (const fvMesh &mesh, const word &name, const dimensionSet &dims)
 Auto create variable for mesh movement.
template<class Type, template< class > class PatchField, class GeoMesh>
static void nullifyField (GeometricField< Type, PatchField, GeoMesh > &fieldPtr)
 Nullify field and old times, if present.

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.

Protected Attributes

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

Detailed Description

Base class for creating a set of variables.

Definition at line 43 of file variablesSet.H.

Constructor & Destructor Documentation

◆ variablesSet()

variablesSet ( fvMesh & mesh,
const dictionary & dict )

Construct from mesh and solver name.

Definition at line 53 of file variablesSet.C.

References dict, dictName(), mesh, mesh_, solverName_, and useSolverNameForFields_.

Here is the call graph for this function:

◆ ~variablesSet()

virtual ~variablesSet ( )
virtualdefault

Destructor.

References mesh, Foam::name(), solverName(), and useSolverNameForFields().

Here is the call graph for this function:

Member Function Documentation

◆ allocateRenamedField()

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

Definition at line 159 of file variablesSetTemplates.C.

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

Referenced by incompressibleVars::incompressibleVars().

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

◆ swapAndRename()

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

Swap autoPtrs and rename managed fields.

Definition at line 183 of file variablesSetTemplates.C.

Referenced by incompressibleVars::transfer().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "variablesSet" )

Run-time type information.

References dict, and mesh.

◆ 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 68 of file variablesSet.C.

References NotImplemented.

Referenced by renameTurbulenceField().

Here is the caller graph for this function:

◆ solverName()

◆ useSolverNameForFields()

bool useSolverNameForFields ( ) const

Append solver name to fields?

Definition at line 83 of file variablesSet.C.

References useSolverNameForFields_.

Referenced by adjointkOmegaSST::adjointkOmegaSST(), adjointSpalartAllmaras::adjointSpalartAllmaras(), allocateField(), allocateFluxField(), setField(), setFluxField(), and ~variablesSet().

Here is the caller graph for this function:

◆ setField()

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

◆ allocateField()

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

Definition at line 249 of file variablesSetTemplates.C.

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

Here is the call graph for this function:

◆ renameTurbulenceField()

template<class Type>
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 267 of file variablesSetTemplates.C.

References IOobjectOption::AUTO_WRITE, GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), clone(), Foam::endl(), forAll, Foam::Info, DimensionedField< Type, GeoMesh >::mesh(), mesh, IOobjectOption::MUST_READ, IOobject::name(), Foam::nl, IOobjectOption::NO_REGISTER, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), GeometricField< Type, PatchField, GeoMesh >::ref(), regIOobject::rename(), PtrList< T >::set(), solverName(), and IOobject::typeHeaderOk().

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 89 of file variablesSet.C.

References IOobjectOption::AUTO_WRITE, Foam::linearInterpolate(), mesh, IOobjectOption::READ_IF_PRESENT, autoPtr< T >::reset(), solverName(), and useSolverNameForFields().

Referenced by allocateFluxField(), incompressibleAdjointMeanFlowVars::setFields(), and incompressibleVars::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 141 of file variablesSet.C.

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

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 165 of file variablesSet.C.

References mesh, tmp< T >::New(), IOobjectOption::NO_WRITE, IOobjectOption::READ_IF_PRESENT, and Foam::Zero.

Referenced by shapeDesignVariables::solveMeshMovementEqn().

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

◆ nullifyField()

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

Nullify field and old times, if present.

Definition at line 339 of file variablesSetTemplates.C.

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

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

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 189 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:
  • src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSet.H
  • src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSet.C
  • src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/variablesSet/variablesSetTemplates.C