Skip to content
Snippets Groups Projects
Commit 2cd6be7d authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[NL] changed to new ConfigTree

parent b6675867
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <limits> #include <limits>
#include <cassert> #include <cassert>
#include "BaseLib/ConfigTree.h" #include "BaseLib/ConfigTreeNew.h"
#include "logog/include/logog.hpp" #include "logog/include/logog.hpp"
namespace NumLib namespace NumLib
...@@ -32,31 +32,15 @@ FixedTimeStepping::FixedTimeStepping(double t0, double tn, double dt) ...@@ -32,31 +32,15 @@ FixedTimeStepping::FixedTimeStepping(double t0, double tn, double dt)
{} {}
FixedTimeStepping* FixedTimeStepping*
FixedTimeStepping::newInstance(BaseLib::ConfigTree const& config) FixedTimeStepping::newInstance(BaseLib::ConfigTreeNew const& config)
{ {
assert(config.get<std::string>("type") == "FixedTimeStepping"); config.checkConfParam("type", "FixedTimeStepping");
auto const t_initial = config.get_optional<double>("t_initial"); auto const t_initial = config.getConfParam<double>("t_initial");
auto const t_end = config.get_optional<double>("t_end"); auto const t_end = config.getConfParam<double>("t_end");
auto const dt = config.get_optional<double>("dt"); auto const dt = config.getConfParam<double>("dt");
if (!t_initial) return new FixedTimeStepping(t_initial, t_end, dt);
{
ERR("could not find required parameter t_initial.");
return nullptr;
}
if (!t_end)
{
ERR("could not find required parameter t_end.");
return nullptr;
}
if (!dt)
{
ERR("could not find required parameter dt.");
return nullptr;
}
return new FixedTimeStepping(*t_initial, *t_end, *dt);
} }
const TimeStep FixedTimeStepping::getTimeStep() const const TimeStep FixedTimeStepping::getTimeStep() const
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <vector> #include <vector>
#include "BaseLib/ConfigTree.h" #include "BaseLib/ConfigTreeNew.h"
#include "ITimeStepAlgorithm.h" #include "ITimeStepAlgorithm.h"
namespace NumLib namespace NumLib
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
* *
* Currently this function only covers uniform timestep size. * Currently this function only covers uniform timestep size.
*/ */
static FixedTimeStepping* newInstance(BaseLib::ConfigTree const& config); static FixedTimeStepping* newInstance(BaseLib::ConfigTreeNew const& config);
virtual ~FixedTimeStepping() {} virtual ~FixedTimeStepping() {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment