diff --git a/dumux/discretization/cellcentered/mpfa/CMakeLists.txt b/dumux/discretization/cellcentered/mpfa/CMakeLists.txt index d1940659e201b9a8ba3bc6d6796fb655800bc45e..51527f79f90d7a6cb5c54a78d5cc0ceb6fd90bd7 100644 --- a/dumux/discretization/cellcentered/mpfa/CMakeLists.txt +++ b/dumux/discretization/cellcentered/mpfa/CMakeLists.txt @@ -19,7 +19,7 @@ gridvolumevariables.hh helper.hh interactionvolumebase.hh interactionvolumedatahandle.hh -localassembler.hh +localassemblerbase.hh localfacedata.hh methods.hh properties.hh diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index 8ec7bfc63ef06135be49fb3791871ac8b39442ec..a95a31c84fa195b39a0a27530b9375fa5b5d040d 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -29,7 +29,6 @@ #include <dumux/discretization/method.hh> #include <dumux/discretization/cellcentered/mpfa/tensorlambdafactory.hh> -#include <dumux/discretization/cellcentered/mpfa/localassembler.hh> namespace Dumux { @@ -437,8 +436,8 @@ private: using LambdaFactory = TensorLambdaFactory<DiscretizationMethod::ccmpfa>; // get instance of the interaction volume-local assembler - static constexpr MpfaMethods M = InteractionVolume::MpfaMethod; - using IvLocalAssembler = InteractionVolumeAssembler< Problem, FVElementGeometry, ElementVolumeVariables, M >; + using Traits = typename InteractionVolume::Traits; + using IvLocalAssembler = typename Traits::template LocalAssembler<Problem, FVElementGeometry, ElementVolumeVariables>; IvLocalAssembler localAssembler(problem(), fvGeometry(), elemVolVars()); // Assemble T only if permeability is sol-dependent or if update is forced @@ -476,8 +475,8 @@ private: using LambdaFactory = TensorLambdaFactory<DiscretizationMethod::ccmpfa>; // get instance of the interaction volume-local assembler - static constexpr MpfaMethods M = InteractionVolume::MpfaMethod; - using IvLocalAssembler = InteractionVolumeAssembler< Problem, FVElementGeometry, ElementVolumeVariables, M >; + using Traits = typename InteractionVolume::Traits; + using IvLocalAssembler = typename Traits::template LocalAssembler<Problem, FVElementGeometry, ElementVolumeVariables>; IvLocalAssembler localAssembler(problem(), fvGeometry(), elemVolVars()); // maybe (re-)assemble matrices @@ -502,8 +501,8 @@ private: using ThermCondModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; // get instance of the interaction volume-local assembler - static constexpr MpfaMethods M = InteractionVolume::MpfaMethod; - using IvLocalAssembler = InteractionVolumeAssembler< Problem, FVElementGeometry, ElementVolumeVariables, M >; + using Traits = typename InteractionVolume::Traits; + using IvLocalAssembler = typename Traits::template LocalAssembler<Problem, FVElementGeometry, ElementVolumeVariables>; IvLocalAssembler localAssembler(problem(), fvGeometry(), elemVolVars()); // maybe (re-)assemble matrices (TODO: USE CORRECT SOLDEPENDENT FLAG!) diff --git a/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh b/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh index 423c0381ed97033a69cddf1117f8a8ce814ad72c..dbaf61141d5faabf5cb456c4a0db55e79a4dbc2f 100644 --- a/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh +++ b/dumux/discretization/cellcentered/mpfa/interactionvolumebase.hh @@ -51,6 +51,8 @@ namespace Dumux * using LocalFaceData = ...; * //! export the matrix/vector type traits to be used by the iv * using MatVecTraits = ...; + * //! export the type used for the assembly of the iv's local eq system + * using LocalAssembler = ...; * \endcode */ diff --git a/dumux/discretization/cellcentered/mpfa/localassembler.hh b/dumux/discretization/cellcentered/mpfa/localassemblerbase.hh similarity index 95% rename from dumux/discretization/cellcentered/mpfa/localassembler.hh rename to dumux/discretization/cellcentered/mpfa/localassemblerbase.hh index 40948a54a34fe8e88ca93c873a9a02d7d99d7920..20cbb2a1ccb4e26356d933c942c7330d963b56af 100644 --- a/dumux/discretization/cellcentered/mpfa/localassembler.hh +++ b/dumux/discretization/cellcentered/mpfa/localassemblerbase.hh @@ -21,25 +21,17 @@ * \ingroup CCMpfaDiscretization * \brief Defines the general interface of classes used for the assembly * of the local systems of equations involved in the transmissibility - * computaion in mpfa schemes. + * computation in mpfa schemes. */ -#ifndef DUMUX_DISCRETIZATION_CC_MPFA_LOCAL_ASSEMBLER_HH -#define DUMUX_DISCRETIZATION_CC_MPFA_LOCAL_ASSEMBLER_HH +#ifndef DUMUX_DISCRETIZATION_CC_MPFA_LOCAL_ASSEMBLER_BASE_HH +#define DUMUX_DISCRETIZATION_CC_MPFA_LOCAL_ASSEMBLER_BASE_HH #include <type_traits> #include <dune/common/exceptions.hh> -#include <dumux/discretization/cellcentered/mpfa/methods.hh> namespace Dumux { -//! Forward declaration of the implementation -template< class P, class EG, class EV, MpfaMethods M > class InteractionVolumeAssemblerImpl; - -//! Alias to select the right implementation. -template< class P, class EG, class EV, MpfaMethods M > -using InteractionVolumeAssembler = InteractionVolumeAssemblerImpl< P, EG, EV, M >; - /*! * \ingroup CCMpfaDiscretization * \brief Defines the general interface of the local assembler @@ -330,7 +322,4 @@ private: } // end namespace Dumux -//! include all specializations for different mpfa schemes -#include <dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh> - #endif diff --git a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh index ab52179d16cce2c1f3877cadc2dbce6e583f73c4..cf45a0ca5b21f8929421236f429599bb3f64e54a 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh @@ -38,6 +38,7 @@ #include <dumux/discretization/cellcentered/mpfa/localfacedata.hh> #include <dumux/discretization/cellcentered/mpfa/methods.hh> +#include "localassembler.hh" #include "localsubcontrolentities.hh" #include "interactionvolumeindexset.hh" @@ -91,6 +92,10 @@ public: using LocalFaceData = InteractionVolumeLocalFaceData<GridIndexType, LocalIndexType>; //! export the matrix/vector traits to be used by the iv using MatVecTraits = MVTraits; + + //! the type of assembler used for the o-method's iv-local eq systems + template<class Problem, class FVElementGeometry, class ElemVolVars> + using LocalAssembler = MpfaOInteractionVolumeAssembler<Problem, FVElementGeometry, ElemVolVars>; }; /*! diff --git a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh index 4828fc0cff47f3892064203fd74cdfa94a709c02..dafa103d8cffd342bcca5009ef1e75cf141ba28f 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh @@ -29,7 +29,7 @@ #include <dumux/common/math.hh> #include <dumux/discretization/cellcentered/mpfa/methods.hh> -#include <dumux/discretization/cellcentered/mpfa/localassembler.hh> +#include <dumux/discretization/cellcentered/mpfa/localassemblerbase.hh> #include <dumux/discretization/cellcentered/mpfa/computetransmissibility.hh> namespace Dumux @@ -45,7 +45,7 @@ namespace Dumux * \tparam EV The element volume variables type */ template< class P, class EG, class EV > -class InteractionVolumeAssemblerImpl< P, EG, EV, MpfaMethods::oMethod > +class MpfaOInteractionVolumeAssembler : public InteractionVolumeAssemblerBase< P, EG, EV > { using ParentType = InteractionVolumeAssemblerBase< P, EG, EV >; diff --git a/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh index 60f78d6d68929bc23be96354f1b866521aff8495..a0df661d3c711da4a7724f5c3d60bf2ee9725013 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh @@ -37,6 +37,7 @@ #include <dumux/discretization/cellcentered/mpfa/methods.hh> #include <dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh> +#include "localassembler.hh" #include "localsubcontrolentities.hh" #include "interactionvolumeindexset.hh" @@ -96,6 +97,10 @@ public: static constexpr int numScvs = C; //! export the number of scvfs in the interaction volumes static constexpr int numScvfs = F; + + //! the type of assembler used for the o-method's iv-local eq systems + template<class Problem, class FVElementGeometry, class ElemVolVars> + using LocalAssembler = MpfaOInteractionVolumeAssembler<Problem, FVElementGeometry, ElemVolVars>; }; /*!