Loading...
Searching...
No Matches
option Class Reference

Base abstract class for handling finite area options (i.e. faOption). More...

#include <faOption.H>

Inheritance diagram for option:
Collaboration diagram for option:

Classes

class  iNew
 Return pointer to new faOption object created on the freestore from an Istream. More...

Public Member Functions

 TypeName ("option")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, option, dictionary,(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &areaName),(name, modelType, dict, mesh, areaName))
 option (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
 Construct from components.
autoPtr< optionclone () const
 Return clone.
virtual ~option ()=default
 Destructor.
const wordname () const noexcept
 The source name.
const fvMeshmesh () const noexcept
 Return const access to the volume mesh.
const dictionarycoeffs () const noexcept
 Return dictionary.
bool active () const noexcept
 True if source is active.
void setApplied (const label fieldi)
 Set the applied flag to true for field index fieldi.
const wordareaName () const noexcept
 The finite-area mesh name.
const wordregionName () const noexcept
 The model region name.
const faMeshregionMesh () const
 Return the region mesh database (demand-driven).
const volSurfaceMappingvsm () const
 Return volSurfaceMapping (demand-driven).
bool active (bool on) noexcept
 Change source active flag, return previous value.
const wordsuffixHint () const noexcept
 The suffix hint when generating variable names.
word suffixed (const char *base) const
 Return the concatenation of base and the suffix hint.
word suffixed (const std::string &base) const
 Return the concatenation of base and the suffix hint.
virtual bool isActive ()
 Is the source active?
virtual label applyToField (const word &fieldName) const
 Return index of field name if found in fieldNames list.
virtual void checkApplied () const
 Check that the source has been applied.
virtual void addSup (const areaScalarField &h, faMatrix< scalar > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, faMatrix< vector > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, faMatrix< symmTensor > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, faMatrix< sphericalTensor > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, faMatrix< tensor > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< scalar > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< vector > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< symmTensor > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< sphericalTensor > &eqn, const label fieldi)
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< tensor > &eqn, const label fieldi)
virtual void constrain (faMatrix< scalar > &eqn, const label fieldi)
virtual void constrain (faMatrix< vector > &eqn, const label fieldi)
virtual void constrain (faMatrix< sphericalTensor > &eqn, const label fieldi)
virtual void constrain (faMatrix< symmTensor > &eqn, const label fieldi)
virtual void constrain (faMatrix< tensor > &eqn, const label fieldi)
virtual void correct (areaScalarField &field)
virtual void correct (areaVectorField &field)
virtual void correct (areaSphericalTensorField &field)
virtual void correct (areaSymmTensorField &field)
virtual void correct (areaTensorField &field)
virtual void writeHeader (Ostream &) const
 Write the source header information.
virtual void writeFooter (Ostream &) const
 Write the source footer information.
virtual void writeData (Ostream &) const
 Write the source properties.
virtual bool read (const dictionary &dict)
 Read source dictionary.

Static Public Member Functions

static autoPtr< optionNew (const word &name, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
 Return a reference to the selected faOption model.
static bool sameRegionNames (const word &name1, const word &name2)
 Compare the region names.

Public Attributes

bool log
 Switch write log to Info.

Protected Member Functions

void resetApplied ()
 Resize/reset applied flag list for all fieldNames_ entries.

Protected Attributes

const word name_
 Source name.
const word modelType_
 Model type.
const fvMeshmesh_
 Reference to the mesh database.
dictionary dict_
 Top level source dictionary.
dictionary coeffs_
 Dictionary containing source coefficients.
wordList fieldNames_
 Field names to apply source to - populated by derived models.
List< bool > applied_
 Applied flag list - corresponds to each fieldNames_ entry.
word areaName_
 The finite-area mesh name.
word regionName_
 The model region name (finite-area).
word suffixHint_
 Suffix hint for variable names (default: "").

Detailed Description

Base abstract class for handling finite area options (i.e. faOption).

Usage
Minimal example by using constant/faOptions:
<userDefinedName1>
{
    // Mandatory entries (unmodifiable)
    type              <faOptionName>;

    // Mandatory entries (runtime modifiable)
    region            <regionName>;

    // Optional entry (unmodifiable)
    area              <areaName>;

    // Optional entries (unmodifiable/runtime modifiable)
    <faOption>Coeffs
    {
        // subdictionary entries
    }

    // Optional entries (runtime modifiable)
    active            true;
    log               true;
}

where the entries mean:

Property Description Type Reqd Dflt
type Name of operand faOption word yes -
area Name of finite-area mesh word no region0
region Name of operand region word yes -
<faOption>Coeffs Dictionary containing settings of the selected faOption settings dictionary no -
active Flag to (de)activate faOption bool no true
log Flag to log faOption-related info bool no true
suffixing Suffix hint for option variables word no -
Note
  • Source/sink options are to be added to the right-hand side of equations.
  • Suffixing (true|false|none|default|...) currently selects between no suffix and ('_'+region).
Source files

Definition at line 148 of file faOption.H.

Constructor & Destructor Documentation

◆ option()

option ( const word & name,
const word & modelType,
const dictionary & dict,
const fvMesh & mesh,
const word & defaultAreaName = word() )

Construct from components.

Parameters
defaultAreaNameThe expected finite-area mesh name

References dict, mesh(), and name().

Referenced by declareRunTimeSelectionTable(), and faceSetOption::faceSetOption().

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

◆ ~option()

virtual ~option ( )
virtualdefault

Destructor.

Member Function Documentation

◆ resetApplied()

void resetApplied ( )
protected

Resize/reset applied flag list for all fieldNames_ entries.

Referenced by externalFileSource::externalFileSource().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "option" )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
option ,
dictionary ,
(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &areaName) ,
(name, modelType, dict, mesh, areaName)  )

