OGS 6.1.0-1699-ge946d4c5f
createStorageModel.cpp
Go to the documentation of this file.
1 
13 #include "createStorageModel.h"
14 
15 #include "BaseLib/Error.h"
16 #include "BaseLib/ConfigTree.h"
17 
18 #include "Storage.h"
19 #include "ConstantStorage.h"
20 
21 namespace MaterialLib
22 {
23 namespace PorousMedium
24 {
25 std::unique_ptr<Storage> createStorageModel(BaseLib::ConfigTree const& config)
26 {
28  auto const type = config.getConfigParameter<std::string>("type");
29 
30  if (type == "Constant")
31  return std::make_unique<ConstantStorage>(
33  config.getConfigParameter<double>("value"));
34 
35  OGS_FATAL("The storage type %s is unavailable.\n", type.data(),
36  "The available type is Constant.");
37 }
38 
39 } // end namespace
40 } // end namespace
std::unique_ptr< Storage > createStorageModel(BaseLib::ConfigTree const &config)
T getConfigParameter(std::string const &param) const
#define OGS_FATAL(fmt,...)
Definition: Error.h:71