3#ifndef DUNE_LOCALFUNCTIONS_LAGRANGE_EQUIDISTANTPOINTS_HH
4#define DUNE_LOCALFUNCTIONS_LAGRANGE_EQUIDISTANTPOINTS_HH
11#include <dune/geometry/referenceelements.hh>
12#include <dune/geometry/type.hh>
25 const int dim = gt.
dim();
28 const GeometryType baseGeometryType = Impl::getBase( gt );
32 for(
unsigned int o = 0; o <= order; ++o )
43 [[deprecated(
"Use numLagrangePoints(const GeometryType& gt, std::size_t order ) instead.")]]
44 inline std::size_t
numLagrangePoints (
unsigned int topologyId,
unsigned int dim, std::size_t order )
54 template<
class ct,
unsigned int cdim >
57 const unsigned int dim = gt.dim();
58 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );
62 const GeometryType baseGeometryType = Impl::getBase( gt );
63 const unsigned int numBaseN = (codim < dim ? Geo::Impl::size( baseGeometryType.id(), baseGeometryType.dim(), codim ) : 0);
64 const unsigned int numBaseM = (codim > 0 ? Geo::Impl::size( baseGeometryType.id(), baseGeometryType.dim(), codim-1 ) : 0);
66 if( gt.isPrismatic() )
68 unsigned int size = 0;
71 for(
unsigned int i = 1; i < order; ++i )
74 for(
unsigned int j = 0; j < n; ++j )
78 points->
point_[ dim-1 ] = ct( i ) / ct( order );
88 for(
unsigned int j = 0; j < n; ++j )
94 points[ j + n ].
point_[ dim-1 ] = ct( 1 );
107 for( ; points != end; ++points )
112 for(
unsigned int i = order-1; i > 0; --i )
116 for( ; points != end; ++points )
119 for(
unsigned int j = 0; j < dim-1; ++j )
120 points->
point_[ j ] *= ct( i ) / ct( order );
121 points->
point_[ dim-1 ] = ct( order - i ) / ct( order );
130 points->
point_[ dim-1 ] = ct( 1 );
145 template<
class ct,
unsigned int cdim >
146 [[deprecated(
"Use equidistantLagrangePoints ( GeometryType gt, ... ) instead.")]]
157 template<
class F,
unsigned int dim >
176 std::vector< unsigned int > count;
177 for(
unsigned int mydim = 0; mydim <=
dimension; ++mydim )
180 std::fill( count.begin(), count.end(), 0u );
183 const auto &refElement = referenceElement<F,dimension>(gt);
184 F weight = refElement.volume()/F(
double(points_.size()));
185 for (
auto &p : points_)
189 template< GeometryType::Id geometryId >
192 build( GeometryType( geometryId ) );
198 return build< GeometryTypes::cube(dim) > ();
201 static bool supports ( GeometryType, std::size_t ) {
return true; }
202 template< GeometryType::Id geometryId>
Definition bdfmcube.hh:18
std::size_t numLagrangePoints(const GeometryType >, std::size_t order)
Definition equidistantpoints.hh:23
static unsigned int equidistantLagrangePoints(const GeometryType >, unsigned int codim, std::size_t order, unsigned int *count, LagrangePoint< ct, cdim > *points)
Definition equidistantpoints.hh:55
Describe position of one degree of freedom.
Definition localkey.hh:23
unsigned int index() const
Return offset within subentity.
Definition localkey.hh:68
unsigned int subEntity() const
Return number of associated subentity.
Definition localkey.hh:56
Definition emptypoints.hh:18
Field weight_
Definition emptypoints.hh:48
Vector point_
Definition emptypoints.hh:46
LocalKey localKey_
Definition emptypoints.hh:47
Definition emptypoints.hh:56
std::size_t order() const
Definition emptypoints.hh:95
std::vector< LagrangePoint > points_
Definition emptypoints.hh:107
Definition equidistantpoints.hh:160
std::size_t order() const
Definition emptypoints.hh:95
bool build()
Definition equidistantpoints.hh:190
static bool supports(std::size_t order)
Definition equidistantpoints.hh:203
static const unsigned int dimension
Definition equidistantpoints.hh:164
static bool supports(GeometryType, std::size_t)
Definition equidistantpoints.hh:201
void build(GeometryType gt)
Definition equidistantpoints.hh:170
bool buildCube()
Definition equidistantpoints.hh:196
EquidistantPointSet(std::size_t order)
Definition equidistantpoints.hh:168