Dune Core Modules (unstable)

vertexorderfactory.hh
1 // SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 // vi: set et ts=4 sw=2 sts=2:
5 
6 #ifndef DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
7 #define DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
8 
9 #include <algorithm>
10 #include <cstddef>
11 #include <functional>
12 #include <vector>
13 
14 #include <dune/geometry/referenceelements.hh>
15 #include <dune/geometry/generalvertexorder.hh>
16 
17 namespace Dune {
18 
20 
31  template<class IdSet, class Index = std::size_t>
33  const IdSet& idset;
34 
35  public:
37  template<std::size_t dim>
38  struct VertexOrder {
41  };
42 
44 
53  VertexOrderByIdFactory(const IdSet &idset_) : idset(idset_) { }
54 
56 
62  template<typename Element>
64  make(const Element &e) const {
65 
66  std::size_t size = referenceElement(e.geometry()).size(Element::mydimension);
67 
68  std::vector<typename IdSet::IdType> ids(size);
69  for(std::size_t i = 0; i < size; ++i)
70  ids[i] = idset.subId(e, i, Element::mydimension);
72  (e.type(), ids.begin(), ids.end());
73  }
74  };
75 
76 } // namespace Dune
77 
78 #endif // DUNE_GRID_UTILITY_VERTEXORDERFACTORY_HH
Class providing information on the ordering of vertices.
Definition: generalvertexorder.hh:67
Id Set Interface.
Definition: indexidset.hh:447
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:481
Factory for GeneralVertexOrder objects using an IdSet.
Definition: vertexorderfactory.hh:32
VertexOrderByIdFactory(const IdSet &idset_)
construct a factory object
Definition: vertexorderfactory.hh:53
VertexOrder< Element::mydimension >::type make(const Element &e) const
construct a vertex ordering object
Definition: vertexorderfactory.hh:64
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
type of vertex order object may depend on the dimension of the element
Definition: vertexorderfactory.hh:38
GeneralVertexOrder< dim, Index > type
type of vertex order object
Definition: vertexorderfactory.hh:40
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 2, 22:35, 2024)