Skip to content
Snippets Groups Projects
Commit 3929b688 authored by Martin Schneider's avatar Martin Schneider Committed by Timo Koch
Browse files

Merge branch 'bugfix/parallel-solver-adaptive' into 'master'

[bugfix][parallel][solver] Rebuild parallel helpers after grid adaption

See merge request !3080

(cherry picked from commit f9427ce4)

d505c0be [bugfix][parallel][solver] Rebuild parallel helpers after grid adaption
parent 93745568
No related branches found
No related tags found
No related merge requests found
Pipeline #15712 waiting for manual action
......@@ -87,6 +87,21 @@ public:
checkAvailabilityOfDirectSolver_();
}
/*!
* \brief Update the solver after grid adaption
*
* \param gridView the grid view on which we are performing the multi-grid
* \param dofMapper an index mapper for dof entities
*/
void updateAfterGridAdaption(const typename LinearSolverTraits::GridView& gridView,
const typename LinearSolverTraits::DofMapper& dofMapper)
{
#if HAVE_MPI
if (isParallel_)
phelper_ = std::make_unique<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper);
#endif
}
/*!
* \brief Solve a linear system.
*
......
......@@ -158,6 +158,21 @@ public:
#endif
}
/*!
* \brief Update the solver after grid adaption
*
* \param gridView the grid view on which we are performing the multi-grid
* \param dofMapper an index mapper for dof entities
*/
void updateAfterGridAdaption(const typename LinearSolverTraits::GridView& gridView,
const typename LinearSolverTraits::DofMapper& dofMapper)
{
#if HAVE_MPI
if (isParallel_)
parallelHelper_ = std::make_unique<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper);
#endif
}
/*!
* \brief Solve a linear system.
*
......
......@@ -202,6 +202,7 @@ int main(int argc, char** argv)
xOld = x; //!< Overwrite the old solution with the new (resized & interpolated) one
gridVariables->updateAfterGridAdaption(x); //!< Initialize the secondary variables to the new (and "new old") solution
assembler->updateAfterGridAdaption(); //!< Tell the assembler that the grid changed
linearSolver->updateAfterGridAdaption(leafGridView, gridGeometry->dofMapper()); //!< Tell the solver that the grid changed
problem->computePointSourceMap(); //!< Update the point source map
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment