6#include <dune/common/exceptions.hh>
7#include <dune/common/version.hh>
8#include <dune/geometry/type.hh>
9#include <dune/localfunctions/lagrange/equidistantpoints.hh>
18 template <
class K,
unsigned int dim>
19 class LagrangePointSetBuilder;
28 template <
class K,
unsigned int dim>
30 :
public EmptyPointSet<K, dim>
32 using Super = EmptyPointSet<K, dim>;
47 builder_(gt, order(), points_);
51 template <GeometryType::Id geometryId>
54 build(GeometryType(geometryId));
60 template <GeometryType::Id geometryId>
70 Impl::LagrangePointSetBuilder<K,dim> builder_;
78 template <
class K,
unsigned int dim>
79 class LagrangePointSetBuilder
82 template <
class Po
ints>
83 void operator()(GeometryType,
unsigned int, Points& points)
const
85 DUNE_THROW(Dune::NotImplemented,
86 "Lagrange points not yet implemented for this GeometryType.");
93 class LagrangePointSetBuilder<K,0>
95 static constexpr int dim = 0;
96 using LP = LagrangePoint<K,dim>;
97 using Vec =
typename LP::Vector;
101 template <
class Po
ints>
102 void operator()(GeometryType gt,
int , Points& points)
const;
108 class LagrangePointSetBuilder<K,1>
110 static constexpr int dim = 1;
111 using LP = LagrangePoint<K,dim>;
112 using Vec =
typename LP::Vector;
113 using Key = LocalKey;
116 template <
class Po
ints>
117 void operator()(GeometryType gt,
int order, Points& points)
const;
123 class LagrangePointSetBuilder<K,2>
125 static constexpr int dim = 2;
126 using LP = LagrangePoint<K,dim>;
127 using Vec =
typename LP::Vector;
128 using Key = LocalKey;
130 friend class LagrangePointSetBuilder<K,3>;
133 template <
class Po
ints>
134 void operator()(GeometryType gt,
int order, Points& points)
const;
140 template <
class Po
ints>
141 void buildTriangle (std::size_t nPoints,
int order, Points& points)
const;
146 static void barycentricIndex (
int index, std::array<int,3>& bindex,
int order);
151 template <
class Po
ints>
152 void buildQuad(std::size_t nPoints,
int order, Points& points)
const;
156 static std::pair<int,Key> calcQuadKey (
int i,
int j, std::array<int,2> order);
162 class LagrangePointSetBuilder<K,3>
164 static constexpr int dim = 3;
165 using LP = LagrangePoint<K,dim>;
166 using Vec =
typename LP::Vector;
167 using Key = LocalKey;
170 template <
class Po
ints>
171 void operator() (GeometryType gt,
unsigned int order, Points& points)
const;
178 template <
class Po
ints>
179 void buildTetra (std::size_t nPoints,
int order, Points& points)
const;
184 static void barycentricIndex (
int p, std::array<int,4>& bindex,
int order);
189 template <
class Po
ints>
190 void buildHex (std::size_t nPoints,
int order, Points& points)
const;
193 static std::pair<int,Key> calcHexKey (
int i,
int j,
int k, std::array<int,3> order);
A set of lagrange points compatible with the numbering of VTK and Gmsh.
Definition: lagrangepoints.hh:31
bool build()
Fill the lagrange points for the given topology type Topology
Definition: lagrangepoints.hh:52
static bool supports(std::size_t order)
Definition: lagrangepoints.hh:61
LagrangePointSet(std::size_t order)
Definition: lagrangepoints.hh:37
void build(GeometryType gt)
Fill the lagrange points for the given geometry type.
Definition: lagrangepoints.hh:44
static const unsigned int dimension
Definition: lagrangepoints.hh:35