Base class for creating a set of variables. More...
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< variablesSet > | clone () const |
Clone the variablesSet. More... | |
virtual | ~variablesSet ()=default |
Destructor. More... | |
const word & | solverName () 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) |
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. More... | |
tmp< surfaceScalarField > | allocateFluxField (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< volVectorField > | autoCreateMeshMovementField (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 | |
fvMesh & | mesh_ |
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... | |
variablesSet | ( | fvMesh & | mesh, |
const dictionary & | dict | ||
) |
Construct from mesh and solver name.
Definition at line 54 of file variablesSet.C.
|
virtualdefault |
Destructor.
|
protected |
Definition at line 160 of file variablesSetTemplates.C.
References Foam::name(), autoPtr< T >::reset(), and timeName.
|
protected |
Swap autoPtrs and rename managed fields.
Definition at line 184 of file variablesSetTemplates.C.
Referenced by incompressibleVars::transfer().
TypeName | ( | "variablesSet" | ) |
Run-time type information.
|
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.
const word & solverName | ( | ) | const |
Return solver name.
Definition at line 77 of file variablesSet.C.
References variablesSet::solverName_.
Referenced by incompressibleAdjointSolver::accumulateOptionsDxDbMultiplier(), adjointkOmegaSST::adjointkOmegaSST(), boundaryAdjointContributionIncompressible::adjointSolverName(), adjointRASModel::adjointSolverName(), adjointSpalartAllmaras::adjointSpalartAllmaras(), boundaryAdjointContributionIncompressible::primalSolverName(), and adjointRASModel::primalSolverName().
bool useSolverNameForFields | ( | ) | const |
Append solver name to fields?
Definition at line 83 of file variablesSet.C.
References variablesSet::useSolverNameForFields_.
Referenced by adjointkOmegaSST::adjointkOmegaSST(), and adjointSpalartAllmaras::adjointSpalartAllmaras().
|
static |
Read vol fields.
Definition at line 215 of file variablesSetTemplates.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and mesh.
Referenced by adjointkOmegaSST::adjointkOmegaSST(), adjointSpalartAllmaras::adjointSpalartAllmaras(), incompressibleVars::setFields(), and incompressibleAdjointMeanFlowVars::setFields().
tmp< GeometricField< Type, fvPatchField, volMesh > > allocateField | ( | const fvMesh & | mesh, |
const word & | baseName, | ||
const word & | solverName, | ||
const bool | useSolverNameForFields | ||
) |
Definition at line 250 of file variablesSetTemplates.C.
References mesh, autoPtr< T >::ptr(), and setField().
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 268 of file variablesSetTemplates.C.
References IOobjectOption::AUTO_WRITE, GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), Foam::endl(), forAll, Foam::Info, mesh, DimensionedField< Type, GeoMesh >::mesh(), IOobjectOption::MUST_READ, IOobject::name(), Foam::nl, IOobjectOption::NO_REGISTER, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), GeometricField< Type, PatchField, GeoMesh >::ref(), regIOobject::rename(), fvMesh::time(), and Time::timeName().
Referenced by incompressibleVars::renameTurbulenceFields().
|
static |
Set flux field.
Definition at line 90 of file variablesSet.C.
References IOobjectOption::AUTO_WRITE, Foam::linearInterpolate(), mesh, IOobjectOption::READ_IF_PRESENT, autoPtr< T >::reset(), fvMesh::Sf(), fvMesh::time(), and Time::timeName().
Referenced by incompressibleVars::setFields(), and incompressibleAdjointMeanFlowVars::setFields().
tmp< surfaceScalarField > allocateFluxField | ( | const fvMesh & | mesh, |
const volVectorField & | velocity, | ||
const word & | baseName, | ||
const word & | solverName, | ||
const bool | useSolverNameForFields | ||
) |
Definition at line 142 of file variablesSet.C.
References mesh, and autoPtr< T >::ptr().
|
static |
Auto create variable for mesh movement.
Definition at line 166 of file variablesSet.C.
References mesh, tmp< T >::New(), IOobjectOption::NO_WRITE, IOobjectOption::READ_IF_PRESENT, fvMesh::time(), Time::timeName(), and Foam::Zero.
Referenced by shapeDesignVariables::solveMeshMovementEqn().
|
static |
Nullify field and old times, if present.
Definition at line 340 of file variablesSetTemplates.C.
References field(), oldTime, and Foam::Zero.
Referenced by incompressibleAdjointMeanFlowVars::nullify(), adjointSpalartAllmaras::nullify(), and adjointkOmegaSST::nullify().
|
virtual |
Transfer the fields of another variablesSet to this.
Reimplemented in incompressibleVars.
Definition at line 189 of file variablesSet.C.
|
protected |
Reference to the mesh database.
Definition at line 97 of file variablesSet.H.
Referenced by incompressibleVars::setFields(), incompressibleAdjointMeanFlowVars::setFields(), incompressibleAdjointMeanFlowVars::setMeanFields(), incompressibleVars::setMeanFields(), and incompressibleVars::write().
|
protected |
Solver name owning the variables set.
Definition at line 102 of file variablesSet.H.
Referenced by incompressibleVars::renameTurbulenceFields(), incompressibleVars::setFields(), incompressibleAdjointMeanFlowVars::setFields(), and variablesSet::solverName().
|
protected |
Append the solver name to the variables names?
Definition at line 107 of file variablesSet.H.
Referenced by incompressibleVars::renameTurbulenceFields(), incompressibleVars::setFields(), incompressibleAdjointMeanFlowVars::setFields(), variablesSet::useSolverNameForFields(), and incompressibleVars::write().