diff --git a/CHANGELOG.md b/CHANGELOG.md index 496998179e0b5d9158c0c2f058abaddba41273ab..0e91d76c92abe09f34ee163c1e4ed5c0c3b2f955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ be evaluated with the function values provided in the same order as the names wh ### Immediate interface changes not allowing/requiring a deprecation period: - __Newton__: The Newton solver no longer supports linear solvers without a `norm` interface when computing the resisual norm is required. The linear solvers available in Dumux all have such an interface. +- __MultiDomain__: The MDTraits are now required to state the LocalResidual type in the Subdomain policy (see multidomain/traits.hh). This only affects users that created their own MDTraits and don't use the default MDTraits. ### Deprecated properties/classes/functions/files, to be removed after 3.8: diff --git a/dumux/assembly/cvfelocalassembler.hh b/dumux/assembly/cvfelocalassembler.hh index e6bcf1fbe82e10e7e41b918431a5f1641633cdc2..a057f660c233821e51004631582e23f99f760954 100644 --- a/dumux/assembly/cvfelocalassembler.hh +++ b/dumux/assembly/cvfelocalassembler.hh @@ -326,7 +326,7 @@ class CVFELocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/t public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; @@ -475,7 +475,7 @@ class CVFELocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/f public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; @@ -584,7 +584,7 @@ class CVFELocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/ public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; @@ -704,7 +704,7 @@ class CVFELocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*implicit=*/ public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; diff --git a/dumux/assembly/fclocalassembler.hh b/dumux/assembly/fclocalassembler.hh index 54c0ec0bef130818c309720cce3c2dfe9c9606f2..10a9ce1408b5f0437e99082dfdf96fc87ec2cc8a 100644 --- a/dumux/assembly/fclocalassembler.hh +++ b/dumux/assembly/fclocalassembler.hh @@ -313,7 +313,7 @@ class FaceCenteredLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*impl public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; @@ -521,7 +521,7 @@ class FaceCenteredLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*impl enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; @@ -633,7 +633,7 @@ class FaceCenteredLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*imp enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; @@ -756,7 +756,7 @@ class FaceCenteredLocalAssembler<TypeTag, Assembler, DiffMethod::analytic, /*imp enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; using ElementResidualVector = typename LocalResidual::ElementResidualVector; using ParentType::ParentType; diff --git a/dumux/assembly/fvlocalassemblerbase.hh b/dumux/assembly/fvlocalassemblerbase.hh index c26cec659124d9742dea2d8c631b5d6deb0933d8..51790248bc09fdd65cac3558228c79dd5a5167f3 100644 --- a/dumux/assembly/fvlocalassemblerbase.hh +++ b/dumux/assembly/fvlocalassemblerbase.hh @@ -52,7 +52,7 @@ class FVLocalAssemblerBase static constexpr auto numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq(); public: - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = std::decay_t<decltype(std::declval<Assembler>().localResidual())>; using ElementResidualVector = typename LocalResidual::ElementResidualVector; /*! diff --git a/dumux/geomechanics/poroelastic/couplingmanager.hh b/dumux/geomechanics/poroelastic/couplingmanager.hh index bfcf73137d7fa48dd5fa5a2feab397c87758c0ac..4d1da76a8d8ada5536a5e0515f03b413b114c394 100644 --- a/dumux/geomechanics/poroelastic/couplingmanager.hh +++ b/dumux/geomechanics/poroelastic/couplingmanager.hh @@ -47,7 +47,6 @@ class PoroMechanicsCouplingManager : public virtual CouplingManager< MDTraits > // further types specific to the sub-problems template<std::size_t id> using Scalar = GetPropType<SubDomainTypeTag<id>, Properties::Scalar>; template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; - template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using PrimaryVariables = typename GridVariables<id>::PrimaryVariables; template<std::size_t id> using GridVolumeVariables = typename GridVariables<id>::GridVolumeVariables; @@ -293,11 +292,10 @@ public: * and the storage term here. */ template< class PMFlowLocalAssembler > - typename LocalResidual<PMFlowId>::ElementResidualVector - evalCouplingResidual(Dune::index_constant<PMFlowId> pmFlowDomainId, - const PMFlowLocalAssembler& pmFlowLocalAssembler, - Dune::index_constant<PoroMechId> poroMechDomainId, - GridIndexType<PoroMechId> dofIdxGlobalJ) + auto evalCouplingResidual(Dune::index_constant<PMFlowId> pmFlowDomainId, + const PMFlowLocalAssembler& pmFlowLocalAssembler, + Dune::index_constant<PoroMechId> poroMechDomainId, + GridIndexType<PoroMechId> dofIdxGlobalJ) { auto res = pmFlowLocalAssembler.localResidual().evalFluxAndSource(pmFlowLocalAssembler.element(), pmFlowLocalAssembler.fvGeometry(), @@ -322,11 +320,10 @@ public: * the fluxes as well as the source term here. */ template< class PoroMechLocalAssembler > - typename LocalResidual<PoroMechId>::ElementResidualVector - evalCouplingResidual(Dune::index_constant<PoroMechId> poroMechDomainId, - const PoroMechLocalAssembler& poroMechLocalAssembler, - Dune::index_constant<PMFlowId> pmFlowDomainId, - GridIndexType<PMFlowId> dofIdxGlobalJ) + auto evalCouplingResidual(Dune::index_constant<PoroMechId> poroMechDomainId, + const PoroMechLocalAssembler& poroMechLocalAssembler, + Dune::index_constant<PMFlowId> pmFlowDomainId, + GridIndexType<PMFlowId> dofIdxGlobalJ) { return poroMechLocalAssembler.localResidual().evalFluxAndSource(poroMechLocalAssembler.element(), poroMechLocalAssembler.fvGeometry(), diff --git a/dumux/multidomain/facet/box/couplingmanager.hh b/dumux/multidomain/facet/box/couplingmanager.hh index 2e79e1f8b8161a436910f29037f9cd5fb3861bdf..dbfe8ab4d49885239991fe0d65b2fe73b24b44b1 100644 --- a/dumux/multidomain/facet/box/couplingmanager.hh +++ b/dumux/multidomain/facet/box/couplingmanager.hh @@ -55,7 +55,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; template<std::size_t id> using NumEqVector = Dumux::NumEqVector<PrimaryVariables<id>>; template<std::size_t id> using ElementBoundaryTypes = GetPropType<SubDomainTypeTag<id>, Properties::ElementBoundaryTypes>; - template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; + template<std::size_t id> using LocalResidual = typename MDTraits::template SubDomain<id>::LocalResidual; template<std::size_t id> using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>; template<std::size_t id> using FVElementGeometry = typename GridGeometry<id>::LocalView; diff --git a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh index 056e342116a4b4d28358c2533f3edac61fe56e51..4421089b69198fe753561a490dcb1c2e6c7690fa 100644 --- a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh +++ b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh @@ -65,7 +65,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using GridView = typename GridGeometry<id>::GridView; template<std::size_t id> using GridIndexType = typename IndexTraits< GridView<id> >::GridIndex; template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity; - template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; + template<std::size_t id> using LocalResidual = typename MDTraits::template SubDomain<id>::LocalResidual; template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; template<std::size_t id> using GridVolumeVariables = typename GridVariables<id>::GridVolumeVariables; diff --git a/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh index 362d5156c853d4c60d096e37f60b98512df6779c..fc9a2f2fe5c948d4a1133b2a251267b9f356c3fe 100644 --- a/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh +++ b/dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh @@ -55,7 +55,7 @@ class FacetCouplingManager<MDTraits, CouplingMapper, bulkDomainId, lowDimDomainI template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; template<std::size_t id> using NumEqVector = Dumux::NumEqVector<PrimaryVariables<id>>; - template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; + template<std::size_t id> using LocalResidual = typename MDTraits::template SubDomain<id>::LocalResidual; template<std::size_t id> using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>; template<std::size_t id> using FVElementGeometry = typename GridGeometry<id>::LocalView; diff --git a/dumux/multidomain/facet/couplingmanager.hh b/dumux/multidomain/facet/couplingmanager.hh index 8bfbc9a0298e6368eff8cd21176c22cc37813d55..da7122e8981caa33df4f93ff149aa42ee4c78adf 100644 --- a/dumux/multidomain/facet/couplingmanager.hh +++ b/dumux/multidomain/facet/couplingmanager.hh @@ -118,7 +118,6 @@ class FacetCouplingThreeDomainManager template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag; // further types specific to the sub-problems - template<std::size_t id> using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>; template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; @@ -257,13 +256,13 @@ public: std::size_t j, class LocalAssembler, std::enable_if_t<((i==bulkId && j==edgeId) || ((i==edgeId && j==bulkId))), int> = 0> - typename LocalResidual<i>::ElementResidualVector + typename LocalAssembler::LocalResidual::ElementResidualVector evalCouplingResidual(Dune::index_constant<i> domainI, const LocalAssembler& localAssembler, Dune::index_constant<j> domainJ, GridIndexType<j> dofIdxGlobalJ) { - typename LocalResidual<i>::ElementResidualVector res(1); + typename LocalAssembler::LocalResidual::ElementResidualVector res(1); res = 0.0; return res; } diff --git a/dumux/multidomain/staggeredtraits.hh b/dumux/multidomain/staggeredtraits.hh index 3272c30c5126117e369ddcc8b5480878d186ae26..7645a47ae8b13d3f89990a7423490c7d4a8c237d 100644 --- a/dumux/multidomain/staggeredtraits.hh +++ b/dumux/multidomain/staggeredtraits.hh @@ -190,6 +190,7 @@ public: using Index = Dune::index_constant<id>; using TypeTag = SubDomainTypeTag<id>; using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; + using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; using GridGeometry = typename Detail::Staggered::SubDomainFVGridGeometryImpl<SubDomainTypeTag, id>::type; using GridVariables = typename Detail::Staggered::SubDomainGridVariablesImpl<SubDomainTypeTag, id>::type; using SolutionVector = typename Detail::Staggered::SubDomainSolutionVectorImpl<SubDomainTypeTag, id>::type; diff --git a/dumux/multidomain/subdomaincclocalassembler.hh b/dumux/multidomain/subdomaincclocalassembler.hh index 4cbba1046346530e25651a0c5de3d4a450714cb9..c03e85604e66c05b7974cde4412c578f312db9f9 100644 --- a/dumux/multidomain/subdomaincclocalassembler.hh +++ b/dumux/multidomain/subdomaincclocalassembler.hh @@ -76,7 +76,7 @@ public: //! export the domain id of this sub-domain static constexpr auto domainId = typename Dune::index_constant<id>(); //! the local residual type of this domain - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; + using LocalResidual = typename ParentType::LocalResidual; //! pull up constructor of parent class using ParentType::ParentType; diff --git a/dumux/multidomain/subdomainstaggeredlocalassembler.hh b/dumux/multidomain/subdomainstaggeredlocalassembler.hh index aab6fdf4e96127b3f4311cb92ca03b05cc47b8f8..2618653cd06254c8c3b2745835eb8abe696232fc 100644 --- a/dumux/multidomain/subdomainstaggeredlocalassembler.hh +++ b/dumux/multidomain/subdomainstaggeredlocalassembler.hh @@ -47,7 +47,6 @@ class SubDomainStaggeredLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag using ParentType = FVLocalAssemblerBase<TypeTag, Assembler,Implementation, isImplicit>; using Problem = GetPropType<TypeTag, Properties::Problem>; - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; using SolutionVector = typename Assembler::SolutionVector; using GridVariables = GetPropType<TypeTag, Properties::GridVariables>; @@ -56,8 +55,8 @@ class SubDomainStaggeredLocalAssemblerBase : public FVLocalAssemblerBase<TypeTag using Scalar = typename GridVariables::Scalar; using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; - using CellCenterResidualValue = typename LocalResidual::CellCenterResidualValue; - using FaceResidualValue = typename LocalResidual::FaceResidualValue; + using CellCenterResidualValue = typename ParentType::LocalResidual::CellCenterResidualValue; + using FaceResidualValue = typename ParentType::LocalResidual::FaceResidualValue; using GridGeometry = typename GridVariables::GridGeometry; using FVElementGeometry = typename GridGeometry::LocalView; @@ -471,9 +470,8 @@ class SubDomainStaggeredLocalAssembler<id, TypeTag, Assembler, DiffMethod::numer using ThisType = SubDomainStaggeredLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/true>; using ParentType = SubDomainStaggeredLocalAssemblerImplicitBase<id, TypeTag, Assembler, ThisType>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>; - using CellCenterResidualValue = typename LocalResidual::CellCenterResidualValue; - using FaceResidualValue = typename LocalResidual::FaceResidualValue; + using CellCenterResidualValue = typename ParentType::LocalResidual::CellCenterResidualValue; + using FaceResidualValue = typename ParentType::LocalResidual::FaceResidualValue; using Element = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView::template Codim<0>::Entity; using GridFaceVariables = GetPropType<TypeTag, Properties::GridFaceVariables>; using ElementFaceVariables = typename GetPropType<TypeTag, Properties::GridFaceVariables>::LocalView; diff --git a/dumux/multidomain/traits.hh b/dumux/multidomain/traits.hh index a29dc0bbec15646f33cb019132570c1159c52483..4980f209bbf491d08aff189fa81f6daa1188879c 100644 --- a/dumux/multidomain/traits.hh +++ b/dumux/multidomain/traits.hh @@ -175,7 +175,8 @@ public: using Grid = GetPropType<SubDomainTypeTag<id>, Properties::Grid>; using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>; using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; - using GridVariables =GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; + using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>; + using LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>; using IOFields = GetPropType<SubDomainTypeTag<id>, Properties::IOFields>; using SolutionVector = GetPropType<SubDomainTypeTag<id>, Properties::SolutionVector>; using ResidualVector = typename Detail::NativeDuneVectorType<SolutionVector>::type;