mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
More minor cleanup.
This commit is contained in:
parent
7664d27849
commit
07e495c9da
@ -95,7 +95,7 @@ namespace Opm
|
|||||||
void prepare(const SparseMatrixAdapter& M, Vector& b)
|
void prepare(const SparseMatrixAdapter& M, Vector& b)
|
||||||
{
|
{
|
||||||
int newton_iteration = this->simulator_.model().newtonMethod().numIterations();
|
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()));
|
SuperClass::matrix_.reset(new Matrix(M.istlMatrix()));
|
||||||
} else {
|
} else {
|
||||||
*SuperClass::matrix_ = M.istlMatrix();
|
*SuperClass::matrix_ = M.istlMatrix();
|
||||||
@ -106,33 +106,34 @@ namespace Opm
|
|||||||
|
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if( this->isParallel() ) {
|
if( this->isParallel() ) {
|
||||||
// parallel implemantation si as before
|
#if 0
|
||||||
// typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, true ,TypeTag> Operator;
|
// Copied from superclass.
|
||||||
|
typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, true> Operator;
|
||||||
// auto ebosJacIgnoreOverlap = Matrix(*(this->matrix_));
|
auto ebosJacIgnoreOverlap = Matrix(*(this->matrix_));
|
||||||
// //remove ghost rows in local matrix
|
//remove ghost rows in local matrix
|
||||||
// this->makeOverlapRowsInvalid(ebosJacIgnoreOverlap);
|
this->makeOverlapRowsInvalid(ebosJacIgnoreOverlap);
|
||||||
|
|
||||||
// //Not sure what actual_mat_for_prec is, so put ebosJacIgnoreOverlap as both variables
|
//Not sure what actual_mat_for_prec is, so put ebosJacIgnoreOverlap as both variables
|
||||||
// //to be certain that correct matrix is used for preconditioning.
|
//to be certain that correct matrix is used for preconditioning.
|
||||||
// Operator opA(ebosJacIgnoreOverlap, ebosJacIgnoreOverlap, wellModel,
|
Operator opA(ebosJacIgnoreOverlap, ebosJacIgnoreOverlap, wellModel,
|
||||||
// this->parallelInformation_ );
|
this->parallelInformation_ );
|
||||||
// assert( opA.comm() );
|
assert( opA.comm() );
|
||||||
// //SuperClass::solve( opA, x, *(this->rhs_), *(opA.comm()) );
|
//SuperClass::solve( opA, x, *(this->rhs_), *(opA.comm()) );
|
||||||
// typedef Dune::OwnerOverlapCopyCommunication<int,int>& comm = *(opA.comm());
|
Dune::OwnerOverlapCopyCommunication<int,int>* comm = opA.comm();
|
||||||
// const size_t size = opA.getmat().N();
|
const size_t size = opA.getmat().N();
|
||||||
|
|
||||||
// const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
// boost::any_cast<const ParallelISTLInformation&>( this->parallelInformation_);
|
boost::any_cast<const ParallelISTLInformation&>( this->parallelInformation_);
|
||||||
|
|
||||||
// // As we use a dune-istl with block size np the number of components
|
// As we use a dune-istl with block size np the number of components
|
||||||
// // per parallel is only one.
|
// per parallel is only one.
|
||||||
// info.copyValuesTo(comm.indexSet(), comm.remoteIndices(),
|
info.copyValuesTo(comm->indexSet(), comm.remoteIndices(),
|
||||||
// size, 1);
|
size, 1);
|
||||||
// // Construct operator, scalar product and vectors needed.
|
// Construct operator, scalar product and vectors needed.
|
||||||
// Dune::InverseOperatorResult result;
|
Dune::InverseOperatorResult result;
|
||||||
// SuperClass::constructPreconditionerAndSolve<Dune::SolverCategory::overlapping>(opA, x, *(this->rhs_), comm, result);
|
SuperClass::constructPreconditionerAndSolve<Dune::SolverCategory::overlapping>(opA, x, *(this->rhs_), *comm, result);
|
||||||
// SuperClass::checkConvergence(result);
|
SuperClass::checkConvergence(result);
|
||||||
|
#endif // if 0
|
||||||
|
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -156,7 +157,7 @@ namespace Opm
|
|||||||
#endif
|
#endif
|
||||||
Vector& istlb = *(this->rhs_);
|
Vector& istlb = *(this->rhs_);
|
||||||
parallelInformation_arg.copyOwnerToAll(istlb, istlb);
|
parallelInformation_arg.copyOwnerToAll(istlb, istlb);
|
||||||
|
|
||||||
if( ! std::is_same< LinearOperator, MatrixAdapter > :: value ) {
|
if( ! std::is_same< LinearOperator, MatrixAdapter > :: value ) {
|
||||||
// create new operator in case linear operator and matrix operator differ
|
// create new operator in case linear operator and matrix operator differ
|
||||||
opA_.reset( new MatrixAdapter( opASerial_->getmat()));//, parallelInformation_arg ) );
|
opA_.reset( new MatrixAdapter( opASerial_->getmat()));//, parallelInformation_arg ) );
|
||||||
@ -168,10 +169,10 @@ namespace Opm
|
|||||||
POrComm& comm = parallelInformation_arg;
|
POrComm& comm = parallelInformation_arg;
|
||||||
const int verbosity = ( this->parameters_.cpr_solver_verbose_ &&
|
const int verbosity = ( this->parameters_.cpr_solver_verbose_ &&
|
||||||
comm.communicator().rank()==0 ) ? 1 : 0;
|
comm.communicator().rank()==0 ) ? 1 : 0;
|
||||||
|
|
||||||
// TODO: revise choice of parameters
|
// TODO: revise choice of parameters
|
||||||
//int coarsenTarget=4000;
|
// int coarsenTarget = 4000;
|
||||||
int coarsenTarget=1200;
|
int coarsenTarget = 1200;
|
||||||
Criterion criterion(15, coarsenTarget);
|
Criterion criterion(15, coarsenTarget);
|
||||||
criterion.setDebugLevel( this->parameters_.cpr_solver_verbose_ ); // no debug information, 1 for printing hierarchy information
|
criterion.setDebugLevel( this->parameters_.cpr_solver_verbose_ ); // no debug information, 1 for printing hierarchy information
|
||||||
criterion.setDefaultValuesIsotropic(2);
|
criterion.setDefaultValuesIsotropic(2);
|
||||||
@ -181,7 +182,7 @@ namespace Opm
|
|||||||
//criterion.setAlpha(0.01); // criterion for connection strong 1/3 is default
|
//criterion.setAlpha(0.01); // criterion for connection strong 1/3 is default
|
||||||
//criterion.setMaxLevel(2); //
|
//criterion.setMaxLevel(2); //
|
||||||
//criterion.setGamma(1); // //1 V cycle 2 WW
|
//criterion.setGamma(1); // //1 V cycle 2 WW
|
||||||
|
|
||||||
// Since DUNE 2.2 we also need to pass the smoother args instead of steps directly
|
// Since DUNE 2.2 we also need to pass the smoother args instead of steps directly
|
||||||
typedef typename BlackoilAmgType::Smoother Smoother;
|
typedef typename BlackoilAmgType::Smoother Smoother;
|
||||||
typedef typename BlackoilAmgType::Smoother Smoother;
|
typedef typename BlackoilAmgType::Smoother Smoother;
|
||||||
@ -254,7 +255,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
return this->converged_;
|
return this->converged_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user