More minor cleanup.

This commit is contained in:
Atgeirr Flø Rasmussen 2019-04-09 10:37:09 +02:00 committed by Markus Blatt
parent 7664d27849
commit 07e495c9da

View File

@ -95,7 +95,7 @@ namespace Opm
void prepare(const SparseMatrixAdapter& M, Vector& b)
{
int newton_iteration = this->simulator_.model().newtonMethod().numIterations();
if( newton_iteration < 1 or not(this->parameters_.cpr_reuse_setup_) ) {
if (newton_iteration < 1 or not(this->parameters_.cpr_reuse_setup_)) {
SuperClass::matrix_.reset(new Matrix(M.istlMatrix()));
} else {
*SuperClass::matrix_ = M.istlMatrix();
@ -106,33 +106,34 @@ namespace Opm
#if HAVE_MPI
if( this->isParallel() ) {
// parallel implemantation si as before
// typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, true ,TypeTag> Operator;
#if 0
// Copied from superclass.
typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, true> Operator;
auto ebosJacIgnoreOverlap = Matrix(*(this->matrix_));
//remove ghost rows in local matrix
this->makeOverlapRowsInvalid(ebosJacIgnoreOverlap);
// auto ebosJacIgnoreOverlap = Matrix(*(this->matrix_));
// //remove ghost rows in local matrix
// this->makeOverlapRowsInvalid(ebosJacIgnoreOverlap);
//Not sure what actual_mat_for_prec is, so put ebosJacIgnoreOverlap as both variables
//to be certain that correct matrix is used for preconditioning.
Operator opA(ebosJacIgnoreOverlap, ebosJacIgnoreOverlap, wellModel,
this->parallelInformation_ );
assert( opA.comm() );
//SuperClass::solve( opA, x, *(this->rhs_), *(opA.comm()) );
Dune::OwnerOverlapCopyCommunication<int,int>* comm = opA.comm();
const size_t size = opA.getmat().N();
// //Not sure what actual_mat_for_prec is, so put ebosJacIgnoreOverlap as both variables
// //to be certain that correct matrix is used for preconditioning.
// Operator opA(ebosJacIgnoreOverlap, ebosJacIgnoreOverlap, wellModel,
// this->parallelInformation_ );
// assert( opA.comm() );
// //SuperClass::solve( opA, x, *(this->rhs_), *(opA.comm()) );
// typedef Dune::OwnerOverlapCopyCommunication<int,int>& comm = *(opA.comm());
// const size_t size = opA.getmat().N();
const ParallelISTLInformation& info =
boost::any_cast<const ParallelISTLInformation&>( this->parallelInformation_);
// const ParallelISTLInformation& info =
// boost::any_cast<const ParallelISTLInformation&>( this->parallelInformation_);
// // As we use a dune-istl with block size np the number of components
// // per parallel is only one.
// info.copyValuesTo(comm.indexSet(), comm.remoteIndices(),
// size, 1);
// // Construct operator, scalar product and vectors needed.
// Dune::InverseOperatorResult result;
// SuperClass::constructPreconditionerAndSolve<Dune::SolverCategory::overlapping>(opA, x, *(this->rhs_), comm, result);
// SuperClass::checkConvergence(result);
// As we use a dune-istl with block size np the number of components
// per parallel is only one.
info.copyValuesTo(comm->indexSet(), comm.remoteIndices(),
size, 1);
// Construct operator, scalar product and vectors needed.
Dune::InverseOperatorResult result;
SuperClass::constructPreconditionerAndSolve<Dune::SolverCategory::overlapping>(opA, x, *(this->rhs_), *comm, result);
SuperClass::checkConvergence(result);
#endif // if 0
} else
#endif
@ -170,8 +171,8 @@ namespace Opm
comm.communicator().rank()==0 ) ? 1 : 0;
// TODO: revise choice of parameters
//int coarsenTarget=4000;
int coarsenTarget=1200;
// int coarsenTarget = 4000;
int coarsenTarget = 1200;
Criterion criterion(15, coarsenTarget);
criterion.setDebugLevel( this->parameters_.cpr_solver_verbose_ ); // no debug information, 1 for printing hierarchy information
criterion.setDefaultValuesIsotropic(2);