mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
commit
81ba405f26
@ -79,7 +79,6 @@ std::unique_ptr< Dune::MatrixAdapter<M,X,Y> > createOperatorPtr(const Dune::Matr
|
||||
{
|
||||
return std::make_unique< Dune::MatrixAdapter<M,X,Y> >(matrix);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Creates an OverlappingSchwarzOperator as an operator.
|
||||
*
|
||||
@ -119,13 +118,9 @@ scaleMatrixDRS(const Operator& op, const Communication& comm,
|
||||
for (auto j = (*i).begin(); j != endj; ++j) {
|
||||
BlockVector bvec(0.0);
|
||||
Block& block = *j;
|
||||
for (std::size_t ii = 0; ii < Block::rows; ii++) {
|
||||
for (std::size_t jj = 0; jj < Block::cols; jj++) {
|
||||
// should introduce limmits which also change the weights
|
||||
bvec[jj] += bw[ii]*block[ii][jj];
|
||||
}
|
||||
}
|
||||
block[pressureIndex] = bvec;
|
||||
BlockVector& bvec = block[pressureIndex];
|
||||
// should introduce limits which also change the weights
|
||||
block.mtv(bw, bvec);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -144,13 +139,9 @@ void scaleVectorDRS(Vector& vector, std::size_t pressureIndex, const Opm::CPRPar
|
||||
using Block = typename Vector::block_type;
|
||||
if (param.cpr_use_drs_) {
|
||||
for (std::size_t j = 0; j < vector.size(); ++j) {
|
||||
double val(0.0);
|
||||
Block& block = vector[j];
|
||||
const Block& bw = weights[j];
|
||||
for (std::size_t i = 0; i < Block::dimension; i++) {
|
||||
val += bw[i]*block[i];
|
||||
}
|
||||
block[pressureIndex] = val;
|
||||
block[pressureIndex] = bw.dot(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -995,8 +986,7 @@ public:
|
||||
levelTransferPolicy_(criterion, comm, param.cpr_pressure_aggregation_),
|
||||
coarseSolverPolicy_(¶m, smargs, criterion),
|
||||
twoLevelMethod_(std::get<1>(scaledMatrixOperator_), smoother_,
|
||||
levelTransferPolicy_,
|
||||
coarseSolverPolicy_, 0, 1)
|
||||
levelTransferPolicy_, coarseSolverPolicy_, 0, 1)
|
||||
{}
|
||||
|
||||
void pre(typename TwoLevelMethod::FineDomainType& x,
|
||||
|
@ -188,7 +188,6 @@ namespace Opm
|
||||
cpr_max_iter_ = EWOMS_GET_PARAM(TypeTag, int, CprMaxIter);
|
||||
cpr_ell_solvetype_ = EWOMS_GET_PARAM(TypeTag, int, CprEllSolvetype);
|
||||
cpr_reuse_setup_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseSetup);
|
||||
|
||||
}
|
||||
|
||||
template <class TypeTag>
|
||||
@ -215,7 +214,6 @@ namespace Opm
|
||||
EWOMS_REGISTER_PARAM(TypeTag, int, CprMaxIter, "MaxIterations of the pressure amg solver");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, int, CprEllSolvetype, "solver type of elliptic solve 0 bicgstab 1 cg other only amg preconditioner");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, int, CprReuseSetup, "Reuse Amg Setup");
|
||||
|
||||
}
|
||||
|
||||
FlowLinearSolverParameters() { reset(); }
|
||||
|
@ -253,6 +253,10 @@ protected:
|
||||
parameters_.cpr_use_drs_ = false;
|
||||
}
|
||||
} else {
|
||||
if (parameters_.use_cpr_ && parameters_.cpr_use_drs_) {
|
||||
OpmLog::warning("DRS_DISABLE", "Disabling DRS as matrix does not contain well contributions");
|
||||
}
|
||||
parameters_.cpr_use_drs_ = false;
|
||||
if (parameters_.scale_linear_system_) {
|
||||
// also scale weights
|
||||
this->scaleEquationsAndVariables(weights_);
|
||||
@ -294,6 +298,7 @@ protected:
|
||||
}
|
||||
else
|
||||
{
|
||||
const WellModel& wellModel = simulator_.problem().wellModel();
|
||||
typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, false > Operator;
|
||||
Operator opA(*matrix_, *matrix_, wellModel);
|
||||
solve( opA, x, *rhs_ );
|
||||
@ -304,7 +309,6 @@ protected:
|
||||
}
|
||||
|
||||
return converged_;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -303,13 +303,8 @@ void runBlackoilAmgLaplace()
|
||||
smootherArgs.iterations = 1;
|
||||
Opm::CPRParameter param;
|
||||
|
||||
Vector weights(b.size());
|
||||
for (auto& elem : weights) {
|
||||
elem = 1.0;
|
||||
}
|
||||
|
||||
Opm::BlackoilAmg<Operator,ParSmoother,Criterion,Communication,0> amg(param,
|
||||
weights,
|
||||
{},
|
||||
fop, criterion,
|
||||
smootherArgs,
|
||||
comm);
|
||||
|
Loading…
Reference in New Issue
Block a user