| 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
9#include "cantera/zeroD/ReactorBase.h"
10#include "cantera/base/FactoryBase.h"
11
12 namespace 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//! ```
22 class ReactorFactory : public Factory<ReactorBase>
23{
24 public:
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
36 private:
37 static ReactorFactory* s_factory;
38 static std::mutex reactor_mutex;
39 ReactorFactory();
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().
55 ReactorBase* 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
60 shared_ptr<ReactorBase> newReactor3(const string& model);
61
62//! @}
63
64}
65
66#endif
FactoryBase.h
File contains the FactoryBase class declarations.
ReactorBase.h
Cantera::Factory
Factory class that supports registering functions to create objects.
Definition FactoryBase.h:69
Cantera::ReactorBase
Base class for stirred reactors.
Definition ReactorBase.h:50
Cantera::ReactorFactory
Factory class to create reactor objects.
Definition ReactorFactory.h:23
Cantera::ReactorFactory::deleteFactory
void deleteFactory() override
Virtual abstract function that deletes the factory.
Definition ReactorFactory.cpp:63
Cantera::ReactorFactory::newReactor
ReactorBase * newReactor(const string &reactorType)
Create a new reactor by type name.
Definition ReactorFactory.cpp:69
Cantera::newReactor3
shared_ptr< ReactorBase > newReactor3(const string &model)
Create a Reactor object of the specified type.
Definition ReactorFactory.cpp:83
Cantera::newReactor
ReactorBase * newReactor(const string &model)
Create a Reactor object of the specified type.
Definition ReactorFactory.cpp:76
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564