From 9a572e1c169a4d00b5cbc8cd4a36566c5a148a7c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move LensProblem parameters to TypeTag-free parameter system --- examples/problems/lensproblem.hh | 92 +++++++++----------------------- 1 file changed, 25 insertions(+), 67 deletions(-) diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index f06d01b16..3517005c2 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -124,67 +125,24 @@ public: namespace Opm::Parameters { -// declare the properties specific for the lens problem -template -struct LensLowerLeftX { using type = Properties::UndefinedProperty; }; - -template -struct LensLowerLeftY { using type = Properties::UndefinedProperty; }; - -template -struct LensLowerLeftZ { using type = Properties::UndefinedProperty; }; - -template -struct LensUpperRightX { using type = Properties::UndefinedProperty; }; - -template -struct LensUpperRightY { using type = Properties::UndefinedProperty; }; - -template -struct LensUpperRightZ { using type = Properties::UndefinedProperty; }; - // define the properties specific for the lens problem -template -struct LensLowerLeftX -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; +template +struct LensLowerLeftX { static constexpr Scalar value = 1.0; }; -template -struct LensLowerLeftY -{ - using type = GetPropType; - static constexpr type value = 2.0; -}; +template +struct LensLowerLeftY { static constexpr Scalar value = 2.0; }; -template -struct LensLowerLeftZ -{ - using type = GetPropType; - static constexpr type value = 0.0; -}; +template +struct LensLowerLeftZ { static constexpr Scalar value = 0.0; }; -template -struct LensUpperRightX -{ - using type = GetPropType; - static constexpr type value = 4.0; -}; +template +struct LensUpperRightX { static constexpr Scalar value = 4.0; }; -template -struct LensUpperRightY -{ - using type = GetPropType; - static constexpr type value = 3.0; -}; +template +struct LensUpperRightY { static constexpr Scalar value = 3.0; }; -template -struct LensUpperRightZ -{ - using type = GetPropType; - static constexpr type value = 1.0; -}; +template +struct LensUpperRightZ { static constexpr Scalar value = 1.0; }; } // namespace Opm::Parameters @@ -274,14 +232,14 @@ public: FluidSystem::init(); temperature_ = 273.15 + 20; // -> 20°C - lensLowerLeft_[0] = Parameters::get(); - lensLowerLeft_[1] = Parameters::get(); - lensUpperRight_[0] = Parameters::get(); - lensUpperRight_[1] = Parameters::get(); + lensLowerLeft_[0] = Parameters::Get>(); + lensLowerLeft_[1] = Parameters::Get>(); + lensUpperRight_[0] = Parameters::Get>(); + lensUpperRight_[1] = Parameters::Get>(); if constexpr (dim == 3) { - lensLowerLeft_[2] = Parameters::get(); - lensUpperRight_[2] = Parameters::get(); + lensLowerLeft_[2] = Parameters::Get>(); + lensUpperRight_[2] = Parameters::Get>(); } // residual saturations @@ -315,19 +273,19 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' upper-right corner [m]."); - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' upper-right corner [m]."); if constexpr (dim == 3) { - Parameters::registerParam + Parameters::Register> ("The z-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The z-coordinate of the lens' upper-right corner [m]."); }