Commit ab268c22 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

bugs due to missing problemStat.getNumComponents() corrected

parent ae5eafb9
......@@ -38,7 +38,7 @@ int main(int argc, char** argv)
Parameters::get("stokes->density", density);
Parameters::get("stokes->boundary velocity", vel);
AdaptInfo adaptInfo("adapt", prob.getNumComponents());
AdaptInfo adaptInfo("adapt");
// tree-paths for components
auto _v = 0_c;
......
......@@ -71,7 +71,7 @@ int main(int argc, char** argv)
prob.addDirichletBC([](auto const& x) { return x[0] < 1.e-8 && x[1] < 1.e-8; }, _p, _p, 0.0);
AdaptInfo adaptInfo("adapt", prob.getNumComponents());
AdaptInfo adaptInfo("adapt");
// assemble and solve system
prob.buildAfterCoarsen(adaptInfo, Flag(0));
......
......@@ -72,7 +72,7 @@ int main(int argc, char** argv)
prob.addDirichletBC([](auto const& x) { return x[0] < 1.e-8 && x[1] < 1.e-8; }, _p, _p, 0.0);
AdaptInfo adaptInfo("adapt", prob.getNumComponents());
AdaptInfo adaptInfo("adapt");
// assemble and solve system
prob.buildAfterCoarsen(adaptInfo, Flag(0));
......
......@@ -55,7 +55,7 @@ int main(int argc, char** argv)
// set point constraint for pressure
prob.addDirichletBC([](auto const& x) { return x[0] < 1.e-8 && x[1] < 1.e-8; }, _p, _p, 0.0);
AdaptInfo adaptInfo("adapt", prob.getNumComponents());
AdaptInfo adaptInfo("adapt");
// assemble and solve system
prob.buildAfterCoarsen(adaptInfo, Flag(0));
......
......@@ -58,15 +58,26 @@ namespace AMDiS
}
/// Returns \ref oldSolution.
decltype(auto) getOldSolution() { return *oldSolution; }
decltype(auto) getOldSolution() const { return *oldSolution; }
std::unique_ptr<SystemVector> getOldSolutionVector() const
{
return *oldSolution;
}
/// Return a mutable view to a oldSolution component
template <class TreePath = RootTreePath>
auto getOldSolution(TreePath const& path = {})
{
auto&& tp = makeTreePath(path);
return makeDOFVectorView(*oldSolution, tp);
}
/// Returns the I'th component of \ref oldSolution.
// template <std::size_t I = 0>
// decltype(auto) getOldSolution(const index_t<I> _i = {})
// {
// return (*oldSolution)[_i];
// }
/// Return a const view to a oldSolution component
template <class TreePath = RootTreePath>
auto getOldSolution(TreePath const& path = {}) const
{
auto&& tp = makeTreePath(path);
return makeDOFVectorView(*oldSolution, tp);
}
/// Implementation of \ref ProblemTimeInterface::transferInitialSolution().
virtual void transferInitialSolution(AdaptInfo& adaptInfo) override;
......@@ -80,7 +91,6 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// Deduction rule
template <class Traits>
......@@ -90,8 +100,7 @@ namespace AMDiS
// Generator for ProblemInstat with given ProblemStat
template <class Traits>
ProblemInstat<Traits>
makeProblemInstat(std::string name, ProblemStat<Traits>& prob)
ProblemInstat<Traits> makeProblemInstat(std::string name, ProblemStat<Traits>& prob)
{
return {std::move(name), prob};
}
......
......@@ -42,16 +42,10 @@ void ProblemInstat<Traits>::createUhOld()
{
AMDIS_FUNCNAME("ProblemInstat::createUhOld()");
if (oldSolution) {
if (oldSolution)
warning("oldSolution already created\n");
}
else {
const int size = problemStat.getNumComponents();
// create oldSolution
std::vector<std::string> componentNames(size, name + "_uOld");
else // create oldSolution
oldSolution.reset(new SystemVector(*problemStat.getGlobalBasis(), name + "_uOld"));
}
}
......
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