60 const word& modelType,
66 modelType_(modelType),
69 coeffs_(
dict.optionalSubDict(modelType +
"Coeffs")),
72 active_(dict_.getOrDefault(
"active", true)),
94 <<
"Selecting finite volume options type " << modelType <<
endl;
96 mesh.time().libs().open
100 dictionaryConstructorTablePtr_
103 auto* ctorPtr = dictionaryConstructorTable(modelType);
112 *dictionaryConstructorTablePtr_
141 <<
"Source " <<
name_ <<
" defined for field "
356 const word& fieldName,
357 const word& designVariablesName
365 const word& fieldName,
366 const word& designVariablesName
374 const word& fieldName,
375 const word& designVariablesName
385 const word& fieldName
395 const word& fieldName
405 const word& fieldName
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Base abstract class for handling finite volume options (i.e. fvOption).
const word modelType_
Model type.
bool active_
Source active flag.
const word & name() const noexcept
Return const access to the source name.
const dictionary & coeffs() const noexcept
Return dictionary.
List< bool > applied_
Applied flag list - corresponds to each fieldNames_ entry.
const fvMesh & mesh_
Reference to the mesh database.
static autoPtr< option > New(const word &name, const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected fvOption model.
wordList fieldNames_
Field names to apply source to - populated by derived models.
virtual void checkApplied() const
Check that the source has been applied.
virtual void postProcessSens(scalarField &sensField, const word &fieldName=word::null, const word &designVariablesName=word::null)
option(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
dictionary dict_
Top level source dictionary.
virtual label applyToField(const word &fieldName) const
Return index of field name if found in fieldNames list.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
virtual void constrain(fvMatrix< scalar > &eqn, const label fieldi)
virtual void postProcessAuxSens(const volScalarField &primalField, const volScalarField &adjointField, scalarField &sensField, const word &fieldName=word::null)
dictionary coeffs_
Dictionary containing source coefficients.
virtual bool isActive()
Is the source active?
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
virtual void correct(volScalarField &field)
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
bool log
Switch write log to Info.
const word name_
Source name.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for finite-volume.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.