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 #if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
52 template <
class Topology>
55 build(GeometryType(Topology{}));
59 template <GeometryType::Id geometryId>
62 build(GeometryType(geometryId));
69 #if DUNE_VERSION_LT(DUNE_LOCALFUNCTIONS,2,8)
70 template <
class Topology>
72 template <GeometryType::Id geometryId>
83 Impl::LagrangePointSetBuilder<K,dim> builder_;
91 template <
class K,
unsigned int dim>
92 class LagrangePointSetBuilder
95 template <
class Po
ints>
96 void operator()(GeometryType,
unsigned int, Points& points)
const
98 DUNE_THROW(Dune::NotImplemented,
99 "Lagrange points not yet implemented for this GeometryType.");
106 class LagrangePointSetBuilder<K,0>
108 static constexpr
int dim = 0;
109 using LP = LagrangePoint<K,dim>;
110 using Vec =
typename LP::Vector;
111 using Key = LocalKey;
114 template <
class Po
ints>
115 void operator()(GeometryType gt,
int , Points& points)
const;
121 class LagrangePointSetBuilder<K,1>
123 static constexpr
int dim = 1;
124 using LP = LagrangePoint<K,dim>;
125 using Vec =
typename LP::Vector;
126 using Key = LocalKey;
129 template <
class Po
ints>
130 void operator()(GeometryType gt,
int order, Points& points)
const;
136 class LagrangePointSetBuilder<K,2>
138 static constexpr
int dim = 2;
139 using LP = LagrangePoint<K,dim>;
140 using Vec =
typename LP::Vector;
141 using Key = LocalKey;
143 friend class LagrangePointSetBuilder<K,3>;
146 template <
class Po
ints>
147 void operator()(GeometryType gt,
int order, Points& points)
const;
153 template <
class Po
ints>
154 void buildTriangle (std::size_t nPoints,
int order, Points& points)
const;
159 static void barycentricIndex (
int index, std::array<int,3>& bindex,
int order);
164 template <
class Po
ints>
165 void buildQuad(std::size_t nPoints,
int order, Points& points)
const;
169 static std::pair<int,Key> calcQuadKey (
int i,
int j, std::array<int,2> order);
175 class LagrangePointSetBuilder<K,3>
177 static constexpr
int dim = 3;
178 using LP = LagrangePoint<K,dim>;
179 using Vec =
typename LP::Vector;
180 using Key = LocalKey;
183 template <
class Po
ints>
184 void operator() (GeometryType gt,
unsigned int order, Points& points)
const;
191 template <
class Po
ints>
192 void buildTetra (std::size_t nPoints,
int order, Points& points)
const;
197 static void barycentricIndex (
int p, std::array<int,4>& bindex,
int order);
202 template <
class Po
ints>
203 void buildHex (std::size_t nPoints,
int order, Points& points)
const;
206 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:60
static bool supports(std::size_t order)
Definition: lagrangepoints.hh:74
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