Loading [MathJax]/extensions/tex2jax.js
Cantera  3.2.0a1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TransportFactory.h
Go to the documentation of this file.
1/**
2 * @file TransportFactory.h
3 * Header file defining class TransportFactory
4 * (see @link Cantera::TransportFactory TransportFactory@endlink)
5 */
6
7// This file is part of Cantera. See License.txt in the top-level directory or
8// at https://cantera.org/license.txt for license and copyright information.
9
10#ifndef CT_TRANSPORTFACTORY_H
11#define CT_TRANSPORTFACTORY_H
12
13// Cantera includes
14#include "Transport.h"
16
17namespace Cantera
18{
19
20//! Factory class for creating new instances of classes derived from Transport.
21/*!
22 * Creates 'transport managers', which are classes derived from class
23 * Transport that provide transport properties. TransportFactory handles all
24 * initialization required, including evaluation of collision integrals and
25 * generating polynomial fits. Transport managers can also be created in
26 * other ways.
27 *
28 * @ingroup tranprops
29 */
30class TransportFactory : public Factory<Transport>
31{
32public:
33 //! Return a pointer to a TransportFactory instance.
34 /*!
35 * TransportFactory is implemented as a 'singleton', which means that at
36 * most one instance may be created. The constructor is private. When a
37 * TransportFactory instance is required, call static method factory() to
38 * return a pointer to the TransportFactory instance.
39 *
40 * @code
41 * TransportFactory* f;
42 * f = TransportFactory::factory();
43 * @endcode
44 */
45 static TransportFactory* factory();
46
47 //! Deletes the statically allocated factory instance.
48 void deleteFactory() override;
49
50 //! Build a new transport manager using a transport manager that may not be the same
51 //! as in the phase description and return a base class pointer to it
52 /*!
53 * @param model String name for the transport manager
54 * @param thermo ThermoPhase object
55 */
56 Transport* newTransport(const string& model, ThermoPhase* thermo);
57
58 //! Build a new transport manager using the default transport manager
59 //! in the phase description and return a base class pointer to it
61
62private:
63 //! Static instance of the factor -> This is the only instance of this
64 //! object allowed
66
67 //! Static instance of the mutex used to ensure the proper reading of the
68 //! transport database
69 static std::mutex transport_mutex;
70
71 //! The constructor is private; use static method factory() to
72 //! get a pointer to a factory instance
73 /*!
74 * The default constructor for this class sets up m_models[], a mapping
75 * between the string name for a transport model and the integer name.
76 */
78
79 //! Models included in this map are initialized in CK compatibility mode
80 map<string, bool> m_CK_mode;
81};
82
83//! Create a new Transport instance.
84/*!
85 * @param thermo the ThermoPhase object associated with the phase
86 * @param model name of transport model; if "default", the default
87 * transport model for the ThermoPhase object is created
88 * @returns a Transport object for the phase
89 * @ingroup tranprops
90 */
91shared_ptr<Transport> newTransport(shared_ptr<ThermoPhase> thermo,
92 const string& model="default");
93
94} // End of namespace Cantera
95
96#endif
File contains the FactoryBase class declarations.
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
Factory class that supports registering functions to create objects.
Definition FactoryBase.h:69
Base class for a phase with thermodynamic properties.
Factory class for creating new instances of classes derived from Transport.
static TransportFactory * s_factory
Static instance of the factor -> This is the only instance of this object allowed.
void deleteFactory() override
Deletes the statically allocated factory instance.
Transport * newTransport(const string &model, ThermoPhase *thermo)
Build a new transport manager using a transport manager that may not be the same as in the phase desc...
static TransportFactory * factory()
Return a pointer to a TransportFactory instance.
static std::mutex transport_mutex
Static instance of the mutex used to ensure the proper reading of the transport database.
map< string, bool > m_CK_mode
Models included in this map are initialized in CK compatibility mode.
TransportFactory()
The constructor is private; use static method factory() to get a pointer to a factory instance.
Base class for transport property managers.
Definition Transport.h:72
shared_ptr< Transport > newTransport(shared_ptr< ThermoPhase > thermo, const string &model)
Create a new Transport instance.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595