diff --git a/ebos/ebos.hh b/ebos/ebos.hh index 61e8a8e55..bf170393f 100644 --- a/ebos/ebos.hh +++ b/ebos/ebos.hh @@ -118,16 +118,25 @@ SET_SCALAR_PROP(EbosTypeTag, EclNewtonSumTolerance, 1e-5); // make all Newton iterations strict, i.e., the volumetric Newton tolerance must be // always be upheld in the majority of the spatial domain. In this context, "majority" // means 1 - EclNewtonRelaxedVolumeFraction. -SET_INT_PROP(EbosTypeTag, EclNewtonStrictIterations, 100); +template +struct EclNewtonStrictIterations { + static constexpr int value = 100; +}; // set the maximum number of Newton iterations to 8 so that we fail quickly (albeit // relatively often) -SET_INT_PROP(EbosTypeTag, NewtonMaxIterations, 8); +template +struct NewtonMaxIterations { + static constexpr int value = 8; +}; // if openMP is available, set the default the number of threads per process for the main // simulation to 2 (instead of grabbing everything that is available). #if _OPENMP -SET_INT_PROP(EbosTypeTag, ThreadsPerProcess, 2); +template +struct ThreadsPerProcess { + static constexpr int value = 2; +}; #endif // By default, ebos accepts the result of the time integration unconditionally if the diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index a8ea3cdfd..743df5329 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -90,7 +90,10 @@ template struct EclDeckFileName { static constexpr auto value = ""; }; -SET_INT_PROP(EclBaseVanguard, EclOutputInterval, -1); // use the deck-provided value +template +struct EclOutputInterval { + static constexpr int value = -1; +}; template struct EnableOpmRstFile { static constexpr bool value = false; @@ -103,7 +106,10 @@ template struct SchedRestart { static constexpr bool value = false; }; -SET_INT_PROP(EclBaseVanguard, EdgeWeightsMethod, 1); +template +struct EdgeWeightsMethod { + static constexpr int value = 1; +}; template struct OwnerCellsFirst { static constexpr bool value = true; diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 6906405b1..d9585cfac 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -303,7 +303,10 @@ SET_SCALAR_PROP(EclBaseProblem, EclNewtonSumToleranceExponent, 1.0/3.0); // set number of Newton iterations where the volumetric residual is considered for // convergence -SET_INT_PROP(EclBaseProblem, EclNewtonStrictIterations, 8); +template +struct EclNewtonStrictIterations { + static constexpr int value = 8; +}; // set fraction of the pore volume where the volumetric residual may be violated during // strict Newton iterations @@ -317,12 +320,18 @@ SET_SCALAR_PROP(EclBaseProblem, NewtonMaxError, 10e9); // set the maximum number of Newton iterations to 14 because the likelyhood that a time // step succeeds at more than 14 Newton iteration is rather small -SET_INT_PROP(EclBaseProblem, NewtonMaxIterations, 14); +template +struct NewtonMaxIterations { + static constexpr int value = 14; +}; // also, reduce the target for the "optimum" number of Newton iterations to 6. Note that // this is only relevant if the time step is reduced from the report step size for some // reason. (because ebos first tries to do a report step using a single time step.) -SET_INT_PROP(EclBaseProblem, NewtonTargetIterations, 6); +template +struct NewtonTargetIterations { + static constexpr int value = 6; +}; // Disable the VTK output by default for this problem ... template @@ -379,7 +388,10 @@ SET_TYPE_PROP(EclBaseProblem, NewtonMethod, Opm::EclNewtonMethod); // The frequency of writing restart (*.ers) files. This is the number of time steps // between writing restart files -SET_INT_PROP(EclBaseProblem, RestartWritingInterval, 0xffffff); // disable +template +struct RestartWritingInterval { + static constexpr int value = 0xffffff; // disable +}; // Drift compensation is an experimental feature, i.e., systematic errors in the // conservation quantities are only compensated for diff --git a/flow/flow_blackoil_dunecpr.cpp b/flow/flow_blackoil_dunecpr.cpp index ed5dc4a60..0dc589cb2 100644 --- a/flow/flow_blackoil_dunecpr.cpp +++ b/flow/flow_blackoil_dunecpr.cpp @@ -36,9 +36,15 @@ namespace Opm { struct MatrixAddWellContributions { static constexpr bool value = true; }; - SET_INT_PROP(EclFlowProblemSimple, LinearSolverVerbosity,0); + template + struct LinearSolverVerbosity { + static constexpr int value = 0; + }; SET_SCALAR_PROP(EclFlowProblemSimple, LinearSolverReduction, 1e-2); - SET_INT_PROP(EclFlowProblemSimple, LinearSolverMaxIter, 100); + template + struct LinearSolverMaxIter { + static constexpr int value = 100; + }; template struct UseAmg { // probably not used static constexpr bool value = true; @@ -47,10 +53,22 @@ namespace Opm { struct UseCpr { static constexpr bool value = true; }; - SET_INT_PROP(EclFlowProblemSimple, CprMaxEllIter, 1); - SET_INT_PROP(EclFlowProblemSimple, CprEllSolvetype, 3); - SET_INT_PROP(EclFlowProblemSimple, CprReuseSetup, 3); - SET_INT_PROP(EclFlowProblemSimple, CprSolverVerbose, 0); + template + struct CprMaxEllIter { + static constexpr int value = 1; + }; + template + struct CprEllSolvetype { + static constexpr int value = 3; + }; + template + struct CprReuseSetup { + static constexpr int value = 3; + }; + template + struct CprSolverVerbose { + static constexpr int value = 0; + }; template struct LinearSolverConfiguration { static constexpr auto value = "ilu0"; @@ -90,7 +108,10 @@ namespace Opm { static constexpr bool value = true; }; - //SET_INT_PROP(EclFlowProblemSimple, NumWellAdjoint, 1); +// template +// struct NumWellAdjoint { +// static constexpr int value = 1; +// }; // template // struct EnableStorageCache { // static constexpr bool value = true; diff --git a/opm/simulators/flow/BlackoilModelParametersEbos.hpp b/opm/simulators/flow/BlackoilModelParametersEbos.hpp index 9d9334f73..574205a4c 100644 --- a/opm/simulators/flow/BlackoilModelParametersEbos.hpp +++ b/opm/simulators/flow/BlackoilModelParametersEbos.hpp @@ -71,13 +71,19 @@ SET_SCALAR_PROP(FlowModelParameters, ToleranceCnv,1e-2); SET_SCALAR_PROP(FlowModelParameters, ToleranceCnvRelaxed, 1e9); SET_SCALAR_PROP(FlowModelParameters, ToleranceWells, 1e-4); SET_SCALAR_PROP(FlowModelParameters, ToleranceWellControl, 1e-7); -SET_INT_PROP(FlowModelParameters, MaxWelleqIter, 30); +template +struct MaxWelleqIter { + static constexpr int value = 30; +}; template struct UseMultisegmentWell { static constexpr bool value = true; }; SET_SCALAR_PROP(FlowModelParameters, MaxSinglePrecisionDays, 20.0); -SET_INT_PROP(FlowModelParameters, MaxStrictIter, 8); +template +struct MaxStrictIter { + static constexpr int value = 8; +}; template struct SolveWelleqInitially { static constexpr bool value = true; @@ -100,13 +106,22 @@ template struct UseInnerIterationsMsWells { static constexpr bool value = true; }; -SET_INT_PROP(FlowModelParameters, MaxInnerIterMsWells, 100); +template +struct MaxInnerIterMsWells { + static constexpr int value = 100; +}; template struct UseInnerIterationsWells { static constexpr bool value = false; }; -SET_INT_PROP(FlowModelParameters, MaxInnerIterWells, 50); -SET_INT_PROP(FlowModelParameters, StrictInnerIterMsWells, 40); +template +struct MaxInnerIterWells { + static constexpr int value = 50; +}; +template +struct StrictInnerIterMsWells { + static constexpr int value = 40; +}; SET_SCALAR_PROP(FlowModelParameters, RegularizationFactorMsw, 1); template struct EnableWellOperabilityCheck { @@ -118,7 +133,10 @@ SET_SCALAR_PROP(FlowModelParameters, RelaxedPressureTolInnerIterMsw, 0.5e5); // if openMP is available, determine the number threads per process automatically. #if _OPENMP -SET_INT_PROP(FlowModelParameters, ThreadsPerProcess, -1); +template +struct ThreadsPerProcess { + static constexpr int value = -1; +}; #endif } // namespace Opm::Properties diff --git a/opm/simulators/flow/FlowMainEbos.hpp b/opm/simulators/flow/FlowMainEbos.hpp index a458f6a94..bda804ca7 100644 --- a/opm/simulators/flow/FlowMainEbos.hpp +++ b/opm/simulators/flow/FlowMainEbos.hpp @@ -64,7 +64,10 @@ template struct EnableLoggingFalloutWarning { static constexpr bool value = false; }; -SET_INT_PROP(EclFlowProblem, OutputInterval, 1); +template +struct OutputInterval { + static constexpr int value = 1; +}; } // namespace Opm::Properties diff --git a/opm/simulators/flow/NonlinearSolverEbos.hpp b/opm/simulators/flow/NonlinearSolverEbos.hpp index d93d94e81..3ad44fc1c 100644 --- a/opm/simulators/flow/NonlinearSolverEbos.hpp +++ b/opm/simulators/flow/NonlinearSolverEbos.hpp @@ -46,8 +46,14 @@ NEW_PROP_TAG(FlowNewtonMinIterations); NEW_PROP_TAG(NewtonRelaxationType); SET_SCALAR_PROP(FlowNonLinearSolver, NewtonMaxRelax, 0.5); -SET_INT_PROP(FlowNonLinearSolver, FlowNewtonMaxIterations, 20); -SET_INT_PROP(FlowNonLinearSolver, FlowNewtonMinIterations, 1); +template +struct FlowNewtonMaxIterations { + static constexpr int value = 20; +}; +template +struct FlowNewtonMinIterations { + static constexpr int value = 1; +}; template struct NewtonRelaxationType { static constexpr auto value = "dampen"; diff --git a/opm/simulators/linalg/FlowLinearSolverParameters.hpp b/opm/simulators/linalg/FlowLinearSolverParameters.hpp index 352e26f80..63004f083 100644 --- a/opm/simulators/linalg/FlowLinearSolverParameters.hpp +++ b/opm/simulators/linalg/FlowLinearSolverParameters.hpp @@ -75,10 +75,22 @@ NEW_PROP_TAG(OpenclPlatformId); SET_SCALAR_PROP(FlowIstlSolverParams, LinearSolverReduction, 1e-2); SET_SCALAR_PROP(FlowIstlSolverParams, IluRelaxation, 0.9); -SET_INT_PROP(FlowIstlSolverParams, LinearSolverMaxIter, 200); -SET_INT_PROP(FlowIstlSolverParams, LinearSolverRestart, 40); -SET_INT_PROP(FlowIstlSolverParams, FlowLinearSolverVerbosity, 0); -SET_INT_PROP(FlowIstlSolverParams, IluFillinLevel, 0); +template +struct LinearSolverMaxIter { + static constexpr int value = 200; +}; +template +struct LinearSolverRestart { + static constexpr int value = 40; +}; +template +struct FlowLinearSolverVerbosity { + static constexpr int value = 0; +}; +template +struct IluFillinLevel { + static constexpr int value = 0; +}; template struct MiluVariant { static constexpr auto value = "ILU"; @@ -124,14 +136,26 @@ template struct ScaleLinearSystem { static constexpr bool value = false; }; -SET_INT_PROP(FlowIstlSolverParams, CprSolverVerbose, 0); +template +struct CprSolverVerbose { + static constexpr int value = 0; +}; template struct CprUseDrs { static constexpr bool value = false; }; -SET_INT_PROP(FlowIstlSolverParams, CprMaxEllIter, 20); -SET_INT_PROP(FlowIstlSolverParams, CprEllSolvetype, 0); -SET_INT_PROP(FlowIstlSolverParams, CprReuseSetup, 3); +template +struct CprMaxEllIter { + static constexpr int value = 20; +}; +template +struct CprEllSolvetype { + static constexpr int value = 0; +}; +template +struct CprReuseSetup { + static constexpr int value = 3; +}; template struct LinearSolverConfiguration { static constexpr auto value = "ilu0"; @@ -144,8 +168,14 @@ template struct GpuMode { static constexpr auto value = "none"; }; -SET_INT_PROP(FlowIstlSolverParams, BdaDeviceId, 0); -SET_INT_PROP(FlowIstlSolverParams, OpenclPlatformId, 0); +template +struct BdaDeviceId { + static constexpr int value = 0; +}; +template +struct OpenclPlatformId { + static constexpr int value = 0; +}; } // namespace Opm::Properties diff --git a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp index 5391c366c..f7c995dc6 100644 --- a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp @@ -48,9 +48,18 @@ SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverGrowthFactor, 2.0); SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverMaxGrowth, 3.0); SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverMaxTimeStepInDays, 365.0); SET_SCALAR_PROP(FlowTimeSteppingParameters, SolverMinTimeStep, 0.0); -SET_INT_PROP(FlowTimeSteppingParameters, SolverMaxRestarts, 10); -SET_INT_PROP(FlowTimeSteppingParameters, SolverVerbosity, 1); -SET_INT_PROP(FlowTimeSteppingParameters, TimeStepVerbosity, 1); +template +struct SolverMaxRestarts { + static constexpr int value = 10; +}; +template +struct SolverVerbosity { + static constexpr int value = 1; +}; +template +struct TimeStepVerbosity { + static constexpr int value = 1; +}; SET_SCALAR_PROP(FlowTimeSteppingParameters, InitialTimeStepInDays, 1.0); template struct FullTimeStepInitially { @@ -62,8 +71,14 @@ struct TimeStepControl { static constexpr auto value = "pid"; }; SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlTolerance, 1e-1); -SET_INT_PROP(FlowTimeSteppingParameters, TimeStepControlTargetIterations, 30); -SET_INT_PROP(FlowTimeSteppingParameters, TimeStepControlTargetNewtonIterations, 8); +template +struct TimeStepControlTargetIterations { + static constexpr int value = 30; +}; +template +struct TimeStepControlTargetNewtonIterations { + static constexpr int value = 8; +}; SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlDecayRate, 0.75); SET_SCALAR_PROP(FlowTimeSteppingParameters, TimeStepControlGrowthRate, 1.25); template