References areaName(), dict, mesh(), name(), and option().

Here is the call graph for this function:

◆ clone()

autoPtr< option > clone ( ) const
inline

Return clone.

Definition at line 291 of file faOption.H.

References NotImplemented.

◆ New()

autoPtr< option > New ( const word & name,
const dictionary & dict,
const fvMesh & mesh,
const word & defaultAreaName = word() )
static

Return a reference to the selected faOption model.

Parameters
defaultAreaNameThe expected finite-area mesh name

References dict, mesh(), and name().

Referenced by option::iNew::operator()().

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

◆ sameRegionNames()

bool sameRegionNames ( const word & name1,
const word & name2 )
static

Compare the region names.

Treats empty or polyMesh::defaultRegion as always matching

◆ name()

◆ mesh()

◆ coeffs()

const dictionary & coeffs ( ) const
inlinenoexcept

Return dictionary.

Definition at line 390 of file faOption.H.

References coeffs_, and Foam::noexcept.

◆ active() [1/2]

bool active ( ) const
inlinenoexcept

True if source is active.

Definition at line 395 of file faOption.H.

References Foam::noexcept.

◆ setApplied()

void setApplied ( const label fieldi)
inline

Set the applied flag to true for field index fieldi.

Definition at line 31 of file faOptionI.H.

References applied_.

◆ areaName()

const word & areaName ( ) const
inlinenoexcept

The finite-area mesh name.

Definition at line 405 of file faOption.H.

References areaName_, and Foam::noexcept.

Referenced by declareRunTimeSelectionTable().

Here is the caller graph for this function:

◆ regionName()

const word & regionName ( ) const
inlinenoexcept

The model region name.

Definition at line 410 of file faOption.H.

References Foam::noexcept, and regionName_.

◆ regionMesh()

const Foam::faMesh & regionMesh ( ) const
inline

Return the region mesh database (demand-driven).

Definition at line 37 of file faOptionI.H.

References areaName_, and mesh_.

Referenced by contactHeatFluxSource::addSup(), externalHeatFluxSource::addSup(), externalFileSource::externalFileSource(), contactHeatFluxSource::read(), externalFileSource::read(), faceSetOption::setArea(), faceSetOption::setFaceSelection(), and vsm().

Here is the caller graph for this function:

◆ vsm()

const Foam::volSurfaceMapping & vsm ( ) const
inline

Return volSurfaceMapping (demand-driven).

Definition at line 47 of file faOptionI.H.

References regionMesh().

Here is the call graph for this function:

◆ active() [2/2]

bool active ( bool on)
inlinenoexcept

Change source active flag, return previous value.

Definition at line 23 of file faOptionI.H.

◆ suffixHint()

const word & suffixHint ( ) const
inlinenoexcept

The suffix hint when generating variable names.

Definition at line 436 of file faOption.H.

References Foam::noexcept, and suffixHint_.

◆ suffixed() [1/2]

Foam::word suffixed ( const char * base) const
inline

Return the concatenation of base and the suffix hint.

Definition at line 58 of file faOptionI.H.

References suffixHint_.

◆ suffixed() [2/2]

Foam::word suffixed ( const std::string & base) const
inline

Return the concatenation of base and the suffix hint.

Definition at line 65 of file faOptionI.H.

References suffixHint_.

◆ isActive()

virtual bool isActive ( )
virtual

Is the source active?

Reimplemented in faceSetOption.

Referenced by faceSetOption::isActive().

Here is the caller graph for this function:

◆ applyToField()

virtual label applyToField ( const word & fieldName) const
virtual

Return index of field name if found in fieldNames list.

◆ checkApplied()

virtual void checkApplied ( ) const
virtual

Check that the source has been applied.

◆ addSup() [1/10]

virtual void addSup ( const areaScalarField & h,
faMatrix< scalar > & eqn,
const label fieldi )
virtual

Reimplemented in externalFileSource.

References h.

◆ addSup() [2/10]

virtual void addSup ( const areaScalarField & h,
faMatrix< vector > & eqn,
const label fieldi )
virtual

