12 #include "cantera/zeroD/IdealGasConstPressureReactor.h" 18 ReactorFactory* ReactorFactory::s_factory = 0;
19 std::mutex ReactorFactory::reactor_mutex;
21 ReactorFactory::ReactorFactory()
23 reg(
"Reservoir", []() {
return new Reservoir(); });
24 reg(
"Reactor", []() {
return new Reactor(); });
25 reg(
"ConstPressureReactor", []() {
return new ConstPressureReactor(); });
26 reg(
"FlowReactor", []() {
return new FlowReactor(); });
27 reg(
"IdealGasReactor", []() {
return new IdealGasReactor(); });
28 reg(
"IdealGasConstPressureReactor", []() {
return new IdealGasConstPressureReactor(); });
33 return create(reactorType);
39 static const unordered_map<int, string> types {
40 {ReservoirType,
"Reservoir"},
41 {ReactorType,
"Reactor"},
42 {ConstPressureReactorType,
"ConstPressureReactor"},
43 {FlowReactorType,
"FlowReactor"},
44 {IdealGasReactorType,
"IdealGasReactor"},
45 {IdealGasConstPressureReactorType,
"IdealGasConstPressureReactor"}
49 return create(types.at(ir));
50 }
catch (out_of_range&) {
51 throw CanteraError(
"ReactorFactory::newReactor",
52 "unknown reactor type!");
ReactorBase * newReactor(const std::string &model, ReactorFactory *f=0)
Create a Reactor object of the specified type.
Namespace for the Cantera kernel.