15#include "cantera/zeroD/IdealGasConstPressureReactor.h"
22ReactorFactory* ReactorFactory::s_factory = 0;
23std::mutex ReactorFactory::reactor_mutex;
25ReactorFactory::ReactorFactory()
28 [](shared_ptr<Solution> sol,
const string& name)
29 {
return new Reservoir(sol, name); });
31 [](shared_ptr<Solution> sol,
const string& name)
32 {
return new Reactor(sol, name); });
33 reg(
"ConstPressureReactor",
34 [](shared_ptr<Solution> sol,
const string& name)
35 {
return new ConstPressureReactor(sol, name); });
37 [](shared_ptr<Solution> sol,
const string& name)
38 {
return new FlowReactor(sol, name); });
39 reg(
"IdealGasReactor",
40 [](shared_ptr<Solution> sol,
const string& name)
41 {
return new IdealGasReactor(sol, name); });
42 reg(
"IdealGasConstPressureReactor",
43 [](shared_ptr<Solution> sol,
const string& name)
44 {
return new IdealGasConstPressureReactor(sol, name); });
45 reg(
"ExtensibleReactor",
46 [](shared_ptr<Solution> sol,
const string& name)
47 {
return new ReactorDelegator<Reactor>(sol, name); });
48 reg(
"ExtensibleIdealGasReactor",
49 [](shared_ptr<Solution> sol,
const string& name)
50 {
return new ReactorDelegator<IdealGasReactor>(sol, name); });
51 reg(
"ExtensibleConstPressureReactor",
52 [](shared_ptr<Solution> sol,
const string& name)
53 {
return new ReactorDelegator<ConstPressureReactor>(sol, name); });
54 reg(
"ExtensibleIdealGasConstPressureReactor",
55 [](shared_ptr<Solution> sol,
const string& name)
56 {
return new ReactorDelegator<IdealGasConstPressureReactor>(sol, name); });
57 reg(
"ExtensibleMoleReactor",
58 [](shared_ptr<Solution> sol,
const string& name)
59 {
return new ReactorDelegator<MoleReactor>(sol, name); });
60 reg(
"ExtensibleConstPressureMoleReactor",
61 [](shared_ptr<Solution> sol,
const string& name)
62 {
return new ReactorDelegator<ConstPressureMoleReactor>(sol, name); });
63 reg(
"ExtensibleIdealGasMoleReactor",
64 [](shared_ptr<Solution> sol,
const string& name)
65 {
return new ReactorDelegator<IdealGasMoleReactor>(sol, name); });
66 reg(
"ExtensibleIdealGasConstPressureMoleReactor",
67 [](shared_ptr<Solution> sol,
const string& name)
68 {
return new ReactorDelegator<IdealGasConstPressureMoleReactor>(sol, name); });
69 reg(
"IdealGasConstPressureMoleReactor",
70 [](shared_ptr<Solution> sol,
const string& name)
71 {
return new IdealGasConstPressureMoleReactor(sol, name); });
72 reg(
"IdealGasMoleReactor",
73 [](shared_ptr<Solution> sol,
const string& name)
74 {
return new IdealGasMoleReactor(sol, name); });
75 reg(
"ConstPressureMoleReactor",
76 [](shared_ptr<Solution> sol,
const string& name)
77 {
return new ConstPressureMoleReactor(sol, name); });
79 [](shared_ptr<Solution> sol,
const string& name)
80 {
return new MoleReactor(sol, name); });
83ReactorFactory* ReactorFactory::factory() {
84 std::unique_lock<std::mutex> lock(reactor_mutex);
86 s_factory =
new ReactorFactory;
92 std::unique_lock<std::mutex> lock(reactor_mutex);
99 return shared_ptr<ReactorBase>(
100 ReactorFactory::factory()->create(model,
nullptr,
""));
104 const string& model, shared_ptr<Solution> contents,
const string& name)
106 return shared_ptr<ReactorBase>(
107 ReactorFactory::factory()->create(model, contents, name));
void reg(const string &name, function< ReactorBase *(Args...)> f)
Register a new object construction function.
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.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.