mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix indenting
This commit is contained in:
parent
111feead14
commit
e05e5e4f0e
@ -77,9 +77,8 @@ Dune::MatrixAdapter<M,X,Y> createOperator(const Dune::MatrixAdapter<M,X,Y>&, con
|
||||
template<class M, class X, class Y, class T>
|
||||
std::unique_ptr< Dune::MatrixAdapter<M,X,Y> > createOperatorPtr(const Dune::MatrixAdapter<M,X,Y>&, const M& matrix, const T&)
|
||||
{
|
||||
return std::make_unique< Dune::MatrixAdapter<M,X,Y> >(matrix);
|
||||
}
|
||||
|
||||
return std::make_unique< Dune::MatrixAdapter<M,X,Y> >(matrix);
|
||||
}
|
||||
/**
|
||||
* \brief Creates an OverlappingSchwarzOperator as an operator.
|
||||
*
|
||||
@ -468,8 +467,8 @@ private:
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6)
|
||||
Dune::LoopSolver<X> solver(const_cast<typename AMGType::Operator&>(op_), *sp, *prec,
|
||||
tolerance, maxit, verbosity);
|
||||
@ -489,9 +488,9 @@ private:
|
||||
tolerance, maxit, verbosity);
|
||||
solver.apply(x,b,res);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ! DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6)
|
||||
delete sp;
|
||||
@ -983,20 +982,19 @@ public:
|
||||
* \param comm The information about the parallelization.
|
||||
*/
|
||||
BlackoilAmg(const CPRParameter& param,
|
||||
const typename TwoLevelMethod::FineDomainType& weights,
|
||||
const typename TwoLevelMethod::FineDomainType& weights,
|
||||
const Operator& fineOperator, const Criterion& criterion,
|
||||
const SmootherArgs& smargs, const Communication& comm)
|
||||
: param_(param),
|
||||
weights_(weights),
|
||||
weights_(weights),
|
||||
scaledMatrixOperator_(Detail::scaleMatrixDRS(fineOperator, comm,
|
||||
COMPONENT_INDEX, weights, param)),
|
||||
COMPONENT_INDEX, weights, param)),
|
||||
smoother_(Detail::constructSmoother<Smoother>(std::get<1>(scaledMatrixOperator_),
|
||||
smargs, comm)),
|
||||
smargs, comm)),
|
||||
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,7 @@ inline void
|
||||
createAMGPreconditionerPointer(Op& opA, const double relax, const P& comm,
|
||||
std::unique_ptr< BlackoilAmg<Op,S,C,P,index> >& amgPtr,
|
||||
const CPRParameter& params,
|
||||
const Vector& weights)
|
||||
const Vector& weights)
|
||||
{
|
||||
using AMG = BlackoilAmg<Op,S,C,P,index>;
|
||||
const int verbosity = ( params.cpr_solver_verbose_ && comm.communicator().rank() == 0 ) ? 1 : 0;
|
||||
|
@ -128,14 +128,14 @@ namespace Opm
|
||||
cpr_ilu_redblack_ = false;
|
||||
cpr_ilu_reorder_sphere_ = true;
|
||||
cpr_max_ell_iter_ = 25;
|
||||
cpr_ell_solvetype_ = 0;
|
||||
cpr_use_drs_ = false;
|
||||
cpr_max_iter_ = 25;
|
||||
cpr_ell_solvetype_ = 0;
|
||||
cpr_use_drs_ = false;
|
||||
cpr_max_iter_ = 25;
|
||||
cpr_use_amg_ = true;
|
||||
cpr_use_bicgstab_ = true;
|
||||
cpr_solver_verbose_ = 0;
|
||||
cpr_pressure_aggregation_ = false;
|
||||
cpr_reuse_setup_ = 0;
|
||||
cpr_reuse_setup_ = 0;
|
||||
}
|
||||
};
|
||||
|
||||
@ -181,14 +181,13 @@ namespace Opm
|
||||
ignoreConvergenceFailure_ = EWOMS_GET_PARAM(TypeTag, bool, LinearSolverIgnoreConvergenceFailure);
|
||||
linear_solver_use_amg_ = EWOMS_GET_PARAM(TypeTag, bool, UseAmg);
|
||||
use_cpr_ = EWOMS_GET_PARAM(TypeTag, bool, UseCpr);
|
||||
system_strategy_ = EWOMS_GET_PARAM(TypeTag, std::string, SystemStrategy);
|
||||
scale_linear_system_ = EWOMS_GET_PARAM(TypeTag, bool, ScaleLinearSystem);
|
||||
cpr_solver_verbose_ = EWOMS_GET_PARAM(TypeTag, int, CprSolverVerbose);
|
||||
cpr_use_drs_ = EWOMS_GET_PARAM(TypeTag, bool, CprUseDrs);
|
||||
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);
|
||||
|
||||
system_strategy_ = EWOMS_GET_PARAM(TypeTag, std::string, SystemStrategy);
|
||||
scale_linear_system_ = EWOMS_GET_PARAM(TypeTag, bool, ScaleLinearSystem);
|
||||
cpr_solver_verbose_ = EWOMS_GET_PARAM(TypeTag, int, CprSolverVerbose);
|
||||
cpr_use_drs_ = EWOMS_GET_PARAM(TypeTag, bool, CprUseDrs);
|
||||
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>
|
||||
@ -208,14 +207,13 @@ namespace Opm
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, LinearSolverIgnoreConvergenceFailure, "Continue with the simulation like nothing happened after the linear solver did not converge");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, UseAmg, "Use AMG as the linear solver's preconditioner");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, UseCpr, "Use CPR as the linear solver's preconditioner");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, std::string, SystemStrategy, "Strategy for reformulating and scale linear system");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, ScaleLinearSystem, "Scale linear system according to equation scale and primary variable types");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, int, CprSolverVerbose, "Verbose for cpr solver");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, CprUseDrs, "Use dynamic row sum using weighs");
|
||||
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");
|
||||
|
||||
EWOMS_REGISTER_PARAM(TypeTag, std::string, SystemStrategy, "Strategy for reformulating and scale linear system");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, ScaleLinearSystem, "Scale linear system according to equation scale and primary variable types");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, int, CprSolverVerbose, "Verbose for cpr solver");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, bool, CprUseDrs, "Use dynamic row sum using weighs");
|
||||
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(); }
|
||||
|
@ -288,23 +288,23 @@ protected:
|
||||
//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,
|
||||
parallelInformation_ );
|
||||
parallelInformation_ );
|
||||
assert( opA.comm() );
|
||||
solve( opA, x, *rhs_, *(opA.comm()) );
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, false > Operator;
|
||||
Operator opA(*matrix_, *matrix_, wellModel);
|
||||
const WellModel& wellModel = simulator_.problem().wellModel();
|
||||
typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, false > Operator;
|
||||
Operator opA(*matrix_, *matrix_, wellModel);
|
||||
solve( opA, x, *rhs_ );
|
||||
}
|
||||
|
||||
if (parameters_.scale_linear_system_) {
|
||||
if (parameters_.scale_linear_system_) {
|
||||
scaleSolution(x);
|
||||
}
|
||||
}
|
||||
|
||||
return converged_;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -404,13 +404,13 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
// 3x3 matrix block inversion was unstable at least 2.3 until and including
|
||||
// 2.5.0. There may still be some issue with the 4x4 matrix block inversion
|
||||
// we therefore still use the block inversion in OPM
|
||||
// 3x3 matrix block inversion was unstable at least 2.3 until and including
|
||||
// 2.5.0. There may still be some issue with the 4x4 matrix block inversion
|
||||
// we therefore still use the block inversion in OPM
|
||||
typedef ParallelOverlappingILU0<Dune::BCRSMatrix<Dune::MatrixBlock<typename Matrix::field_type,
|
||||
Matrix::block_type::rows,
|
||||
Matrix::block_type::cols> >,
|
||||
Vector, Vector> SeqPreconditioner;
|
||||
Matrix::block_type::rows,
|
||||
Matrix::block_type::cols> >,
|
||||
Vector, Vector> SeqPreconditioner;
|
||||
|
||||
|
||||
template <class Operator>
|
||||
@ -833,7 +833,7 @@ protected:
|
||||
std::vector<std::pair<int,std::vector<int>>> overlapRowAndColumns_;
|
||||
FlowLinearSolverParameters parameters_;
|
||||
Vector weights_;
|
||||
bool scale_variables_;
|
||||
bool scale_variables_;
|
||||
}; // end ISTLSolver
|
||||
|
||||
} // namespace Opm
|
||||
|
Loading…
Reference in New Issue
Block a user