References h.

◆ addSup() [3/10]

virtual void addSup ( const areaScalarField & h,
faMatrix< symmTensor > & eqn,
const label fieldi )
virtual

References h.

◆ addSup() [4/10]

virtual void addSup ( const areaScalarField & h,
faMatrix< sphericalTensor > & eqn,
const label fieldi )
virtual

References h.

◆ addSup() [5/10]

virtual void addSup ( const areaScalarField & h,
faMatrix< tensor > & eqn,
const label fieldi )
virtual

References h.

◆ addSup() [6/10]

virtual void addSup ( const areaScalarField & h,
const areaScalarField & rho,
faMatrix< scalar > & eqn,
const label fieldi )
virtual

Reimplemented in contactHeatFluxSource, externalHeatFluxSource, and jouleHeatingSource.

References h, and rho.

◆ addSup() [7/10]

virtual void addSup ( const areaScalarField & h,
const areaScalarField & rho,
faMatrix< vector > & eqn,
const label fieldi )
virtual

References h, and rho.

◆ addSup() [8/10]

virtual void addSup ( const areaScalarField & h,
const areaScalarField & rho,
faMatrix< symmTensor > & eqn,
const label fieldi )
virtual

References h, and rho.

◆ addSup() [9/10]

virtual void addSup ( const areaScalarField & h,
const areaScalarField & rho,
faMatrix< sphericalTensor > & eqn,
const label fieldi )
virtual

References h, and rho.

◆ addSup() [10/10]

virtual void addSup ( const areaScalarField & h,
const areaScalarField & rho,
faMatrix< tensor > & eqn,
const label fieldi )
virtual

References h, and rho.

◆ constrain() [1/5]

virtual void constrain ( faMatrix< scalar > & eqn,
const label fieldi )
virtual

◆ constrain() [2/5]

virtual void constrain ( faMatrix< vector > & eqn,
const label fieldi )
virtual

◆ constrain() [3/5]

virtual void constrain ( faMatrix< sphericalTensor > & eqn,
const label fieldi )
virtual

◆ constrain() [4/5]

virtual void constrain ( faMatrix< symmTensor > & eqn,
const label fieldi )
virtual

◆ constrain() [5/5]

virtual void constrain ( faMatrix< tensor > & eqn,
const label fieldi )
virtual

◆ correct() [1/5]

virtual void correct ( areaScalarField & field)
virtual

Reimplemented in limitHeight.

References field().

Here is the call graph for this function:

◆ correct() [2/5]

virtual void correct ( areaVectorField & field)
virtual

Reimplemented in limitVelocity.

References field().

Here is the call graph for this function:

◆ correct() [3/5]

virtual void correct ( areaSphericalTensorField & field)
virtual

References field().

Here is the call graph for this function:

◆ correct() [4/5]

virtual void correct ( areaSymmTensorField & field)
virtual

References field().

Here is the call graph for this function:

◆ correct() [5/5]

virtual void correct ( areaTensorField & field)
virtual

References field().

Here is the call graph for this function:

◆ writeHeader()

virtual void writeHeader ( Ostream & ) const
virtual

Write the source header information.

◆ writeFooter()

virtual void writeFooter ( Ostream & ) const
virtual

Write the source footer information.

◆ writeData()

virtual void writeData ( Ostream & ) const
virtual

Write the source properties.

◆ read()

virtual bool read ( const dictionary & dict)
virtual

Member Data Documentation

◆ name_

const word name_
protected

Source name.

Definition at line 165 of file faOption.H.

Referenced by limitHeight::correct(), limitVelocity::correct(), and name().

◆ modelType_

const word modelType_
protected

Model type.

Definition at line 170 of file faOption.H.

◆ mesh_

◆ dict_

dictionary dict_
protected

Top level source dictionary.

Definition at line 180 of file faOption.H.

◆ coeffs_

◆ fieldNames_

wordList fieldNames_
protected

Field names to apply source to - populated by derived models.

Definition at line 190 of file faOption.H.

Referenced by externalFileSource::externalFileSource(), limitVelocity::limitVelocity(), and limitHeight::read().

◆ applied_

List<bool> applied_
protected

Applied flag list - corresponds to each fieldNames_ entry.

Definition at line 195 of file faOption.H.

Referenced by limitVelocity::limitVelocity(), limitHeight::read(), and setApplied().

◆ areaName_

word areaName_
protected

The finite-area mesh name.

Definition at line 200 of file faOption.H.

Referenced by areaName(), and regionMesh().

◆ regionName_

word regionName_
protected

The model region name (finite-area).

Definition at line 205 of file faOption.H.

Referenced by regionName().

◆ suffixHint_

word suffixHint_
protected

Suffix hint for variable names (default: "").

Definition at line 210 of file faOption.H.

Referenced by suffixed(), suffixed(), and suffixHint().

◆ log

bool log

Switch write log to Info.

Definition at line 246 of file faOption.H.


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