[bugfix][ISTLSolverEbos] fix compilation when dune-fem is used in

conjunction with opm-simulators.
This commit is contained in:
Robert Kloefkorn 2020-03-31 14:22:11 +02:00
parent 4a6814d6bc
commit 8afe8c3f96

View File

@ -217,7 +217,7 @@ public:
return overlapping ? return overlapping ?
Dune::SolverCategory::overlapping : Dune::SolverCategory::sequential; Dune::SolverCategory::overlapping : Dune::SolverCategory::sequential;
} }
//! constructor: just store a reference to a matrix //! constructor: just store a reference to a matrix
WellModelGhostLastMatrixAdapter (const M& A, WellModelGhostLastMatrixAdapter (const M& A,
const M& A_for_precond, const M& A_for_precond,
@ -235,7 +235,7 @@ public:
} }
#endif #endif
} }
virtual void apply( const X& x, Y& y ) const override virtual void apply( const X& x, Y& y ) const override
{ {
for (auto row = A_.begin(); row.index() < interiorSize_; ++row) for (auto row = A_.begin(); row.index() < interiorSize_; ++row)
@ -245,7 +245,7 @@ public:
for (auto col = (*row).begin(); col != endc; ++col) for (auto col = (*row).begin(); col != endc; ++col)
(*col).umv(x[col.index()], y[row.index()]); (*col).umv(x[col.index()], y[row.index()]);
} }
// add well model modification to y // add well model modification to y
wellMod_.apply(x, y ); wellMod_.apply(x, y );
@ -263,7 +263,7 @@ public:
} }
// add scaled well model modification to y // add scaled well model modification to y
wellMod_.applyScaleAdd( alpha, x, y ); wellMod_.applyScaleAdd( alpha, x, y );
ghostLastProject( y ); ghostLastProject( y );
} }
@ -273,7 +273,7 @@ public:
{ {
return comm_.operator->(); return comm_.operator->();
} }
protected: protected:
void ghostLastProject(Y& y) const void ghostLastProject(Y& y) const
{ {
@ -281,12 +281,12 @@ protected:
for (size_t i = interiorSize_; i < end; ++i) for (size_t i = interiorSize_; i < end; ++i)
y[i] = 0; y[i] = 0;
} }
const matrix_type& A_ ; const matrix_type& A_ ;
const matrix_type& A_for_precond_ ; const matrix_type& A_for_precond_ ;
const WellModel& wellMod_; const WellModel& wellMod_;
size_t interiorSize_; size_t interiorSize_;
std::unique_ptr< communication_type > comm_; std::unique_ptr< communication_type > comm_;
}; };
@ -372,7 +372,7 @@ protected:
// Set it up manually // Set it up manually
using ElementMapper = using ElementMapper =
Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
ElementMapper elemMapper(simulator_.vanguard().grid().leafGridView(), Dune::mcmgElementLayout()); ElementMapper elemMapper(simulator_.vanguard().gridView(), Dune::mcmgElementLayout());
detail::findOverlapAndInterior(gridForConn, elemMapper, overlapRows_, interiorRows_); detail::findOverlapAndInterior(gridForConn, elemMapper, overlapRows_, interiorRows_);
if (gridForConn.comm().size() > 1) { if (gridForConn.comm().size() > 1) {
@ -465,7 +465,7 @@ protected:
typedef WellModelGhostLastMatrixAdapter< Matrix, Vector, Vector, WellModel, true > Operator; typedef WellModelGhostLastMatrixAdapter< Matrix, Vector, Vector, WellModel, true > Operator;
Operator opA(*matrix_, *matrix_, wellModel, interiorCellNum_, Operator opA(*matrix_, *matrix_, wellModel, interiorCellNum_,
parallelInformation_ ); parallelInformation_ );
assert( opA.comm() ); assert( opA.comm() );
solve( opA, x, *rhs_, *(opA.comm()) ); solve( opA, x, *rhs_, *(opA.comm()) );
} }
@ -476,10 +476,10 @@ protected:
copyJacToNoGhost(*matrix_, *noGhostMat_); copyJacToNoGhost(*matrix_, *noGhostMat_);
Operator opA(*noGhostMat_, *noGhostMat_, wellModel, Operator opA(*noGhostMat_, *noGhostMat_, wellModel,
parallelInformation_ ); parallelInformation_ );
assert( opA.comm() ); assert( opA.comm() );
solve( opA, x, *rhs_, *(opA.comm()) ); solve( opA, x, *rhs_, *(opA.comm()) );
} }
} }
else else
@ -807,12 +807,13 @@ protected:
void noGhostAdjacency() void noGhostAdjacency()
{ {
const auto& grid = simulator_.vanguard().grid(); const auto& grid = simulator_.vanguard().grid();
const auto& gridView = simulator_.vanguard().gridView();
// For some reason simulator_.model().elementMapper() is not initialized at this stage. // For some reason simulator_.model().elementMapper() is not initialized at this stage.
// Hence const auto& elemMapper = simulator_.model().elementMapper(); does not work. // Hence const auto& elemMapper = simulator_.model().elementMapper(); does not work.
// Set it up manually // Set it up manually
using ElementMapper = using ElementMapper =
Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
ElementMapper elemMapper(simulator_.vanguard().grid().leafGridView(), Dune::mcmgElementLayout()); ElementMapper elemMapper(gridView, Dune::mcmgElementLayout());
typedef typename Matrix::size_type size_type; typedef typename Matrix::size_type size_type;
size_type numCells = grid.size( 0 ); size_type numCells = grid.size( 0 );
noGhostMat_.reset(new Matrix(numCells, numCells, Matrix::random)); noGhostMat_.reset(new Matrix(numCells, numCells, Matrix::random));
@ -820,7 +821,6 @@ protected:
std::vector<std::set<size_type>> pattern; std::vector<std::set<size_type>> pattern;
pattern.resize(numCells); pattern.resize(numCells);
const auto& gridView = grid.leafGridView();
auto elemIt = gridView.template begin<0>(); auto elemIt = gridView.template begin<0>();
const auto& elemEndIt = gridView.template end<0>(); const auto& elemEndIt = gridView.template end<0>();