OGS
Reaction.cpp
Go to the documentation of this file.
1
10#include "Reaction.h"
11
12#include "BaseLib/StringTools.h"
13#include "Density100MPa.h"
14#include "DensityConst.h"
15#include "DensityCook.h"
16#include "DensityDubinin.h"
17#include "DensityHauer.h"
18#include "DensityLegacy.h"
19#include "DensityMette.h"
20#include "DensityNunez.h"
21#include "ReactionCaOH2.h"
22#include "ReactionInert.h"
23#include "ReactionSinusoidal.h"
24
25namespace Adsorption
26{
27std::unique_ptr<Reaction> Reaction::newInstance(BaseLib::ConfigTree const& conf)
28{
30 auto const type = conf.getConfigParameter<std::string>("type");
31
32 if (type == "Z13XBF")
33 {
34 return std::make_unique<DensityLegacy>();
35 }
36 if (type == "Z13XBF_100MPa")
37 {
38 return std::make_unique<Density100MPa>();
39 }
40 if (type == "Z13XBF_Const")
41 {
42 return std::make_unique<DensityConst>();
43 }
44 if (type == "Z13XBF_Cook")
45 {
46 return std::make_unique<DensityCook>();
47 }
48 if (type == "Z13XBF_Dubinin")
49 {
50 return std::make_unique<DensityDubinin>();
51 }
52 if (type == "Z13XBF_Hauer")
53 {
54 return std::make_unique<DensityHauer>();
55 }
56 if (type == "Z13XBF_Mette")
57 {
58 return std::make_unique<DensityMette>();
59 }
60 if (type == "Z13XBF_Nunez")
61 {
62 return std::make_unique<DensityNunez>();
63 }
64 if (type == "Inert")
65 {
66 return std::make_unique<ReactionInert>();
67 }
68 if (type == "Sinusoidal")
69 {
70 return std::make_unique<ReactionSinusoidal>(conf);
71 }
72 if (type == "CaOH2")
73 {
74 return std::make_unique<ReactionCaOH2>(conf);
75 }
76
77 OGS_FATAL("Unknown reactive system: {:s}.", type);
78
79 return nullptr;
80}
81
82} // namespace Adsorption
#define OGS_FATAL(...)
Definition Error.h:26
Definition of string helper functions.
static std::unique_ptr< Reaction > newInstance(BaseLib::ConfigTree const &conf)
Definition Reaction.cpp:27
T getConfigParameter(std::string const &param) const