33 template<
class Thermo,
class ThermoConstructTable>
34 typename ThermoConstructTable::mapped_type
35 Foam::basicThermo::getThermoOrDie
37 const dictionary& thermoTypeDict,
38 ThermoConstructTable& thermoTable,
39 const word& thermoTypeName,
45 auto ctorIter = thermoTable.cfind(thermoTypeName);
48 if (!ctorIter.found())
62 thermoTable.sortedToc()
68 return ctorIter.val();
72 template<
class Thermo,
class ThermoConstructTable>
73 typename ThermoConstructTable::mapped_type
74 Foam::basicThermo::getThermoOrDie
77 ThermoConstructTable& thermoTable
84 const auto& thermoTypeDict = *dictptr;
89 const word thermoTypeName
91 basicThermo::makeThermoName(thermoTypeDict, cmptHeaderPtr)
94 Info<<
"Selecting thermodynamics package " << thermoTypeDict <<
endl;
96 return getThermoOrDie<Thermo, ThermoConstructTable>
106 const word thermoTypeName(
thermoDict.
get<word>(
"thermoType"));
108 Info<<
"Selecting thermodynamics package " << thermoTypeName <<
endl;
110 auto ctorIter = thermoTable.cfind(thermoTypeName);
112 if (!ctorIter.found())
123 return ctorIter.val();
130 template<
class Thermo>
134 const word& phaseName
141 phasePropertyName(
dictName, phaseName),
150 auto* ctorPtr = getThermoOrDie<Thermo>
153 *(Thermo::fvMeshConstructorTablePtr_)
160 template<
class Thermo>
165 const word& phaseName
168 auto* ctorPtr = getThermoOrDie<Thermo>
171 *(Thermo::dictionaryConstructorTablePtr_)
178 template<
class Thermo>
182 const word& phaseName,
199 auto* ctorPtr = getThermoOrDie<Thermo>
202 *(Thermo::fvMeshDictPhaseConstructorTablePtr_)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static Ostream & printThermoNames(Ostream &os, const wordList &cmptNames, const wordList &thermoNames)
Print (filtered) table of thermo names, splits on " ,<>".
const word dictName("faMeshDefinition")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
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.
static const List< word > & null()
Return a null List.
const Time & time() const
Return the top-level database.
static autoPtr< Thermo > New(const fvMesh &, const word &phaseName=word::null)
Generic New for each of the related thermodynamics packages.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
A class for handling words, derived from Foam::string.
Reading required, file watched for runTime modification.
static const word null
An empty word.
const dictionary & thermoDict
const word & constant() const noexcept
Return constant name.
List< word > wordList
A List of words.
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Defines the attributes of an object for which implicit objectRegistry management is supported...
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and a sub-dictionary) otherwise return nullptr...
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...