Skip to content
Snippets Groups Projects
Commit 0a4c7fb2 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[grid.type_traits] allow to extract grid from entity

parent 03cc3073
No related branches found
No related tags found
1 merge request!20Update bindings
......@@ -222,28 +222,35 @@ struct is_cube_alugrid<ALUGrid<dim, dimworld, ALUGridElementType::cube, refineTy
template <class T,
bool view = is_view<T>::value,
bool part = is_part<T>::value,
bool intersection = is_intersection<T>::value>
bool intersection = is_intersection<T>::value,
bool entity = is_entity<T>::value>
struct extract_grid : public AlwaysFalse<T>
{};
template <class T>
struct extract_grid<T, true, false, false>
struct extract_grid<T, true, false, false, false>
{
typedef typename T::Grid type;
};
template <class T>
struct extract_grid<T, false, true, false>
struct extract_grid<T, false, true, false, false>
{
typedef typename T::GridType type;
};
template <class T>
struct extract_grid<T, false, false, true>
struct extract_grid<T, false, false, true, false>
{
typedef typename is_intersection<T>::GridType type;
};
template <int cd, int dim, class GridImp, template <int, int, class> class EntityImp>
struct extract_grid<Dune::Entity<cd, dim, GridImp, EntityImp>, false, false, false, true>
{
using type = GridImp;
};
template <class T>
using extract_grid_t = typename extract_grid<T>::type;
......
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