4 #ifndef DUNE_PDELAB_FINITEELEMENTMAP_FINITEELEMENTMAP_HH 5 #define DUNE_PDELAB_FINITEELEMENTMAP_FINITEELEMENTMAP_HH 7 #include <dune/common/deprecated.hh> 10 #include <dune/geometry/referenceelements.hh> 41 template<
class T,
class Imp>
54 template<
class EntityType>
56 find (
const EntityType&
e)
const =
delete;
75 bool fixedSize()
const =
delete;
79 std::size_t size(GeometryType gt)
const =
delete;
84 bool hasDOFs(
int codim)
const =
delete;
90 std::size_t maxLocalSize()
const =
delete;
97 SimpleLocalFiniteElementMap<Imp> >
112 template<
class EntityType>
142 template<
typename GV,
typename FE,
typename Imp>
145 LocalFiniteElementMapTraits<FE>,
149 typedef typename GV::IndexSet IndexSet;
150 static const int dim = GV::dimension;
158 : gv(gv_), orient(gv_.size(0))
160 using ct =
typename GV::Grid::ctype;
162 ReferenceElements<ct, dim>::general(FE().type());
164 auto &idSet = gv.grid().globalIdSet();
167 variant.resize(1 << refElem.size(dim-1));
168 for (std::size_t i=0; i<variant.size(); i++)
172 auto& indexSet = gv.indexSet();
175 for (
const auto& element : elements(gv))
177 auto elemid = indexSet.index(element);
180 std::vector<typename GV::Grid::GlobalIdSet::IdType> vid(refElem.size(dim));
181 for(std::size_t i = 0; i < vid.size(); ++i)
182 vid[i] = idSet.subId(element, i, dim);
185 for(
int i = 0; i < refElem.size(dim-1); ++i) {
186 auto v0 = refElem.subEntity(i, dim-1, 0, dim);
187 auto v1 = refElem.subEntity(i, dim-1, 1, dim);
189 if((v0 > v1) != (vid[v0] > vid[v1]))
190 orient[elemid] |= 1 << i;
196 template<
class EntityType>
199 return variant[orient[gv.indexSet().index(e)]];
204 std::vector<FE> variant;
205 std::vector<unsigned char> orient;
210 template<
typename GV,
typename FE,
typename Imp, std::
size_t Variants>
213 LocalFiniteElementMapTraits<FE>,
216 typedef FE FiniteElement;
217 typedef typename GV::IndexSet IndexSet;
225 : gv(gv_), is(gv_.indexSet()), orient(gv_.size(0))
228 for (std::size_t i = 0; i < Variants; i++)
230 variant[i] = FiniteElement(i);
235 for(
const auto& cell : elements(gv))
237 auto myId = is.index(cell);
240 for (
const auto& intersection : intersections(gv,cell))
242 if (intersection.neighbor()
243 && is.index(intersection.outside()) > myId)
245 orient[myId] |= 1 << intersection.indexInInside();
252 template<
class EntityType>
255 return variant[orient[is.index(e)]];
260 std::array<FiniteElement,Variants> variant;
262 std::vector<unsigned char> orient;
270 #endif // DUNE_PDELAB_FINITEELEMENTMAP_FINITEELEMENTMAP_HH T Traits
Export traits.
Definition: finiteelementmap.hh:46
static const int dim
Definition: adaptivity.hh:83
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: finiteelementmap.hh:253
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: finiteelementmap.hh:197
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
EdgeS0LocalFiniteElementMap(const GV &gv_)
construct EdgeSLocalFiniteElementMap
Definition: finiteelementmap.hh:157
FiniteElementMap exception raised when trying to obtain a finite element for an unsupported GeometryT...
Definition: finiteelementmap.hh:23
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
implementation for finite elements requiring oriented edges
Definition: finiteelementmap.hh:143
RTLocalFiniteElementMap(const GV &gv_)
Use when Imp has a standard constructor.
Definition: finiteelementmap.hh:224
collect types exported by a finite element map
Definition: finiteelementmap.hh:38
const Traits::FiniteElementType & find(const EntityType &e) const
get local basis functions for entity
Definition: finiteelementmap.hh:113
T FiniteElement
Type of finite element from local functions.
Definition: finiteelementmap.hh:33
const Entity & e
Definition: localfunctionspace.hh:111
FiniteElementMap exception concerning the computation of the FiniteElementMap size.
Definition: finiteelementmap.hh:21
LocalFiniteElementMapTraits< FE > Traits
export type of the signature
Definition: finiteelementmap.hh:221
LocalFiniteElementMapTraits< FE > Traits
export type of the signature
Definition: finiteelementmap.hh:154
SimpleLocalFiniteElementMap(const Imp &imp_)
Constructor where an instance of Imp can be provided.
Definition: finiteelementmap.hh:108
simple implementation where all entities have the same finite element
Definition: finiteelementmap.hh:95
collect types exported by a finite element map
Definition: finiteelementmap.hh:27
general FiniteElementMap exception
Definition: finiteelementmap.hh:19
PDELab-specific exceptions.
Definition: finiteelementmap.hh:211
interface for a finite element map
Definition: finiteelementmap.hh:42
SimpleLocalFiniteElementMap()
Use when Imp has a standard constructor.
Definition: finiteelementmap.hh:104
Base class for all PDELab exceptions.
Definition: exceptions.hh:17
LocalFiniteElementMapTraits< Imp > Traits
export type of the signature
Definition: finiteelementmap.hh:101