mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ebos: make it possible to disable the debug-mode conservativeness check
this check produces some output on the terminal which may be undesireable in some cases (i.e., flow_ebos).
This commit is contained in:
parent
98cfa30f92
commit
4f539c0d4d
@ -106,6 +106,11 @@ NEW_PROP_TAG(RestartWritingInterval);
|
|||||||
// Disable well treatment (for users which do this externally)
|
// Disable well treatment (for users which do this externally)
|
||||||
NEW_PROP_TAG(DisableWells);
|
NEW_PROP_TAG(DisableWells);
|
||||||
|
|
||||||
|
// Enable the additional checks even if compiled in debug mode (i.e., with the NDEBUG
|
||||||
|
// macro undefined). Next to a slightly better performance, this also eliminates some
|
||||||
|
// print statements in debug mode.
|
||||||
|
NEW_PROP_TAG(EnableDebuggingChecks);
|
||||||
|
|
||||||
// Set the problem property
|
// Set the problem property
|
||||||
SET_TYPE_PROP(EclBaseProblem, Problem, Ewoms::EclProblem<TypeTag>);
|
SET_TYPE_PROP(EclBaseProblem, Problem, Ewoms::EclProblem<TypeTag>);
|
||||||
|
|
||||||
@ -203,6 +208,9 @@ SET_INT_PROP(EclBaseProblem, RestartWritingInterval, 0xffffff); // disable
|
|||||||
// By default, ebos should handle the wells internally, so we don't disable the well
|
// By default, ebos should handle the wells internally, so we don't disable the well
|
||||||
// treatment
|
// treatment
|
||||||
SET_INT_PROP(EclBaseProblem, DisableWells, false);
|
SET_INT_PROP(EclBaseProblem, DisableWells, false);
|
||||||
|
|
||||||
|
// By default, we enable the debugging checks if we're compiled in debug mode
|
||||||
|
SET_INT_PROP(EclBaseProblem, EnableDebuggingChecks, true);
|
||||||
} // namespace Properties
|
} // namespace Properties
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -442,11 +450,13 @@ public:
|
|||||||
void endTimeStep()
|
void endTimeStep()
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// in debug mode, we don't care about performance, so we check if the model does
|
if (GET_PROP_VALUE(TypeTag, EnableDebuggingChecks)) {
|
||||||
// the right thing (i.e., the mass change inside the whole reservoir must be
|
// in debug mode, we don't care about performance, so we check if the model does
|
||||||
// equivalent to the fluxes over the grid's boundaries plus the source rates
|
// the right thing (i.e., the mass change inside the whole reservoir must be
|
||||||
// specified by the problem)
|
// equivalent to the fluxes over the grid's boundaries plus the source rates
|
||||||
this->model().checkConservativeness(/*tolerance=*/-1, /*verbose=*/true);
|
// specified by the problem)
|
||||||
|
this->model().checkConservativeness(/*tolerance=*/-1, /*verbose=*/true);
|
||||||
|
}
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
|
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user