-
Notifications
You must be signed in to change notification settings - Fork 1
/
radiation_factory.cxx
31 lines (28 loc) · 1.15 KB
/
radiation_factory.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "radiation_factory.hxx"
#include "radiation.hxx"
RadiatedPower * RadiatedPowerFactory::create(Options * options){
std::string name;
options->get("RadiationType", name, "updatedradiatedpower");
return create(name, options);
}
RadiatedPower * RadiatedPowerFactory::create(const std::string & name, Options * options){
if (name == "radiatedpower") {
return new RadiatedPower();
} else if (name == "hutchinsoncarbonradiation") {
return new HutchinsonCarbonRadiation();
} else if (name == "hydrogenradiatedpower") {
return new HydrogenRadiatedPower();
} else if (name == "updatedradiatedpower") {
return new UpdatedRadiatedPower();
} else if (name == "testingpower") {
return new TestingPower(options->getSection(name));
} else {
throw BoutException("Cannot handle requested CrossSectionType.\n"
"Requested %s - but we only support:\n"
" * RadiatedPower\n"
" * HutchinsonCarbonRadiation\n"
" * HydrogenRadiatedPower\n"
" * UpdatedRadiatedPower\n"
" * TestingPower\n",name.c_str());
}
}