diff --git a/exercises/exercise-properties/mylocalresidual.hh b/exercises/exercise-properties/mylocalresidual.hh index 2ff017f168d1837a7b28cb41695a66e931d9f760..c723184d30947e90fb3c4b8679ed774afc4cf359 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 de08d526cce8540bef4c7db8c48adef6aa0bd4ef..529740f5676b90dd42d6968f795f22863726a045 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 fc7d3847cfee1d9cb2618c283cd0f288264c341d..e35ad5a5b397af23000ccbe4c51246c9a1bb7ba6 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 52ea56d3adf2f465b298e97879afb62c986578dd..92c1cdcf1c26276c04ec2fd9a9718ef1aa17febe 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)