Dune Core Modules (2.4.1)

vertexorderfactory.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4#ifndef DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
5#define DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
6
7#include <algorithm>
8#include <cstddef>
9#include <functional>
10#include <vector>
11
12#include <dune/geometry/referenceelements.hh>
13#include <dune/geometry/generalvertexorder.hh>
14
15namespace Dune {
16
18
29 template<class IdSet, class Index = std::size_t>
31 const IdSet& idset;
32
33 public:
35 template<std::size_t dim>
36 struct VertexOrder {
39 };
40
42
51 VertexOrderByIdFactory(const IdSet &idset_) : idset(idset_) { }
52
54
60 template<typename Element>
62 make(const Element &e) const {
63 typedef ReferenceElements<
64 typename Element::Geometry::ctype,
65 Element::mydimension
66 > RefElems;
67 std::size_t size =
68 RefElems::general(e.type()).size(Element::mydimension);
69
70 std::vector<typename IdSet::IdType> ids(size);
71 for(std::size_t i = 0; i < size; ++i)
72 ids[i] = idset.subId(e, i, Element::mydimension);
74 (e.type(), ids.begin(), ids.end());
75 }
76 };
77
78} // namespace Dune
79
80#endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
Class providing information on the ordering of vertices.
Definition: generalvertexorder.hh:68
Id Set Interface.
Definition: indexidset.hh:414
IdType subId(const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
Get id of subentity i of co-dimension codim of a co-dimension 0 entity.
Definition: indexidset.hh:441
Factory for GeneralVertexOrder objects using an IdSet.
Definition: vertexorderfactory.hh:30
VertexOrderByIdFactory(const IdSet &idset_)
construct a factory object
Definition: vertexorderfactory.hh:51
VertexOrder< Element::mydimension >::type make(const Element &e) const
construct a vertex ordering object
Definition: vertexorderfactory.hh:62
Dune namespace.
Definition: alignment.hh:10
Class providing access to the singletons of the reference elements.
Definition: referenceelements.hh:479
type of vertex order object may depend on the dimension of the element
Definition: vertexorderfactory.hh:36
GeneralVertexOrder< dim, Index > type
type of vertex order object
Definition: vertexorderfactory.hh:38
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)