32 template<
class Thermo,
class Table>
33 typename Table::iterator Foam::basicThermo::lookupCstrIter
35 const dictionary& thermoTypeDict,
38 const char* cmptNames[],
39 const word& thermoTypeName
43 typename Table::iterator cstrIter = tablePtr->find(thermoTypeName);
45 if (cstrIter == tablePtr->end())
60 {
"type", thermoTypeDict.lookup(
"type")},
62 {
"transport", thermoTypeDict.lookup(
"transport")},
63 {
"thermo", thermoTypeDict.lookup(
"thermo")},
66 thermoTypeDict.lookup(
"equationOfState")
68 {
"specie", thermoTypeDict.lookup(
"specie")},
69 {
"energy", thermoTypeDict.lookup(
"energy")}
72 cstrIter = tablePtr->find(thermoTypeName);
74 if (cstrIter == tablePtr->end())
77 <<
"Compilation and linkage of "
79 <<
"thermoType" << thermoTypeDict <<
nl <<
nl
80 <<
"failed." <<
nl <<
nl
90 <<
"thermoType" << thermoTypeDict <<
nl <<
nl
95 if (cstrIter == tablePtr->end())
98 wordList validThermoTypeNames(tablePtr->sortedToc());
101 DynamicList<wordList> validThermoTypeNameCmpts;
104 validThermoTypeNameCmpts.append(
wordList(nCmpt));
105 forAll(validThermoTypeNameCmpts[0], i)
107 validThermoTypeNameCmpts[0][i] = cmptNames[i];
113 forAll(validThermoTypeNames, i)
122 validThermoTypeNameCmpts.append(names);
139 template<
class Thermo,
class Table>
140 typename Table::iterator Foam::basicThermo::lookupCstrIter
146 if (thermoDict.
isDict(
"thermoType"))
151 <<
"Selecting thermodynamics package " << thermoTypeDict;
153 if (thermoTypeDict.
found(
"properties"))
156 const char* cmptNames[nCmpt] =
165 const word thermoTypeName
168 +
word(mixtureName(thermoTypeDict)) +
'<'
169 +
word(thermoTypeDict.
lookup(
"properties")) +
','
170 +
word(thermoTypeDict.
lookup(
"energy")) +
">>"
173 return lookupCstrIter<Thermo, Table>
185 const char* cmptNames[nCmpt] =
197 const word thermoTypeName
200 +
word(mixtureName(thermoTypeDict)) +
'<'
201 +
word(thermoTypeDict.
lookup(
"transport")) +
'<'
203 +
word(thermoTypeDict.
lookup(
"equationOfState")) +
'<'
204 +
word(thermoTypeDict.
lookup(
"specie")) +
">>,"
205 +
word(thermoTypeDict.
lookup(
"energy")) +
">>>"
208 return lookupCstrIter<Thermo, Table>
220 const word thermoTypeName(thermoDict.
lookup(
"thermoType"));
223 <<
"Selecting thermodynamics package " << thermoTypeName <<
endl;
225 typename Table::iterator cstrIter = tablePtr->find(thermoTypeName);
227 if (cstrIter == tablePtr->end())
231 << thermoTypeName <<
nl <<
nl
233 << tablePtr->sortedToc() <<
nl
242 template<
class FieldType>
250 if (
f.db().template foundObject<basicThermo>(
name))
252 return f.db().template lookupObject<basicThermo>(
name);
257 f.db().template lookupClass<basicThermo>();
262 iter != thermos.
end();
266 if (&(iter()->he().internalField()) == &(
f.internalField()))
273 return f.db().template lookupObject<basicThermo>(
name);
279 template<
class Thermo>
283 const word& phaseName
291 typename Thermo::fvMeshConstructorTable::iterator cstrIter =
292 lookupCstrIter<Thermo, typename Thermo::fvMeshConstructorTable>
295 Thermo::fvMeshConstructorTablePtr_
#define forAll(list, i)
Loop across all elements in list.
An STL-conforming iterator.
An STL-conforming hash table.
iterator begin()
Iterator set to the beginning of the HashTable.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Base-class for fluid and solid thermodynamic properties.
virtual word mixtureName() const =0
Name of the mixture.
static const basicThermo & lookupThermo(const FieldType &f)
Lookup the thermo associated with the given field.
static wordList splitThermoName(const word &thermoName, const int nCmpt)
Split name of thermo package into a list of the components names.
static autoPtr< Thermo > New(const fvMesh &, const word &phaseName=word::null)
Generic New for each of the related thermodynamics packages.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
static int allowSystemOperations
Flag if system operations are allowed.
static fileName resolveTemplate(const fileName &templateName)
Resolve code-template via Foam::findConfigFile.
Mesh data needed to do the Finite Volume discretisation.
static IOobject findModelDict(const objectRegistry &obr, const word &group, bool registerObject=false)
Find the physicalProperties dictionary and return the IOobject.
Motion of the mesh specified as a list of pointMeshMovers.
Enables the printing of a dictionary and subsequently looked-up defaulted entries.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
Ostream & endl(Ostream &os)
Add newline and flush stream.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
void printTable(const List< wordList > &, List< string::size_type > &, Ostream &)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
fluidMulticomponentThermo & thermo
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable