1#ifndef DUNE_LOCALFUNCTIONS_LAGRANGE_EQUIDISTANTPOINTS_HH
2#define DUNE_LOCALFUNCTIONS_LAGRANGE_EQUIDISTANTPOINTS_HH
9#include <dune/geometry/referenceelements.hh>
10#include <dune/geometry/type.hh>
23 const int dim = gt.dim();
26 const GeometryType baseGeometryType = Impl::getBase( gt );
30 for(
unsigned int o = 0; o <= order; ++o )
41 [[deprecated(
"Use numLagrangePoints(const GeometryType& gt, std::size_t order ) instead.")]]
42 inline std::size_t
numLagrangePoints (
unsigned int topologyId,
unsigned int dim, std::size_t order )
52 template<
class ct,
unsigned int cdim >
55 const unsigned int dim = gt.dim();
56 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );
60 const GeometryType baseGeometryType = Impl::getBase( gt );
61 const unsigned int numBaseN = (codim < dim ? Geo::Impl::size( baseGeometryType.id(), baseGeometryType.dim(), codim ) : 0);
62 const unsigned int numBaseM = (codim > 0 ? Geo::Impl::size( baseGeometryType.id(), baseGeometryType.dim(), codim-1 ) : 0);
64 if( gt.isPrismatic() )
66 unsigned int size = 0;
69 for(
unsigned int i = 1; i < order; ++i )
72 for(
unsigned int j = 0; j < n; ++j )
76 points->
point_[ dim-1 ] = ct( i ) / ct( order );
86 for(
unsigned int j = 0; j < n; ++j )
92 points[ j + n ].
point_[ dim-1 ] = ct( 1 );
105 for( ; points != end; ++points )
110 for(
unsigned int i = order-1; i > 0; --i )
114 for( ; points != end; ++points )
117 for(
unsigned int j = 0; j < dim-1; ++j )
118 points->
point_[ j ] *= ct( i ) / ct( order );
119 points->
point_[ dim-1 ] = ct( order - i ) / ct( order );
128 points->
point_[ dim-1 ] = ct( 1 );
143 template<
class ct,
unsigned int cdim >
144 [[deprecated(
"Use equidistantLagrangePoints ( GeometryType gt, ... ) instead.")]]
155 template<
class F,
unsigned int dim >
174 std::vector< unsigned int > count;
175 for(
unsigned int mydim = 0; mydim <=
dimension; ++mydim )
178 std::fill( count.begin(), count.end(), 0u );
181 const auto &refElement = referenceElement<F,dimension>(gt);
182 F weight = refElement.volume()/F(
double(points_.size()));
183 for (
auto &p : points_)
187 template< GeometryType::Id geometryId >
190 build( GeometryType( geometryId ) );
196 return build< GeometryTypes::cube(dim) > ();
199 static bool supports ( GeometryType gt, std::size_t
order ) {
return true; }
200 template< GeometryType::Id geometryId>
Definition: bdfmcube.hh:16
std::size_t numLagrangePoints(const GeometryType >, std::size_t order)
Definition: equidistantpoints.hh:21
static unsigned int equidistantLagrangePoints(const GeometryType >, unsigned int codim, std::size_t order, unsigned int *count, LagrangePoint< ct, cdim > *points)
Definition: equidistantpoints.hh:53
Describe position of one degree of freedom.
Definition: localkey.hh:21
unsigned int index() const
Return offset within subentity.
Definition: localkey.hh:66
unsigned int subEntity() const
Return number of associated subentity.
Definition: localkey.hh:54
Definition: emptypoints.hh:16
Field weight_
Definition: emptypoints.hh:46
Vector point_
Definition: emptypoints.hh:44
LocalKey localKey_
Definition: emptypoints.hh:45
Definition: emptypoints.hh:54
std::size_t order() const
Definition: emptypoints.hh:93
std::vector< LagrangePoint > points_
Definition: emptypoints.hh:105
Definition: equidistantpoints.hh:158
std::size_t order() const
Definition: emptypoints.hh:93
bool build()
Definition: equidistantpoints.hh:188
static bool supports(std::size_t order)
Definition: equidistantpoints.hh:201
static const unsigned int dimension
Definition: equidistantpoints.hh:162
void build(GeometryType gt)
Definition: equidistantpoints.hh:168
static bool supports(GeometryType gt, std::size_t order)
Definition: equidistantpoints.hh:199
bool buildCube()
Definition: equidistantpoints.hh:194
EquidistantPointSet(std::size_t order)
Definition: equidistantpoints.hh:166