From cb2e8714d3076ade0d79edd3450e78561278dae0 Mon Sep 17 00:00:00 2001
From: IvBu <ivan.buntic@iws.uni-stuttgart.de>
Date: Fri, 28 Feb 2025 14:56:16 +0100
Subject: [PATCH] Use DiscretizationDefaultLocalOperator.

---
 exercises/exercise-properties/mylocalresidual.hh       | 10 ++++++----
 exercises/solution/exercise-model/model.hh             |  8 +++++---
 .../solution/exercise-properties/mylocalresidual.hh    | 10 ++++++----
 slides/model.md                                        |  6 +++---
 4 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/exercises/exercise-properties/mylocalresidual.hh b/exercises/exercise-properties/mylocalresidual.hh
index 2ff017f1..c723184d 100644
--- a/exercises/exercise-properties/mylocalresidual.hh
+++ b/exercises/exercise-properties/mylocalresidual.hh
@@ -15,6 +15,7 @@
 
 #include <dumux/common/properties.hh>
 #include <dumux/common/numeqvector.hh>
+#include <dumux/discretization/defaultlocaloperator.hh>
 
 namespace Dumux
 {
@@ -24,9 +25,10 @@ namespace Dumux
  *        using the n-phase immiscible fully implicit models.
  */
 template<class TypeTag>
-class MyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual>
+class MyLocalResidual : public DiscretizationDefaultLocalOperator<TypeTag>
 {
-    using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>;
+    using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
+    using ParentType = DiscretizationDefaultLocalOperator<TypeTag>;
     using Scalar = GetPropType<TypeTag, Properties::Scalar>;
     using Problem = GetPropType<TypeTag, Properties::Problem>;
     using NumEqVector = Dumux::NumEqVector<GetPropType<TypeTag, Properties::PrimaryVariables>>;
@@ -34,10 +36,10 @@ class MyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidua
     using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
     using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>;
     using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
-    using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
+    using FVElementGeometry = typename GridGeometry::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
-    using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
+    using GridView = typename GridGeometry::GridView;
     using Element = typename GridView::template Codim<0>::Entity;
     using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>;
 
diff --git a/exercises/solution/exercise-model/model.hh b/exercises/solution/exercise-model/model.hh
index de08d526..529740f5 100644
--- a/exercises/solution/exercise-model/model.hh
+++ b/exercises/solution/exercise-model/model.hh
@@ -17,6 +17,7 @@
 #include <dumux/common/numeqvector.hh>
 #include <dumux/common/volumevariables.hh>
 #include <dumux/discretization/method.hh>
+#include <dumux/discretization/defaultlocaloperator.hh>
 
 // The property tag is simply an empty struct with the name `NonlinearDiffusionModel`
 namespace Dumux::Properties::TTag {
@@ -75,9 +76,11 @@ private:
  */
 template<class TypeTag>
 class NonlinearDiffusionModelLocalResidual
-: public GetPropType<TypeTag, Properties::BaseLocalResidual>
+: public DiscretizationDefaultLocalOperator<TypeTag>
 {
-    using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>;
+    using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
+    using ParentType = DiscretizationDefaultLocalOperator<TypeTag>;
+
     using Scalar = GetPropType<TypeTag, Properties::Scalar>;
     using Problem = GetPropType<TypeTag, Properties::Problem>;
     using NumEqVector = Dumux::NumEqVector<GetPropType<TypeTag, Properties::PrimaryVariables>>;
@@ -87,7 +90,6 @@ class NonlinearDiffusionModelLocalResidual
     using ElementVolumeVariables = typename GridVariables::GridVolumeVariables::LocalView;
     using ElementFluxVariablesCache = typename GridVariables::GridFluxVariablesCache::LocalView;
 
-    using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
     using FVElementGeometry = typename GridGeometry::LocalView;
     using SubControlVolume = typename GridGeometry::SubControlVolume;
     using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
diff --git a/exercises/solution/exercise-properties/mylocalresidual.hh b/exercises/solution/exercise-properties/mylocalresidual.hh
index fc7d3847..e35ad5a5 100644
--- a/exercises/solution/exercise-properties/mylocalresidual.hh
+++ b/exercises/solution/exercise-properties/mylocalresidual.hh
@@ -15,6 +15,7 @@
 
 #include <dumux/common/properties.hh>
 #include <dumux/common/numeqvector.hh>
+#include <dumux/discretization/defaultlocaloperator.hh>
 
 namespace Dumux
 {
@@ -24,9 +25,10 @@ namespace Dumux
  *        using the n-phase immiscible fully implicit models.
  */
 template<class TypeTag>
-class MyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual>
+class MyLocalResidual : public DiscretizationDefaultLocalOperator<TypeTag>
 {
-    using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>;
+    using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
+    using ParentType = DiscretizationDefaultLocalOperator<TypeTag>;
     using Scalar = GetPropType<TypeTag, Properties::Scalar>;
     using Problem = GetPropType<TypeTag, Properties::Problem>;
     using NumEqVector = Dumux::NumEqVector<GetPropType<TypeTag, Properties::PrimaryVariables>>;
@@ -34,10 +36,10 @@ class MyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidua
     using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
     using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>;
     using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
-    using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
+    using FVElementGeometry = typename GridGeometry::LocalView;
     using SubControlVolume = typename FVElementGeometry::SubControlVolume;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
-    using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
+    using GridView = typename GridGeometry::GridView;
     using Element = typename GridView::template Codim<0>::Entity;
     using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>;
 
diff --git a/slides/model.md b/slides/model.md
index 52ea56d3..92c1cdcf 100644
--- a/slides/model.md
+++ b/slides/model.md
@@ -94,14 +94,14 @@ The local residual of the diffusion model:
 ```cpp
 template<class TypeTag>
 class DiffusionModelLocalResidual
-: public GetPropType<TypeTag, Properties::BaseLocalResidual>
+: public DiscretizationDefaultLocalOperator<TypeTag>
 {
     ...
 }
 ```
 <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span>
 
-Inherits from the `BaseLocalResidual`, which is chosen depending on the discretization scheme, here *Box scheme*.
+Inherits from the `DiscretizationDefaultLocalOperator`, which is chosen depending on the discretization scheme, here *Box scheme*.
 
 ## Storage term
 ```cpp
@@ -268,4 +268,4 @@ Implementation of a **nonlinear diffusion model** for denoising of an MRI image
 - Use model in test case
 - Customize volume variables
 
-* Go to [Model excercise](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/tree/master/exercises/exercise-model#exercise-model-dumux-course)
\ No newline at end of file
+* Go to [Model excercise](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/tree/master/exercises/exercise-model#exercise-model-dumux-course)
-- 
GitLab