Skip to content
Snippets Groups Projects
Commit b71f3284 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

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
Branches
No related tags found
No related merge requests found
......@@ -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));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment