12#ifndef DUMUX_TYPETRAITS_GRID_DISCRETIZATION_HH
13#define DUMUX_TYPETRAITS_GRID_DISCRETIZATION_HH
17#include <dune/common/std/type_traits.hh>
27struct GridDiscretizationType
29 static_assert(AlwaysFalse<T>::value,
"Type exports neither GridGeometry nor GridDiscretization");
34 requires requires {
typename T::GridDiscretization; }
35struct GridDiscretizationType<T>
36{
using type =
typename T::GridDiscretization; };
40 requires (!
requires {
typename T::GridDiscretization; }
41 &&
requires {
typename T::GridGeometry; })
42struct GridDiscretizationType<T>
43{
using type =
typename T::GridGeometry; };
47struct NoSubControlVolume {};
48struct NoSubControlVolumeFace {};
50template<
class ED>
using SpecifiedSubControlVolume =
typename ED::SubControlVolume;
51template<
class ED>
using SpecifiedSubControlVolumeFace =
typename ED::SubControlVolumeFace;
73template<
class ElementDiscretization>
75 Detail::NoSubControlVolume, Detail::SpecifiedSubControlVolume, ElementDiscretization
84template<
class ElementDiscretization>
86 Detail::NoSubControlVolumeFace, Detail::SpecifiedSubControlVolumeFace, ElementDiscretization
97template<
class T,
class... Args>
100 if constexpr (
requires { t.gridDiscretization(std::forward<Args>(args)...); })
101 return t.gridDiscretization(std::forward<Args>(args)...);
103 return t.gridGeometry(std::forward<Args>(args)...);
decltype(auto) gridDiscretization(const T &t, Args &&... args)
The grid discretization.
Definition griddiscretization.hh:98
Dune::Std::detected_or_t< Detail::NoSubControlVolume, Detail::SpecifiedSubControlVolume, ElementDiscretization > SubControlVolume_t
The sub-control volume type of an element discretization, or a placeholder type for discretizations t...
Definition griddiscretization.hh:74
Dune::Std::detected_or_t< Detail::NoSubControlVolumeFace, Detail::SpecifiedSubControlVolumeFace, ElementDiscretization > SubControlVolumeFace_t
The sub-control volume face type of an element discretization, or a placeholder type for discretizati...
Definition griddiscretization.hh:85
typename Detail::GridDiscretizationType< T >::type GridDiscretization_t
The grid discretization type of a class exporting it.
Definition griddiscretization.hh:64
Definition cvfelocalresidual.hh:25