Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
SpeciesThermoFactory Class Reference

Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species. More...

#include <SpeciesThermoFactory.h>

Inheritance diagram for SpeciesThermoFactory:
[legend]
Collaboration diagram for SpeciesThermoFactory:
[legend]

Public Member Functions

void deleteFactory ()
 Delete static instance of this class. More...
 
SpeciesThermonewSpeciesThermo (int type) const
 Create a new species property manager for the reference state. More...
 
SpeciesThermonewSpeciesThermoManager (const std::string &stype) const
 Create a new species thermo property manager given a string. More...
 
SpeciesThermonewSpeciesThermo (std::vector< XML_Node * > &spDataNodeList) const
 Create a new species property manager for the reference state for a group of species. More...
 
void installThermoForSpecies (size_t 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. More...
 
void installVPThermoForSpecies (size_t 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. More...
 
- Public Member Functions inherited from FactoryBase
virtual ~FactoryBase ()
 destructor More...
 

Static Public Member Functions

static SpeciesThermoFactoryfactory ()
 Static method to return an instance of this class. More...
 
- Static Public Member Functions inherited from FactoryBase
static void deleteFactories ()
 static function that deletes all factories in the internal registry maintained in a static variable More...
 

Private Member Functions

 SpeciesThermoFactory ()
 Constructor. More...
 

Static Private Attributes

static SpeciesThermoFactorys_factory = 0
 Pointer to the sole instance of this class, which is static. More...
 
static mutex_t species_thermo_mutex
 Decl of the static mutex variable that locks the SpeciesThermo factory singleton. More...
 

Additional Inherited Members

- Protected Member Functions inherited from FactoryBase
 FactoryBase ()
 Constructor. More...
 

Detailed Description

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 passes 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.

Deprecated:
To be removed after Cantera 2.2. Use class GeneralSpeciesThermo directly

Definition at line 75 of file SpeciesThermoFactory.h.

Constructor & Destructor Documentation

SpeciesThermoFactory ( )
inlineprivate

Constructor.

This is made private, so that only the static method factory() can instantiate the class.

Definition at line 185 of file SpeciesThermoFactory.h.

Member Function Documentation

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 98 of file SpeciesThermoFactory.cpp.

References Cantera::warn_deprecated().

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 109 of file SpeciesThermoFactory.cpp.

SpeciesThermo * newSpeciesThermo ( int  type) const

Create a new species property manager for the reference state.

Parameters
typethe integer type to be created.
Returns
Returns the pointer to the newly allocated species property manager for the reference state
Deprecated:
To be removed after Cantera 2.2. Use GeneralSpeciesThermo directly.

Definition at line 134 of file SpeciesThermoFactory.cpp.

References NASA, SHOMATE, SIMPLE, and Cantera::warn_deprecated().

Referenced by Cantera::newSpeciesThermoMgr().

SpeciesThermo * newSpeciesThermoManager ( const std::string &  stype) const

Create a new species thermo property manager given a string.

Parameters
stypeString name for the species thermo type
Returns
Returns the pointer to the newly malloced species property manager for the reference state
Deprecated:
To be removed after Cantera 2.2. Use GeneralSpeciesThermo directly.

Definition at line 158 of file SpeciesThermoFactory.cpp.

References Cantera::lowercase(), and Cantera::warn_deprecated().

Referenced by Cantera::newSpeciesThermoMgr().

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.

Parameters
spDataNodeListThis vector contains a list of species XML nodes that will be in the phase
Returns
Returns the pointer to the newly malloced species property manager for the reference state
Deprecated:
To be removed after Cantera 2.2.

Definition at line 116 of file SpeciesThermoFactory.cpp.

References Cantera::getSpeciesThermoTypes(), NASA, Cantera::popError(), SHOMATE, SIMPLE, and Cantera::warn_deprecated().

void installThermoForSpecies ( size_t  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.

Parameters
kSpecies number
speciesNodeReference to the XML node specifying the species standard state information
th_ptrPointer to the ThermoPhase object for the species
spthermoSpecies reference state thermo manager
phaseNode_ptrOptional pointer to the XML phase information for the phase in which the species resides

Definition at line 568 of file SpeciesThermoFactory.cpp.

References XML_Node::child(), SpeciesThermo::install_STIT(), and Cantera::newSpeciesThermoInterpType().

void installVPThermoForSpecies ( size_t  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.

Parameters
kspecies number
speciesNodeReference to the XML node specifying the species standard state information
vp_ptrvariable pressure ThermoPhase object
vpss_ptrPointer to the Manager for calculating variable pressure substances.
spthermo_ptrSpecies reference state thermo manager
phaseNode_ptrOptional Pointer to the XML phase information for the phase in which the species resides
Deprecated:
To be removed after Cantera 2.2. Call VPStandardStateTP::createInstallVPSS directly instead.

Definition at line 577 of file SpeciesThermoFactory.cpp.

References Cantera::warn_deprecated().

Member Data Documentation

SpeciesThermoFactory * s_factory = 0
staticprivate

Pointer to the sole instance of this class, which is static.

Definition at line 178 of file SpeciesThermoFactory.h.

mutex_t species_thermo_mutex
staticprivate

Decl of the static mutex variable that locks the SpeciesThermo factory singleton.

Definition at line 181 of file SpeciesThermoFactory.h.


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