Dune Core Modules (2.8.0)

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
64 std::size_t size = referenceElement(e.geometry()).size(Element::mydimension);
65
66 std::vector<typename IdSet::IdType> ids(size);
67 for(std::size_t i = 0; i < size; ++i)
68 ids[i] = idset.subId(e, i, Element::mydimension);
70 (e.type(), ids.begin(), ids.end());
71 }
72 };
73
74} // namespace Dune
75
76#endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
Class providing information on the ordering of vertices.
Definition: generalvertexorder.hh:65
Id Set Interface.
Definition: indexidset.hh:450
IdType subId(const typename 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:488
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
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
Dune namespace.
Definition: alignedallocator.hh:11
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 (Nov 21, 23:30, 2024)