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 )
48 template<
class ct,
unsigned int cdim >
51 const unsigned int dim = gt.dim();
52 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );
56 const GeometryType baseGeometryType = Impl::getBase( gt );
57 const unsigned int numBaseN = (codim < dim ? Geo::Impl::size( baseGeometryType.id(), baseGeometryType.dim(), codim ) : 0);
58 const unsigned int numBaseM = (codim > 0 ? Geo::Impl::size( baseGeometryType.id(), baseGeometryType.dim(), codim-1 ) : 0);
60 if( gt.isPrismatic() )
62 unsigned int size = 0;
65 for(
unsigned int i = 1; i < order; ++i )
68 for(
unsigned int j = 0; j < n; ++j )
72 points->
point_[ dim-1 ] = ct( i ) / ct( order );
82 for(
unsigned int j = 0; j < n; ++j )
88 points[ j + n ].
point_[ dim-1 ] = ct( 1 );
101 for( ; points != end; ++points )
106 for(
unsigned int i = order-1; i > 0; --i )
110 for( ; points != end; ++points )
113 for(
unsigned int j = 0; j < dim-1; ++j )
114 points->
point_[ j ] *= ct( i ) / ct( order );
115 points->
point_[ dim-1 ] = ct( order - i ) / ct( order );
124 points->
point_[ dim-1 ] = ct( 1 );
144 template<
class F,
unsigned int dim >
163 std::vector< unsigned int > count;
164 for(
unsigned int mydim = 0; mydim <=
dimension; ++mydim )
167 std::fill( count.begin(), count.end(), 0u );
170 const auto &refElement = referenceElement<F,dimension>(gt);
171 F weight = refElement.volume()/F(
double(points_.size()));
172 for (
auto &p : points_)
176 template< GeometryType::Id geometryId >
179 build( GeometryType( geometryId ) );
185 return build< GeometryTypes::cube(dim) > ();
188 static bool supports ( GeometryType, std::size_t ) {
return true; }
189 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:49
Describe position of one degree of freedom.
Definition localkey.hh:24
constexpr unsigned int index() const noexcept
Return offset within subentity.
Definition localkey.hh:70
constexpr unsigned int subEntity() const noexcept
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:147
std::size_t order() const
Definition emptypoints.hh:95
bool build()
Definition equidistantpoints.hh:177
static bool supports(std::size_t order)
Definition equidistantpoints.hh:190
static const unsigned int dimension
Definition equidistantpoints.hh:151
static bool supports(GeometryType, std::size_t)
Definition equidistantpoints.hh:188
void build(GeometryType gt)
Definition equidistantpoints.hh:157
bool buildCube()
Definition equidistantpoints.hh:183
EquidistantPointSet(std::size_t order)
Definition equidistantpoints.hh:155