Commit b71f3284 authored by Praetorius, Simon's avatar Praetorius, Simon

Merge branch 'issue/problem_instat_oldsolution' into 'develop'

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

See merge request spraetor/dune-amdis!95
parents fcda9898 0df61ec8
Pipeline #1803 passed with stage
in 38 minutes and 43 seconds
......@@ -53,28 +53,20 @@ namespace AMDiS
ProblemType& problemStat() { return *problemStat_; }
ProblemType const& problemStat() const { return *problemStat_; }
/// Returns \ref 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_;
}
/// Return a mutable view to a oldSolution component
template <class TreePath = RootTreePath>
auto oldSolution(TreePath path = {})
{
auto&& tp = makeTreePath(path);
return makeDOFVectorView(oldSolutionVector(), tp);
}
/// Return a const view to a oldSolution component
template <class TreePath = RootTreePath>
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