move Cells(X|Y|Z) to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving
2024-07-05 17:49:51 +02:00
parent ac4c723da7
commit 25aed6d79a
10 changed files with 128 additions and 120 deletions

View File

@@ -124,19 +124,6 @@ public:
namespace Opm::Parameters {
// // define the number of cells used for discretizing the physical domain
template<class TypeTag>
struct CellsX<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr unsigned value = 100; };
template<class TypeTag>
struct CellsY<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr unsigned value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr unsigned value = 1; }; /*@\label{tutorial1:default-params-end}@*/
// define the physical size of the problem's domain [m]
template<class TypeTag>
struct DomainSizeX<TypeTag, Properties::TTag::Tutorial1Problem>
@@ -193,7 +180,10 @@ class Tutorial1Problem
using GridView = GetPropType<TypeTag, Properties::GridView>;
// Grid dimension
enum { dimWorld = GridView::dimensionworld };
enum {
dim = GridView::dimension,
dimWorld = GridView::dimensionworld
};
// The type of the intrinsic permeability tensor
using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
@@ -247,6 +237,21 @@ public:
materialParams_.finalize();
}
/*!
* \copydoc FvBaseMultiPhaseProblem::registerParameters
*/
static void registerParameters()
{
ParentType::registerParameters();
Parameters::SetDefault<Parameters::CellsX>(100);
Parameters::SetDefault<Parameters::CellsY>(1);
if constexpr (dim == 3) {
Parameters::SetDefault<Parameters::CellsZ>(1);
}
}
//! Specifies the problem name. This is used for files generated by the simulation.
std::string name() const
{ return "tutorial1"; }