mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use cpr if requested in RUNSPEC section of data file.
Can be overwritten using command line parameter `--linear-solver=...`.
This commit is contained in:
parent
11c0e085f9
commit
b67388e6f0
@ -238,7 +238,7 @@ namespace Opm
|
|||||||
bool opencl_ilu_parallel_;
|
bool opencl_ilu_parallel_;
|
||||||
|
|
||||||
template <class TypeTag>
|
template <class TypeTag>
|
||||||
void init()
|
void init(bool cprRequestedInDataFile)
|
||||||
{
|
{
|
||||||
// TODO: these parameters have undocumented non-trivial dependencies
|
// TODO: these parameters have undocumented non-trivial dependencies
|
||||||
linear_solver_reduction_ = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction);
|
linear_solver_reduction_ = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction);
|
||||||
@ -255,7 +255,13 @@ namespace Opm
|
|||||||
scale_linear_system_ = EWOMS_GET_PARAM(TypeTag, bool, ScaleLinearSystem);
|
scale_linear_system_ = EWOMS_GET_PARAM(TypeTag, bool, ScaleLinearSystem);
|
||||||
cpr_reuse_setup_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseSetup);
|
cpr_reuse_setup_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseSetup);
|
||||||
cpr_reuse_interval_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseInterval);
|
cpr_reuse_interval_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseInterval);
|
||||||
linsolver_ = EWOMS_GET_PARAM(TypeTag, std::string, LinearSolver);
|
|
||||||
|
if (!EWOMS_PARAM_IS_SET(TypeTag, int, LinearSolverMaxIter) && cprRequestedInDataFile) {
|
||||||
|
linsolver_ = "cpr";
|
||||||
|
} else {
|
||||||
|
linsolver_ = EWOMS_GET_PARAM(TypeTag, std::string, LinearSolver);
|
||||||
|
}
|
||||||
|
|
||||||
accelerator_mode_ = EWOMS_GET_PARAM(TypeTag, std::string, AcceleratorMode);
|
accelerator_mode_ = EWOMS_GET_PARAM(TypeTag, std::string, AcceleratorMode);
|
||||||
bda_device_id_ = EWOMS_GET_PARAM(TypeTag, int, BdaDeviceId);
|
bda_device_id_ = EWOMS_GET_PARAM(TypeTag, int, BdaDeviceId);
|
||||||
opencl_platform_id_ = EWOMS_GET_PARAM(TypeTag, int, OpenclPlatformId);
|
opencl_platform_id_ = EWOMS_GET_PARAM(TypeTag, int, OpenclPlatformId);
|
||||||
|
@ -241,7 +241,7 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
|||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
comm_.reset( new CommunicationType( simulator_.vanguard().grid().comm() ) );
|
comm_.reset( new CommunicationType( simulator_.vanguard().grid().comm() ) );
|
||||||
#endif
|
#endif
|
||||||
parameters_.template init<TypeTag>();
|
parameters_.template init<TypeTag>(simulator_.vanguard().eclState().getSimulationConfig().useCPR());
|
||||||
prm_ = setupPropertyTree(parameters_,
|
prm_ = setupPropertyTree(parameters_,
|
||||||
EWOMS_PARAM_IS_SET(TypeTag, int, LinearSolverMaxIter),
|
EWOMS_PARAM_IS_SET(TypeTag, int, LinearSolverMaxIter),
|
||||||
EWOMS_PARAM_IS_SET(TypeTag, double, LinearSolverReduction));
|
EWOMS_PARAM_IS_SET(TypeTag, double, LinearSolverReduction));
|
||||||
|
Loading…
Reference in New Issue
Block a user