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

fixed issue with RosenBrockStationary and changed ProblemStat::buildAfterCoarsen to name assemble

parent a877b6da
......@@ -835,7 +835,7 @@ namespace AMDiS {
}
void ProblemStatSeq::buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
void ProblemStatSeq::assemble(AdaptInfo *adaptInfo, Flag flag,
bool asmMatrix, bool asmVector)
{
FUNCNAME("ProblemStat::buildAfterCoarsen()");
......
......@@ -139,14 +139,22 @@ namespace AMDiS {
/// Implementation of ProblemStatBase::buildAfterCoarsen().
/// Assembles \ref A and \ref rhs. With the last two parameters, assembling
/// can be restricted to matrices or vectors only.
virtual void assemble(AdaptInfo *adaptInfo, Flag flag,
bool assembleMatrix = true,
bool assembleVector = true);
/// Alias for \ref assemble
void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
bool assembleMatrix = true,
bool assembleVector = true) override;
bool assembleVector = true) override
{
assemble(adaptInfo, flag, assembleMatrix, assembleVector);
}
/// assemble all operators of matrix and vector side
void assemble(AdaptInfo* adaptInfo)
{
buildAfterCoarsen(adaptInfo, 0, true, true);
assemble(adaptInfo, 0, true, true);
}
bool dualMeshTraverseRequired();
......
......@@ -70,8 +70,12 @@ namespace AMDiS {
if (toDo.isSet(ADAPT) && markFlag.isSet(MESH_COARSENED))
flag |= problem->coarsenMesh(adaptInfo);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
Parallel::MeshDistributor::globalMeshDistributor->checkMeshChange();
#endif
if (toDo.isSet(BUILD) || toDo.isSet(SOLVE)) {
flag = stageIteration(adaptInfo, toDo, true, true);
flag = stageIteration(adaptInfo);
estimateTimeError(adaptInfo);
}
......@@ -82,17 +86,22 @@ namespace AMDiS {
}
Flag RosenbrockStationary::stageIteration(AdaptInfo *adaptInfo, Flag flag,
bool asmMatrix, bool asmVector)
Flag RosenbrockStationary::stageIteration(AdaptInfo *adaptInfo)
{
FUNCNAME("RosenbrockStationary::stageIteration()");
TEST_EXIT(tauPtr)("No tau pointer defined in stationary problem!\n");
#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
if (first) {
first = false;
*unVec = *solution;
}
#else
// NOTE: To guarantee that unVec is synchronized with solution
// after possible mesh change.
*unVec = *solution;
#endif
*newUn = *unVec;
*lowSol = *unVec;
......@@ -133,10 +142,12 @@ namespace AMDiS {
}
// assemble and solve stage equation
ProblemStat::buildAfterCoarsen(adaptInfo, flag, (i == 0), true);
Flag flag = BUILD | SOLVE;
ProblemStat::assemble(adaptInfo, flag, (i == 0), true);
#if defined HAVE_PARALLEL_PETSC
// TODO: Problems with reuse of Matrix with parallel PETSC-Solvers
// NOTE: Problems with reuse of Matrix with parallel PETSC-Solvers
// Thus, Rosenbrock not efficient but working (Rainer)
// TODO: Change implementation
ProblemStat::solve(adaptInfo, true , false);
#else
ProblemStat::solve(adaptInfo, i == 0, i + 1 < rm->getStages());
......
......@@ -162,8 +162,7 @@ namespace AMDiS {
Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo) override;
virtual Flag stageIteration(AdaptInfo *adaptInfo, Flag flag,
bool asmMatrix, bool asmVector);
virtual Flag stageIteration(AdaptInfo *adaptInfo);
virtual void estimateTimeError(AdaptInfo* adaptInfo);
......
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