OGS
CreateJacobianAssembler.cpp
Go to the documentation of this file.
1
12
14#include "BaseLib/ConfigTree.h"
15#include "BaseLib/Error.h"
19
20namespace ProcessLib
21{
22std::unique_ptr<AbstractJacobianAssembler> createJacobianAssembler(
23 std::optional<BaseLib::ConfigTree> const& config)
24{
25 if (!config)
26 {
27 return std::make_unique<AnalyticalJacobianAssembler>();
28 }
29
31 auto const type = config->peekConfigParameter<std::string>("type");
32
33 if (type == "Analytical")
34 {
35 config->ignoreConfigParameter("type");
36 return std::make_unique<AnalyticalJacobianAssembler>();
37 }
38 if (type == "CentralDifferences")
39 {
41 }
42 if (type == "CompareJacobians")
43 {
45 }
46 if (type == "ForwardDifferences")
47 {
49 }
50
51 OGS_FATAL("Unknown Jacobian assembler type: `{:s}'.", type);
52}
53} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:26
std::unique_ptr< CompareJacobiansJacobianAssembler > createCompareJacobiansJacobianAssembler(BaseLib::ConfigTree const &config)
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(std::optional< BaseLib::ConfigTree > const &config)
std::unique_ptr< AbstractJacobianAssembler > createForwardDifferencesJacobianAssembler(BaseLib::ConfigTree const &config)
std::unique_ptr< CentralDifferencesJacobianAssembler > createCentralDifferencesJacobianAssembler(BaseLib::ConfigTree const &config)