Commit 4f88335b authored by Praetorius, Simon's avatar Praetorius, Simon

cleanup oldSolution in ProblemInstat, so that it can be used in expressions...

cleanup oldSolution in ProblemInstat, so that it can be used in expressions and allows interpolation during grid changes
parent 138c15d3
Pipeline #1783 passed with stage
in 25 minutes and 52 seconds
......@@ -53,10 +53,18 @@ namespace AMDiS
ProblemType& problemStat() { return *problemStat_; }
ProblemType const& problemStat() const { return *problemStat_; }
/// Returns \ref oldSolution.
/// Returns mutable-ref of \ref oldSolution.
SystemVector& oldSolutionVector()
{
test_exit_dbg(bool(oldSolution_),
"OldSolution need to be created. Call initialize with INIT_UH_OLD.");
return *oldSolution_;
}
/// Returns const-ref of \ref oldSolution.
SystemVector const& oldSolutionVector() const
{
test_exit_dbg(oldSolution_,
test_exit_dbg(bool(oldSolution_),
"OldSolution need to be created. Call initialize with INIT_UH_OLD.");
return *oldSolution_;
}
......@@ -74,7 +82,7 @@ namespace AMDiS
auto oldSolution(TreePath path = {}) const
{
auto&& tp = makeTreePath(path);
return makeDOFVectorView(oldSolutionVector(), tp);
return makeDiscreteFunction(oldSolutionVector(), tp);
}
/// Implementation of \ref ProblemTimeInterface::transferInitialSolution().
......
......@@ -45,7 +45,7 @@ void ProblemInstat<Traits>::createUhOld()
if (oldSolution_)
warning("oldSolution already created\n");
else // create oldSolution
oldSolution_.reset(new SystemVector(problemStat_->globalBasis()));
oldSolution_.reset(new SystemVector(problemStat_->globalBasis(), INTERPOLATE));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment