volRegion Class Reference

Volume (cell) region selection class. More...

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

Public Types

enum  regionTypes { vrtAll, vrtCellSet, vrtCellZone }
 Region type enumeration. More...
 

Public Member Functions

 TypeName ("volRegion")
 Run-time type information. More...
 
 volRegion (const fvMesh &mesh, const dictionary &dict)
 Construct from fvMesh and dictionary. More...
 
virtual ~volRegion ()=default
 Destructor. More...
 
const regionTypes & regionType () const
 Return the region type. More...
 
const labelList & cellIDs () const
 Return the local list of cell IDs. More...
 
label nCells () const
 Return the number of cells selected in the region. More...
 
scalar V () const
 Return total volume of the selected region. More...
 
bool update ()
 Update the cached values as required. More...
 
virtual bool read (const dictionary &dict)
 Read from dictionary. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &)
 Update for mesh point-motion. More...
 

Static Public Attributes

static const Enum< regionTypes > regionTypeNames_
 Region type names. More...
 

Protected Member Functions

void writeFileHeader (const writeFile &wf, Ostream &file) const
 Output file header information. More...
 

Protected Attributes

regionTypes regionType_
 Region type. More...
 
word regionName_
 Region name (cellSet, cellZone, ...) More...
 
label regionID_
 Region ID (zone ID, ...) More...
 

Detailed Description

Volume (cell) region selection class.

The adjustments for mesh changes have been implemented with a lazy evaluation, to avoid unnecessary recalculation until the values are actually required. The update() method is used to ensure the cache values are up-to-date.

Examples of function object specification:

volRegion0
{
    .
    .
    regionType      cellZone;
    name            c0;
    .
    .
}

volRegionAll
{
    .
    .
    regionType      all;
    .
    .
}
Usage
Property Description Required Default
regionType Selection type: all/cellSet/cellZone no all
name Name of cellSet/cellZone if required no
See also
Foam::functionObject
Source files

Definition at line 115 of file volRegion.H.

Member Enumeration Documentation

◆ regionTypes

Region type enumeration.

Enumerator
vrtAll 

All cells.

vrtCellSet 

A cellSet.

vrtCellZone 

A cellZone.

Definition at line 145 of file volRegion.H.

Constructor & Destructor Documentation

◆ volRegion()

volRegion ( const fvMesh &  mesh,
const dictionary &  dict 
)

Construct from fvMesh and dictionary.

Definition at line 139 of file volRegion.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~volRegion()

virtual ~volRegion ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeFileHeader()

void writeFileHeader ( const writeFile &  wf,
Ostream &  file 
) const
protected

Output file header information.

Definition at line 123 of file volRegion.C.

References Foam::endl(), Foam::setw(), writeFile::writeCommented(), and writeFile::writeHeaderValue().

Referenced by volFieldValue::writeFileHeader().

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

◆ TypeName()

TypeName ( "volRegion"  )

Run-time type information.

◆ regionType()

const Foam::functionObjects::volRegion::regionTypes & regionType ( ) const
inline

Return the region type.

Definition at line 32 of file volRegionI.H.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and volRegion::regionType_.

Here is the call graph for this function:

◆ cellIDs()

const Foam::labelList & cellIDs ( ) const

Return the local list of cell IDs.

Definition at line 199 of file volRegion.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and List< label >::null().

Here is the call graph for this function:

◆ nCells()

Foam::label nCells ( ) const
inline

Return the number of cells selected in the region.

Definition at line 47 of file volRegionI.H.

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

Here is the call graph for this function:

◆ V()

Foam::scalar V ( ) const
inline

Return total volume of the selected region.

Definition at line 62 of file volRegionI.H.

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

Referenced by momentum::writeValues().

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

◆ update()

bool update ( )

Update the cached values as required.

Returns
False if the values were already up to date

Definition at line 228 of file volRegion.C.

Referenced by volFieldValue::write().

Here is the caller graph for this function:

◆ read()

bool read ( const dictionary &  dict)
virtual

Read from dictionary.

Reimplemented in volFieldValue, specieReactionRates< ChemistryModelType >, and momentum.

Definition at line 167 of file volRegion.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::flatOutput(), and Foam::nl.

Referenced by momentum::read().

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

◆ updateMesh()

void updateMesh ( const mapPolyMesh &  )
virtual

Update for changes of mesh.

Reimplemented in momentum.

Definition at line 240 of file volRegion.C.

Referenced by momentum::updateMesh().

Here is the caller graph for this function:

◆ movePoints()

void movePoints ( const polyMesh &  )
virtual

Update for mesh point-motion.

Reimplemented in momentum.

Definition at line 246 of file volRegion.C.

Referenced by momentum::movePoints().

Here is the caller graph for this function:

Member Data Documentation

◆ regionTypeNames_

Region type names.

Definition at line 153 of file volRegion.H.

◆ regionType_

regionTypes regionType_
protected

Region type.

Definition at line 161 of file volRegion.H.

Referenced by volRegion::regionType().

◆ regionName_

word regionName_
protected

Region name (cellSet, cellZone, ...)

Definition at line 164 of file volRegion.H.

◆ regionID_

label regionID_
protected

Region ID (zone ID, ...)

Definition at line 167 of file volRegion.H.


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