OGS 6.2.0-97-g4a610c866
CreateJacobianAssembler.cpp
Go to the documentation of this file.
1 
11 #include "BaseLib/Error.h"
12 
16 
17 namespace ProcessLib
18 {
19 std::unique_ptr<AbstractJacobianAssembler> createJacobianAssembler(
20  boost::optional<BaseLib::ConfigTree> const& config)
21 {
22  if (!config)
23  {
24  return std::make_unique<AnalyticalJacobianAssembler>();
25  }
26 
28  auto const type = config->peekConfigParameter<std::string>("type");
29 
30  if (type == "Analytical") {
31  config->ignoreConfigParameter("type");
32  return std::make_unique<AnalyticalJacobianAssembler>();
33  }
34  if (type == "CentralDifferences")
35  {
37  }
38  if (type == "CompareJacobians")
39  {
41  }
42 
43  OGS_FATAL("Unknown Jacobian assembler type: `%s'.", type.c_str());
44 }
45 } // namespace ProcessLib
std::unique_ptr< CompareJacobiansJacobianAssembler > createCompareJacobiansJacobianAssembler(BaseLib::ConfigTree const &config)
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(boost::optional< BaseLib::ConfigTree > const &config)
std::unique_ptr< CentralDifferencesJacobianAssembler > createCentralDifferencesJacobianAssembler(BaseLib::ConfigTree const &config)
#define OGS_FATAL(fmt,...)
Definition: Error.h:63