32 template<
class Thermo,
class Table>
38 const char* cmptNames[],
39 const word& thermoTypeName
43 typename Table::iterator cstrIter = tablePtr->find(thermoTypeName);
45 if (cstrIter == tablePtr->end())
49 dynamicCode::allowSystemOperations
50 && !dynamicCode::resolveTemplate(Thermo::typeName).empty()
59 {
"type", thermoTypeDict.
lookup(
"type")},
60 {
"mixture", thermoTypeDict.
lookup(
"mixture")},
61 {
"transport", thermoTypeDict.
lookup(
"transport")},
62 {
"thermo", thermoTypeDict.
lookup(
"thermo")},
65 thermoTypeDict.
lookup(
"equationOfState")
67 {
"specie", thermoTypeDict.
lookup(
"specie")},
68 {
"energy", thermoTypeDict.
lookup(
"energy")}
71 cstrIter = tablePtr->find(thermoTypeName);
73 if (cstrIter == tablePtr->end())
76 <<
"Compilation and linkage of " 77 << Thermo::typeName <<
" type " <<
nl 78 <<
"thermoType" << thermoTypeDict <<
nl <<
nl 79 <<
"failed." <<
nl <<
nl 80 <<
"Valid " << Thermo::typeName <<
" types are:" 88 <<
"Unknown " << Thermo::typeName <<
" type " <<
nl 89 <<
"thermoType" << thermoTypeDict <<
nl <<
nl 90 <<
"Valid " << Thermo::typeName <<
" types are:" 94 if (cstrIter == tablePtr->end())
97 wordList validThermoTypeNames(tablePtr->sortedToc());
104 forAll(validThermoTypeNameCmpts[0], i)
106 validThermoTypeNameCmpts[0][i] = cmptNames[i];
112 forAll(validThermoTypeNames, i)
116 Thermo::splitThermoName(validThermoTypeNames[i], nCmpt)
121 validThermoTypeNameCmpts.append(names);
136 template<
class Thermo,
class Table>
143 if (thermoDict.
isDict(
"thermoType"))
147 Info<<
"Selecting thermodynamics package " << thermoTypeDict <<
endl;
149 if (thermoTypeDict.
found(
"properties"))
152 const char* cmptNames[nCmpt] =
161 const word thermoTypeName
164 +
word(thermoTypeDict.
lookup(
"mixture")) +
'<' 165 +
word(thermoTypeDict.
lookup(
"properties")) +
',' 166 +
word(thermoTypeDict.
lookup(
"energy")) +
">>" 169 return lookupCstrIter<Thermo, Table>
181 const char* cmptNames[nCmpt] =
193 const word thermoTypeName
196 +
word(thermoTypeDict.
lookup(
"mixture")) +
'<' 197 +
word(thermoTypeDict.
lookup(
"transport")) +
'<' 199 +
word(thermoTypeDict.
lookup(
"equationOfState")) +
'<' 200 +
word(thermoTypeDict.
lookup(
"specie")) +
">>," 201 +
word(thermoTypeDict.
lookup(
"energy")) +
">>>" 204 return lookupCstrIter<Thermo, Table>
216 const word thermoTypeName(thermoDict.
lookup(
"thermoType"));
218 Info<<
"Selecting thermodynamics package " << thermoTypeName <<
endl;
220 typename Table::iterator cstrIter = tablePtr->find(thermoTypeName);
222 if (cstrIter == tablePtr->end())
225 <<
"Unknown " << Thermo::typeName <<
" type " 226 << thermoTypeName <<
nl <<
nl 227 <<
"Valid " << Thermo::typeName <<
" types are:" <<
nl 228 << tablePtr->sortedToc() <<
nl 239 template<
class Thermo>
243 const word& phaseName
250 phasePropertyName(
dictName, phaseName),
253 IOobject::MUST_READ_IF_MODIFIED,
259 typename Thermo::fvMeshConstructorTable::iterator cstrIter =
260 lookupCstrIter<Thermo, typename Thermo::fvMeshConstructorTable>
263 Thermo::fvMeshConstructorTablePtr_
270 template<
class Thermo>
275 const word& phaseName
278 typename Thermo::dictionaryConstructorTable::iterator cstrIter =
279 lookupCstrIter<Thermo, typename Thermo::dictionaryConstructorTable>
282 Thermo::dictionaryConstructorTablePtr_
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
fluidReactionThermo & thermo
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
const word & constant() const
Return constant name.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void printTable(const List< wordList > &, List< string::size_type > &, Ostream &)
static Table::iterator lookupCstrIter(const dictionary &thermoTypeDict, Table *tablePtr, const int nCmpt, const char *cmptNames[], const word &thermoTypeName)
Get the constructor iterator for the given thermo dictionary and.
List< word > wordList
A List of words.
Mesh data needed to do the Finite Volume discretisation.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word dictName("noiseDict")
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.