20 #ifndef bempp_concrete_index_set_hpp
21 #define bempp_concrete_index_set_hpp
23 #include "../common/common.hpp"
25 #include "index_set.hpp"
26 #include "concrete_entity.hpp"
44 template<
typename DuneGr
idView>
59 m_dune_index_set(dune_index_set) {
64 return *m_dune_index_set;
68 return entityCodimNIndex(e);
71 return entityCodimNIndex(e);
74 return entityCodimNIndex(e);
77 return entityCodimNIndex(e);
82 if (codimSub > DuneGridView::Grid::dimension)
83 throw std::invalid_argument(
"IndexSet::subEntityIndex(): codimSub exceeds grid dimension");
84 typedef typename DuneGridView::template Codim<0>::Entity DuneEntity;
86 const ConcEntity& ce =
dynamic_cast<const ConcEntity&
>(e);
87 return m_dune_index_set->subIndex(ce.duneEntity(), i, codimSub);
92 typename boost::disable_if_c<codim <= DuneGridView::dimension, IndexType>::type
94 throw std::logic_error(
"IndexSet::entityIndex(): invalid entity codimension");
98 typename boost::enable_if_c<codim <= DuneGridView::dimension, IndexType>::type
99 entityCodimNIndex(
const Entity<codim>& e)
const {
100 typedef typename DuneGridView::template Codim<codim>::Entity DuneEntity;
101 typedef ConcreteEntity<codim, DuneEntity> ConcEntity;
102 const ConcEntity& ce =
dynamic_cast<const ConcEntity&
>(e);
103 return m_dune_index_set->index(ce.duneEntity());
virtual IndexType entityIndex(const Entity< 2 > &e) const
Index of the entity of codimension 2.
Definition: concrete_index_set.hpp:73
Abstract wrapper of an entity of codimension codim.
Definition: entity.hpp:46
Wrapper of a Dune entity of type DuneEntity and codimension 0.
Definition: concrete_entity_decl.hpp:117
virtual IndexType subEntityIndex(const Entity< 0 > &e, size_t i, int codimSub) const
Index of i'th subentity of codimension codimSub of entity e of codimension 0.
Definition: concrete_index_set.hpp:80
virtual IndexType entityIndex(const Entity< 0 > &e) const
Index of the entity of codimension 0.
Definition: concrete_index_set.hpp:67
Abstract wrapper of an index set.
Definition: index_set.hpp:36
virtual IndexType entityIndex(const Entity< 3 > &e) const
Index of the entity of codimension 3.
Definition: concrete_index_set.hpp:76
size_t IndexType
Index type.
Definition: index_set.hpp:47
ConcreteIndexSet(const DuneIndexSet *dune_index_set)
Constructor.
Definition: concrete_index_set.hpp:58
DuneGridView::IndexSet DuneIndexSet
Type of the wrapped Dune index set.
Definition: concrete_index_set.hpp:49
Wrapper of the index set specific to a Dune grid view class DuneGridView.
Definition: concrete_index_set.hpp:45
const DuneIndexSet & duneIndexSet() const
Read-only access to the underlying Dune index set.
Definition: concrete_index_set.hpp:63
Abstract wrapper of an entity of codimension 0.
Definition: entity.hpp:81
virtual IndexType entityIndex(const Entity< 1 > &e) const
Index of the entity of codimension 1.
Definition: concrete_index_set.hpp:70