Skip to content
Snippets Groups Projects
Commit e1150a94 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[mpfa][nodalindexset] pull out traits definition from property declaration

In order for a type to be completely typetag independent, the traits cannot
be declared inside the body of the property definition.
parent c3e7fcdc
No related branches found
No related tags found
1 merge request!839Feature/make mpfafvgridgeom reusable
......@@ -32,6 +32,30 @@
namespace Dumux
{
/*!
* \ingroup CCMpfaDiscretization
* \brief Default traits to be used in conjuntion
* with the dual grid nodal index set.
*
* \tparam GV The grid view type
*/
template<class GV>
struct NodalIndexSetDefaultTraits
{
using GridView = GV;
using GridIndexType = typename GV::IndexSet::IndexType;
using LocalIndexType = std::uint8_t;
//! per default, we use dynamic data containers (iv size unknown)
template< class T > using NodalScvDataStorage = std::vector< T >;
template< class T > using NodalScvfDataStorage = std::vector< T >;
//! store data on neighbors of scvfs in static containers if possible
template< class T >
using ScvfNeighborDataStorage = typename std::conditional_t< (int(GV::dimension)<int(GV::dimensionworld)),
std::vector< T >,
Dune::ReservedVector< T, 2 > >;
};
/*!
* \ingroup CCMpfaDiscretization
......
......@@ -63,26 +63,10 @@ NEW_TYPE_TAG(CCMpfaModel, INHERITS_FROM(FiniteVolumeModel));
//! Set the index set type used on the dual grid nodes
SET_PROP(CCMpfaModel, DualGridNodalIndexSet)
{
using GV = typename GET_PROP_TYPE(TypeTag, GridView);
static constexpr int dim = GV::dimension;
static constexpr int dimWorld = GV::dimensionworld;
private:
struct Traits
{
using GridView = GV;
using GridIndexType = typename GV::IndexSet::IndexType;
using LocalIndexType = std::uint8_t;
//! per default, we use dynamic data containers (iv size unknown)
template< class T > using NodalScvDataStorage = std::vector< T >;
template< class T > using NodalScvfDataStorage = std::vector< T >;
//! store data on neighbors of scvfs in static containers if possible
template< class T >
using ScvfNeighborDataStorage = typename std::conditional_t< (dim<dimWorld),
std::vector< T >,
Dune::ReservedVector< T, 2 > >;
};
using GV = typename GET_PROP_TYPE(TypeTag, GridView);
using Traits = NodalIndexSetDefaultTraits< GV >;
public:
using type = CCMpfaDualGridNodalIndexSet< Traits >;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment