move EnableAsyncVtkOutput to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent 4905289325
commit 00c0304fce
3 changed files with 13 additions and 21 deletions

View File

@ -291,13 +291,6 @@ template<class TypeTag>
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = false; };
//! By default, write the VTK output to asynchronously to disk
//!
//! This has only an effect if EnableVtkOutput is true
template<class TypeTag>
struct EnableAsyncVtkOutput<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = true; };
//! Disable grid adaptation by default
template<class TypeTag>
struct EnableGridAdaptation<TypeTag, Properties::TTag::FvBaseDiscretization>

View File

@ -37,6 +37,17 @@ namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct ThreadsPerProcess { using type = Properties::UndefinedProperty; };
/*!
* \brief Determines if the VTK output is written to disk asynchronously
*
* I.e. written to disk using a separate thread. This has only an effect if
* EnableVtkOutput is true and if the simulation is run sequentially. The reasons for
* this not being used for MPI-parallel simulations are that Dune's VTK output code does
* not support multi-threaded multi-process VTK output and even if it would, the result
* would be slower than when using synchronous output.
*/
struct EnableAsyncVtkOutput { static constexpr bool value = true; };
/*!
* \brief Switch to enable or disable grid adaptation
*
@ -61,18 +72,6 @@ struct OutputDir { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct EnableVtkOutput { using type = Properties::UndefinedProperty; };
/*!
* \brief Determines if the VTK output is written to disk asynchronously
*
* I.e. written to disk using a separate thread. This has only an effect if
* EnableVtkOutput is true and if the simulation is run sequentially. The reasons for
* this not being used for MPI-parallel simulations are that Dune's VTK output code does
* not support multi-threaded multi-process VTK output and even if it would, the result
* would be slower than when using synchronous output.
*/
template<class TypeTag, class MyTypeTag>
struct EnableAsyncVtkOutput { using type = Properties::UndefinedProperty; };
/*!
* \brief Specify the maximum size of a time integration [s].
*

View File

@ -142,7 +142,7 @@ public:
if (enableVtkOutput_()) {
bool asyncVtkOutput =
simulator_.gridView().comm().size() == 1 &&
Parameters::get<TypeTag, Parameters::EnableAsyncVtkOutput>();
Parameters::Get<Parameters::EnableAsyncVtkOutput>();
// asynchonous VTK output currently does not work in conjunction with grid
// adaptivity because the async-IO code assumes that the grid stays
@ -176,7 +176,7 @@ public:
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepDivisions>
("The maximum number of divisions by two of the timestep size "
"before the simulation bails out");
Parameters::registerParam<TypeTag, Parameters::EnableAsyncVtkOutput>
Parameters::Register<Parameters::EnableAsyncVtkOutput>
("Dispatch a separate thread to write the VTK output");
Parameters::registerParam<TypeTag, Parameters::ContinueOnConvergenceError>
("Continue with a non-converged solution instead of giving up "