coded Class Reference

Coded zoneGenerator. More...

Inheritance diagram for coded:
Collaboration diagram for coded:

Public Member Functions

 TypeName ("coded")
 Runtime type information. More...
 
 coded (const word &name, const polyMesh &mesh, const dictionary &dict)
 Construct from name, polyMesh and dictionary. More...
 
 coded (const coded &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~coded ()
 Destructor. More...
 
virtual zoneSet generate () const
 Generate and return the zoneSet. More...
 
void operator= (const coded &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from zoneGenerator
 TypeName ("zoneGenerator")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, zoneGenerator, dictionary,(const word &name, const polyMesh &mesh, const dictionary &dict),(name, mesh, dict))
 
 zoneGenerator (const word &name, const polyMesh &mesh, const dictionary &dict)
 Construct from name, polyMesh and dictionary. More...
 
 zoneGenerator (const zoneGenerator &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~zoneGenerator ()
 Destructor. More...
 
const wordname () const
 Return the zoneGenerator name. More...
 
const wordzoneName () const
 Return the zone name. More...
 
const polyMeshmesh () const
 Return reference to the polyMesh. More...
 
bool moveUpdate () const
 Return true if the zoneGenerator updates any of the zones. More...
 
virtual zoneSet movePoints () const
 Regenerate the zoneSet following mesh point motion. More...
 
void operator= (const zoneGenerator &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from codedBase
 TypeName ("codedBase")
 Runtime type information. More...
 
 codedBase (const word &name, const dictionary &dict, const wordList &codeKeys, const wordList &codeDictVars, const word &codeOptionsFileName, const wordList &compileFiles, const wordList &copyFiles, const bool reloadable=true)
 Construct from name and dictionary. More...
 
virtual ~codedBase ()
 Destructor. More...
 
bool updateLibrary (const dictionary &dict) const
 Update library from given updated dictionary as required. More...
 
void operator= (const codedBase &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from dynamicCode
 ClassName ("dynamicCode")
 
 dynamicCode (const dictionary &contextDict, const dictionary &codeDict, const word &codeName, const word &codeDirName, const wordList &codeKeys, const wordList &codeDictVars, const word &optionsFileName, const wordList &compileFiles, const wordList &copyFiles)
 Construct from the context and code dictionaries. More...
 
 dynamicCode (const dictionary &contextDict, const word &codeName, const word &codeDirName, const wordList &codeKeys, const wordList &codeDictVars, const word &optionsFileName, const wordList &compileFiles, const wordList &copyFiles)
 Construct from the context dictionary also containing the code. More...
 
const wordcodeName () const
 Return the code-name. More...
 
const wordcodeSha1Name () const
 Return the unique code name. More...
 
fileName libPath () const
 Library path for specified code name. More...
 
fileName libRelPath () const
 Library path for specified code name relative to $FOAM_CASE. More...
 
HashTable< string > & varSubstitutions ()
 
bool upToDate () const
 Verify if the copied code is up-to-date, based on Make/SHA1Digest. More...
 
bool copyOrCreateFiles (const bool verbose=false) const
 Copy/create files prior to compilation. More...
 
bool wmakeLibso () const
 Compile a libso. More...
 
void * loadLibrary (const fileName &libPath) const
 
void createLibrary (const dictionary &dict, const bool masterOnlyRead=false) const
 
void read (const dictionary &contextDict, const dictionary &codeDict)
 
void read (const dictionary &contextDict)
 
void write (Ostream &os) const
 Write the code for restart. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from zoneGenerator
static autoPtr< zoneGeneratorNew (const word &name, const polyMesh &mesh, const dictionary &dict)
 Select constructed from name, mesh and dictionary. More...
 
static autoPtr< zoneGeneratorNew (const word &name, const zoneTypes &zoneType, const polyMesh &mesh, const dictionary &dict)
 Select constructed from name, zoneType, mesh and dictionary. More...
 
static autoPtr< zoneGeneratorNew (const polyMesh &mesh, const dictionary &dict)
 Select constructed from mesh and first valid dictionary. More...
 
static labelList indices (const boolList &selected)
 Return the list of selected indices. More...
 
- Static Public Member Functions inherited from codedBase
static word codedName (const word &name)
 Create a coded name from the given name. More...
 
- Static Public Member Functions inherited from dynamicCode
static word libraryBaseName (const fileName &libPath)
 Return the library basename without leading 'lib' or trailing '.so'. More...
 
static fileName resolveTemplate (const fileName &templateName)
 Resolve code-template via Foam::findConfigFile. More...
 
- Static Public Attributes inherited from dynamicCode
static int allowSystemOperations
 Flag if system operations are allowed. More...
 
- Protected Attributes inherited from zoneGenerator
const word name_
 Name of zone generator. More...
 
const dictionary dict_
 Dictionary cached for error context. More...
 
const word zoneName_
 Name of the zone (defaults to the name of the generator) More...
 
const polyMeshmesh_
 Reference to the polyMesh. More...
 
bool moveUpdate_
 Switch to update the zones if the mesh points are moved. More...
 

Detailed Description

Coded zoneGenerator.

The code provided should set pointIndices and/or cellIndices and/or faceIndices and optionally faceMap. These index lists are automatically converted into the corresponding zones in the zoneSet which is returned by the zoneGenerator.

The entries are:

code : Code to set pointIndices, cellIndices, faceIndices
codeInclude : Include files
codeOptions : Include paths; inserted into EXE_INC in Make/options
codeLibs : Link line; inserted into LIB_LIBS in Make/options

Example of a zoneGenerators::coded which creates a cellZone of the cells in which the value of the turbulent kinetic energy is within the highest 10%:

    cellZone
    {
        type        coded;

        // Regenerate cellZone for every evaluation
        regenerate  yes;

        code
        #{
            // Lookup field from the objectRegistry, e.g. k
            const volScalarField& k = mesh().lookupObject<volScalarField>("k");

            // Calculate the minimum and maximum k values
            const scalar mink = min(k).value();
            const scalar maxk = max(k).value();

            // Fraction of the range of k
            const scalar f = 0.1;

            // Lowest k in selection
            const scalar lowk = f*mink + (1.0 - f)*maxk;

            cellIndices = selectIndices
            (
                k,
                [&](const scalar k)
                {
                    return k > lowk;
                }
            );
        #};
    }
See also
Foam::zoneGenerator Foam::codedBase
Source files

Definition at line 122 of file coded_zoneGenerator.H.

Constructor & Destructor Documentation

◆ coded() [1/2]

coded ( const word name,
const polyMesh mesh,
const dictionary dict 
)

Construct from name, polyMesh and dictionary.

Definition at line 77 of file coded_zoneGenerator.C.

References dict, Foam::name(), codedBase::updateLibrary(), and dynamicCode::varSubstitutions().

Here is the call graph for this function:

◆ coded() [2/2]

coded ( const coded )
delete

Disallow default bitwise copy construction.

◆ ~coded()

~coded ( )
virtual

Destructor.

Definition at line 105 of file coded_zoneGenerator.C.

Member Function Documentation

◆ TypeName()

TypeName ( "coded"  )

Runtime type information.

◆ generate()

Foam::zoneSet generate ( ) const
virtual

Generate and return the zoneSet.

Implements zoneGenerator.

Definition at line 111 of file coded_zoneGenerator.C.

References zoneGenerator::New().

Here is the call graph for this function:

◆ operator=()

void operator= ( const coded )
delete

Disallow default bitwise assignment.


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