Use correct matrix for flexible solver when parallel.

In this case matrix_ is a nullptr and noGhostMat_ is the optimized
matrix to use. Before this commit we experienced a segmentation fault
as the nullptr was dereferenced and passed to the solver.
This commit is contained in:
Markus Blatt 2020-05-12 19:06:12 +02:00
parent 1f177b33e7
commit ddd947bf0a

View File

@ -892,7 +892,8 @@ protected:
if (recreate_solver || !flexibleSolver_) {
if (isParallel()) {
#if HAVE_MPI
flexibleSolver_.reset(new FlexibleSolverType(prm_, *matrix_, weightsCalculator, *comm_));
assert(noGhostMat_);
flexibleSolver_.reset(new FlexibleSolverType(prm_, *noGhostMat_, weightsCalculator, *comm_));
#endif
} else {
flexibleSolver_.reset(new FlexibleSolverType(prm_, *matrix_, weightsCalculator));