Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species. More...
#include <SpeciesThermoFactory.h>
Public Member Functions | |
void | deleteFactory () |
Delete static instance of this class. | |
virtual | ~SpeciesThermoFactory () |
Destructor. | |
SpeciesThermo * | newSpeciesThermo (int type) const |
Create a new species property manage for the reference state. | |
SpeciesThermo * | newSpeciesThermoManager (std::string &stype) const |
Create a new species thermo property manager given a string. | |
SpeciesThermo * | newSpeciesThermo (std::vector< XML_Node * > &spDataNodeList) const |
Create a new species property manager for the reference state for a group of species. | |
SpeciesThermo * | newSpeciesThermoOpt (std::vector< XML_Node * > &spDataNodeList) const |
Create a new species property manager for the reference state. | |
void | installThermoForSpecies (int k, const XML_Node &speciesNode, ThermoPhase *th_ptr, SpeciesThermo &spthermo, const XML_Node *phaseNode_ptr=0) const |
Install a species thermodynamic property parameterization for the reference state for one species into a species thermo manager. | |
void | installVPThermoForSpecies (int k, const XML_Node &speciesNode, VPStandardStateTP *vp_ptr, VPSSMgr *vpss_ptr, SpeciesThermo *spthermo_ptr, const XML_Node *phaseNode_ptr) const |
Install a species thermodynamic property parameterization for the standard state for one species into a species thermo manager, VPSSMgr. | |
Static Public Member Functions | |
static SpeciesThermoFactory * | factory () |
Static method to return an instance of this class. | |
static void | deleteFactories () |
static function that deletes all factories in the internal registry maintained in a static variable | |
Private Member Functions | |
SpeciesThermoFactory () | |
Constructor. | |
Static Private Attributes | |
static SpeciesThermoFactory * | s_factory = 0 |
Pointer to the sole instance of this class, which is static. | |
static boost::mutex | species_thermo_mutex |
Decl of the static mutex variable that locks the SpeciesThermo factory singelton. |
Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species.
This class is responsible for making the decision concerning which derivative of SpeciesThermo object to use. The SpeciesThermo object is used to calculate thermodynamic functions for the reference state. It queries the database of species to understand what the requirements are for the submodels for all of the species in the phase. Then, it picks the SpeciesThermo object to use, and passies it back to the calling routine. It doesn't load any of the data into the derived SpeciesThermo object.
Making the choice of SpeciesThermo types is the only thing this class does.
This class is implemented as a singleton -- one in which only one instance is needed. The recommended way to access the factory is to call this static method, which instantiates the class if it is the first call, but otherwise simply returns the pointer to the existing instance.
Definition at line 80 of file SpeciesThermoFactory.h.
~SpeciesThermoFactory | ( | ) | [virtual] |
Destructor.
Doesn't do anything. We do not delete statically created single instance of this class here, because it would create an infinite loop if destructor is called for that single instance.
Definition at line 157 of file SpeciesThermoFactory.cpp.
SpeciesThermoFactory | ( | ) | [inline, private] |
Constructor.
This is made private, so that only the static method factory() can instantiate the class.
Definition at line 223 of file SpeciesThermoFactory.h.
static void deleteFactories | ( | ) | [inline, static, inherited] |
static function that deletes all factories in the internal registry maintained in a static variable
Definition at line 33 of file FactoryBase.h.
References FactoryBase::s_vFactoryRegistry.
Referenced by Cantera::appdelete().
void deleteFactory | ( | ) | [virtual] |
Delete static instance of this class.
If it is necessary to explicitly delete the factory before the process terminates (for example, when checking for memory leaks) then this method can be called to delete it.
Implements FactoryBase.
Definition at line 140 of file SpeciesThermoFactory.cpp.
References SpeciesThermoFactory::s_factory, and SpeciesThermoFactory::species_thermo_mutex.
SpeciesThermoFactory * factory | ( | ) | [static] |
Static method to return an instance of this class.
This class is implemented as a singleton -- one in which only one instance is needed. The recommended way to access the factory is to call this static method, which instantiates the class if it is the first call, but otherwise simply returns the pointer to the existing instance.
Definition at line 126 of file SpeciesThermoFactory.cpp.
References SpeciesThermoFactory::s_factory, and SpeciesThermoFactory::species_thermo_mutex.
Referenced by VPSSMgr_IdealGas::createInstallPDSS(), and VPSSMgr::installSTSpecies().
void installThermoForSpecies | ( | int | k, | |
const XML_Node & | speciesNode, | |||
ThermoPhase * | th_ptr, | |||
SpeciesThermo & | spthermo, | |||
const XML_Node * | phaseNode_ptr = 0 | |||
) | const |
Install a species thermodynamic property parameterization for the reference state for one species into a species thermo manager.
Install an Adsorbate thermodynamic property parameterization for species k into a SpeciesThermo instance.
k | Species number | |
speciesNode | Reference to the XML node specifying the species standard state information | |
th_ptr | Pointer to the ThermoPhase object for the species | |
spthermo | Species reference state thermo manager | |
phaseNode_ptr | Optional pointer to the XML phase information for the phase in which the species resides |
This is called by method installThermoForSpecies if a NASA9 block is found in the XML input.
Definition at line 762 of file SpeciesThermoFactory.cpp.
References XML_Node::child(), XML_Node::children(), XML_Node::hasChild(), Cantera::installMu0ThermoFromXML(), and XML_Node::name().
Referenced by VPSSMgr_IdealGas::createInstallPDSS(), and VPSSMgr::installSTSpecies().
void installVPThermoForSpecies | ( | int | k, | |
const XML_Node & | speciesNode, | |||
VPStandardStateTP * | vp_ptr, | |||
VPSSMgr * | vpss_ptr, | |||
SpeciesThermo * | spthermo_ptr, | |||
const XML_Node * | phaseNode_ptr | |||
) | const |
Install a species thermodynamic property parameterization for the standard state for one species into a species thermo manager, VPSSMgr.
This is a wrapper around the createInstallVPSS() function in the VPStandardStateTP object.
This serves to install the species into vpss_ptr, create a PDSS file. We also read the xml database to extract the constants for these steps.
k | species number | |
speciesNode | Reference to the XML node specifying the species standard state information | |
vp_ptr | variable pressure ThermoPhase object | |
vpss_ptr | Pointer to the Manager for calculating variable pressure substances. | |
spthermo_ptr | Species reference state thermo manager | |
phaseNode_ptr | Optional Pointer to the XML phase information for the phase in which the species resides |
Definition at line 868 of file SpeciesThermoFactory.cpp.
SpeciesThermo * newSpeciesThermo | ( | std::vector< XML_Node * > & | spDataNodeList | ) | const |
Create a new species property manager for the reference state for a group of species.
This routine will look through species nodes. It will discover what each species needs for its species property managers. Then, it will malloc and return the proper species property manager to use.
spDataNodeList | This vector contains a list of species XML nodes that will be in the phase |
Definition at line 164 of file SpeciesThermoFactory.cpp.
References NASA, SpeciesThermoFactory::newSpeciesThermo(), Cantera::popError(), SHOMATE, and SIMPLE.
SpeciesThermo * newSpeciesThermo | ( | int | type | ) | const |
Create a new species property manage for the reference state.
type | the integer type to be created. |
Definition at line 201 of file SpeciesThermoFactory.cpp.
References NASA, SHOMATE, and SIMPLE.
Referenced by SpeciesThermoFactory::newSpeciesThermo(), and SpeciesThermoFactory::newSpeciesThermoOpt().
SpeciesThermo * newSpeciesThermoManager | ( | std::string & | stype | ) | const |
Create a new species thermo property manager given a string.
Create a new species thermo property manager, given a string.
stype | String name for the species thermo type |
Definition at line 222 of file SpeciesThermoFactory.cpp.
References Cantera::lowercase().
SpeciesThermo * newSpeciesThermoOpt | ( | std::vector< XML_Node * > & | spDataNodeList | ) | const |
Create a new species property manager for the reference state.
This routine will look through species nodes. It will discover what each species needs for its species property managers. Then, it will malloc and return the proper species property manager to use.
spDataNodeList | This vector contains a list of species XML nodes that will be in the phase |
Definition at line 185 of file SpeciesThermoFactory.cpp.
References NASA, SpeciesThermoFactory::newSpeciesThermo(), Cantera::popError(), SHOMATE, and SIMPLE.
SpeciesThermoFactory * s_factory = 0 [static, private] |
Pointer to the sole instance of this class, which is static.
Definition at line 214 of file SpeciesThermoFactory.h.
Referenced by SpeciesThermoFactory::deleteFactory(), and SpeciesThermoFactory::factory().
boost::mutex species_thermo_mutex [static, private] |
Decl of the static mutex variable that locks the SpeciesThermo factory singelton.
Definition at line 218 of file SpeciesThermoFactory.h.
Referenced by SpeciesThermoFactory::deleteFactory(), and SpeciesThermoFactory::factory().