From 0d7bba7f4f356093e84edf90bafbf1b3380cab57 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Jul 2024 17:49:51 +0200 Subject: [PATCH] move GroundWaterProblem parameters to TypeTag-free parameter system --- examples/problems/groundwaterproblem.hh | 120 +++++++----------------- 1 file changed, 32 insertions(+), 88 deletions(-) diff --git a/examples/problems/groundwaterproblem.hh b/examples/problems/groundwaterproblem.hh index 2ec50dd7a..28cf81971 100644 --- a/examples/problems/groundwaterproblem.hh +++ b/examples/problems/groundwaterproblem.hh @@ -91,85 +91,29 @@ struct LinearSolverWrapper namespace Opm::Parameters { -template -struct LensLowerLeftX { using type = Properties::UndefinedProperty; }; +template +struct LensLowerLeftX { static constexpr Scalar value = 0.25; }; -template -struct LensLowerLeftY { using type = Properties::UndefinedProperty; }; +template +struct LensLowerLeftY { static constexpr Scalar value = 0.25; }; -template -struct LensLowerLeftZ { using type = Properties::UndefinedProperty; }; +template +struct LensLowerLeftZ { static constexpr Scalar value = 0.25; }; -template -struct LensUpperRightX { using type = Properties::UndefinedProperty; }; +template +struct LensUpperRightX { static constexpr Scalar value = 0.75; }; -template -struct LensUpperRightY { using type = Properties::UndefinedProperty; }; +template +struct LensUpperRightY { static constexpr Scalar value = 0.75; }; -template -struct LensUpperRightZ { using type = Properties::UndefinedProperty; }; +template +struct LensUpperRightZ { static constexpr Scalar value = 0.75; }; -template -struct Permeability { using type = Properties::UndefinedProperty; }; +template +struct Permeability { static constexpr Scalar value = 1e-10; }; -template -struct PermeabilityLens { using type = Properties::UndefinedProperty; }; - -template -struct LensLowerLeftX -{ - using type = GetPropType; - static constexpr type value = 0.25; -}; - -template -struct LensLowerLeftY -{ - using type = GetPropType; - static constexpr type value = 0.25; -}; - -template -struct LensLowerLeftZ -{ - using type = GetPropType; - static constexpr type value = 0.25; -}; - -template -struct LensUpperRightX -{ - using type = GetPropType; - static constexpr type value = 0.75; -}; - -template -struct LensUpperRightY -{ - using type = GetPropType; - static constexpr type value = 0.75; -}; - -template -struct LensUpperRightZ -{ - using type = GetPropType; - static constexpr type value = 0.75; -}; - -template -struct Permeability -{ - using type = GetPropType; - static constexpr type value = 1e-10; -}; - -template -struct PermeabilityLens -{ - using type = GetPropType; - static constexpr type value = 1e-12; -}; +template +struct PermeabilityLens { static constexpr Scalar value = 1e-12; }; } // namespace Opm::Parameters @@ -237,20 +181,20 @@ public: eps_ = 1.0e-3; - lensLowerLeft_[0] = Parameters::get(); + lensLowerLeft_[0] = Parameters::Get>(); if (dim > 1) - lensLowerLeft_[1] = Parameters::get(); + lensLowerLeft_[1] = Parameters::Get>(); if (dim > 2) - lensLowerLeft_[2] = Parameters::get(); + lensLowerLeft_[2] = Parameters::Get>(); - lensUpperRight_[0] = Parameters::get(); + lensUpperRight_[0] = Parameters::Get>(); if (dim > 1) - lensUpperRight_[1] = Parameters::get(); + lensUpperRight_[1] = Parameters::Get>(); if (dim > 2) - lensUpperRight_[2] = Parameters::get(); + lensUpperRight_[2] = Parameters::Get>(); - intrinsicPerm_ = this->toDimMatrix_(Parameters::get()); - intrinsicPermLens_ = this->toDimMatrix_(Parameters::get()); + intrinsicPerm_ = this->toDimMatrix_(Parameters::Get>()); + intrinsicPermLens_ = this->toDimMatrix_(Parameters::Get>()); } /*! @@ -260,28 +204,28 @@ public: { ParentType::registerParameters(); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The x-coordinate of the lens' upper-right corner [m]."); if (dimWorld > 1) { - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' lower-left corner [m]."); - Parameters::registerParam + Parameters::Register> ("The y-coordinate of the lens' upper-right corner [m]."); } if (dimWorld > 2) { - 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]."); } - Parameters::registerParam + Parameters::Register> ("The intrinsic permeability [m^2] of the ambient material."); - Parameters::registerParam + Parameters::Register> ("The intrinsic permeability [m^2] of the lens."); Parameters::SetDefault("./data/groundwater_2d.dgf");