Cantera  3.0.0
Loading...
Searching...
No Matches
ReactorFactory.h
Go to the documentation of this file.
1//! @file ReactorFactory.h
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef REACTOR_FACTORY_H
7#define REACTOR_FACTORY_H
8
11
12namespace Cantera
13{
14
15//! Factory class to create reactor objects
16//!
17//! This class is mainly used via the newReactor3() function, for example:
18//!
19//! ```cpp
20//! shared_ptr<ReactorBase> r1 = newReactor3("IdealGasReactor");
21//! ```
22class ReactorFactory : public Factory<ReactorBase>
23{
24public:
25 static ReactorFactory* factory();
26
27 void deleteFactory() override;
28
29 //! Create a new reactor by type name.
30 /*!
31 * @param reactorType the type to be created.
32 * @deprecated To be removed after %Cantera 3.0; replaceable by newReactor3.
33 */
34 ReactorBase* newReactor(const string& reactorType);
35
36private:
37 static ReactorFactory* s_factory;
38 static std::mutex reactor_mutex;
40};
41
42//! @defgroup reactorGroup Reactors
43//! Zero-dimensional objects representing stirred reactors.
44//! Reactors simulate time-dependent behavior considering gas-phase chemistry.
45//! Reactor objects should be instantiated via the newReactor3() function, for example:
46//!
47//! ```cpp
48//! shared_ptr<ReactorBase> r1 = newReactor3("IdealGasReactor");
49//! ```
50//! @ingroup zerodGroup
51//! @{
52
53//! Create a Reactor object of the specified type
54//! @deprecated To be changed after %Cantera 3.0; for new behavior, see newReactor3().
55ReactorBase* newReactor(const string& model);
56
57//! Create a Reactor object of the specified type
58//! @since New in %Cantera 3.0.
59//! @todo Transition back to newReactor() after %Cantera 3.0
60shared_ptr<ReactorBase> newReactor3(const string& model);
61
62//! @}
63
64}
65
66#endif
File contains the FactoryBase class declarations.
Factory class that supports registering functions to create objects.
Definition FactoryBase.h:69
Base class for stirred reactors.
Definition ReactorBase.h:50
Factory class to create reactor objects.
void deleteFactory() override
Virtual abstract function that deletes the factory.
ReactorBase * newReactor(const string &reactorType)
Create a new reactor by type name.
shared_ptr< ReactorBase > newReactor3(const string &model)
Create a Reactor object of the specified type.
ReactorBase * newReactor(const string &model)
Create a Reactor object of the specified type.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564