Cantera  3.1.0b1
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 newReactor() function, for example:
18//!
19//! ```cpp
20//! shared_ptr<ReactorBase> r1 = newReactor("IdealGasReactor");
21//! ```
22class ReactorFactory : public Factory<ReactorBase, shared_ptr<Solution>, const string&>
23{
24public:
25 static ReactorFactory* factory();
26
27 void deleteFactory() override;
28
29private:
30 static ReactorFactory* s_factory;
31 static std::mutex reactor_mutex;
33};
34
35//! @defgroup reactorGroup Reactors
36//! Zero-dimensional objects representing stirred reactors.
37//! Reactors simulate time-dependent behavior considering gas-phase chemistry.
38//! Reactor objects should be instantiated via the newReactor() function, for example:
39//!
40//! ```cpp
41//! shared_ptr<ReactorBase> r1 = newReactor("IdealGasReactor");
42//! ```
43//! @ingroup zerodGroup
44//! @{
45
46//! Create a Reactor object of the specified type
47//! @since Starting in %Cantera 3.1, this method returns a `shared_ptr<ReactorBase>`
48//! @deprecated Transitional method. Use newReactor() with contents instead.
49shared_ptr<ReactorBase> newReactor(const string& model);
50
51//! Create a Reactor object of the specified type and contents
52//! @since New in %Cantera 3.1.
53shared_ptr<ReactorBase> newReactor(
54 const string& model, shared_ptr<Solution> contents, const string& name="(none)");
55
56//! Create a Reactor object of the specified type
57//! @since New in %Cantera 3.0.
58//! @deprecated Transitional method. Use newReactor() instead.
59shared_ptr<ReactorBase> newReactor3(const string& model);
60
61//! @}
62
63}
64
65#endif
File contains the FactoryBase class declarations.
Factory class that supports registering functions to create objects.
Definition FactoryBase.h:69
Factory class to create reactor objects.
void deleteFactory() override
Virtual abstract function that deletes the factory.
shared_ptr< ReactorBase > newReactor3(const string &model)
Create a Reactor object of the specified type.
shared_ptr< ReactorBase > newReactor(const string &model)
Create a Reactor object of the specified type.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595