13 #include "cantera/zeroD/IdealGasConstPressureReactor.h"
19 ReactorFactory* ReactorFactory::s_factory = 0;
20 mutex_t ReactorFactory::reactor_mutex;
22 static int ntypes = 6;
23 static string _types[] = {
"Reservoir",
"Reactor",
"ConstPressureReactor",
24 "FlowReactor",
"IdealGasReactor",
25 "IdealGasConstPressureReactor"
29 static int _itypes[] = {ReservoirType, ReactorType, ConstPressureReactorType,
30 FlowReactorType, IdealGasReactorType,
31 IdealGasConstPressureReactorType
37 ReactorBase* ReactorFactory::newReactor(
const std::string& reactorType)
42 for (
int n = 0; n < ntypes; n++) {
43 if (reactorType == _types[n]) {
48 return newReactor(ir);
52 ReactorBase* ReactorFactory::newReactor(
int ir)
56 return new Reservoir();
60 return new FlowReactor();
61 case ConstPressureReactorType:
62 return new ConstPressureReactor();
63 case IdealGasReactorType:
64 return new IdealGasReactor();
65 case IdealGasConstPressureReactorType:
66 return new IdealGasConstPressureReactor();
69 "unknown reactor type!");
Base class for exceptions thrown by Cantera classes.