3#ifndef DUNE_EQUIDISTANTPOINTS_HH
4#define DUNE_EQUIDISTANTPOINTS_HH
8#include <dune/common/fvector.hh>
9#include <dune/common/forloop.hh>
10#include <dune/geometry/topologyfactory.hh>
11#include <dune/geometry/genericgeometry/topologytypes.hh>
12#include <dune/geometry/genericgeometry/subtopologies.hh>
23 template<
class F,
unsigned int dim >
24 class EquidistantPointSet;
29 template<
class Topology,
class F >
37 typedef GenericGeometry::Point Topology;
46 static const unsigned int dimension = Topology::dimension;
48 static unsigned int size ( const unsigned int order )
54 template<
unsigned int codim,
unsigned int dim >
55 static unsigned int setup (
const unsigned int order,
61 points->
point_ = Field( 0 );
66 template<
class BaseTopology,
class F >
71 typedef GenericGeometry::Prism< BaseTopology > Topology;
82 static const unsigned int dimension = Topology::dimension;
84 static unsigned int size ( const unsigned int order )
86 return BaseImpl::size( order ) * (order+1);
90 template<
unsigned int codim,
unsigned int dim >
91 static unsigned int setup (
const unsigned int order,
95 unsigned int size = 0;
96 unsigned int numBaseN = 0;
98 if( codim < dimension )
100 const unsigned int vcodim = (codim < dimension ? codim : dimension-1);
101 numBaseN = GenericGeometry::Size< BaseTopology, vcodim >::value;
102 for(
unsigned int i = 1; i < order; ++i )
104 const unsigned int n = BaseImpl::template setup< vcodim, dim >( order, count, points );
105 for(
unsigned int j = 0; j < n; ++j )
118 const unsigned int vcodim = (codim > 0 ? codim : 1);
119 const unsigned int numBaseM = GenericGeometry::Size< BaseTopology, vcodim-1 >
::value;
120 const unsigned int n = BaseImpl::template setup< vcodim-1, dim >( order, count+numBaseN, points );
121 for(
unsigned int j = 0; j < n; ++j )
126 points[ j + n ].
point_[ dimension-1 ] =
Field( 1 );
136 template<
class BaseTopology,
class F >
141 typedef GenericGeometry::Pyramid< BaseTopology > Topology;
152 static const unsigned int dimension = Topology::dimension;
154 static unsigned int size ( const unsigned int order )
156 unsigned int size = BaseImpl::size( order );
157 for(
unsigned int i = 1; i <= order; ++i )
158 size += BaseImpl::size( order - i );
163 template<
unsigned int codim,
unsigned int dim >
164 static unsigned int setup (
const unsigned int order,
168 unsigned int size = 0;
169 unsigned int numBaseM = 0;
173 const unsigned int vcodim = (codim > 0 ? codim : 1);
174 numBaseM = GenericGeometry::Size< BaseTopology, vcodim-1 >
::value;
175 size = BaseImpl::template setup< vcodim-1, dim >( order, count, points );
177 for( ; points != end; ++points )
184 if( codim < dimension )
186 const unsigned int vcodim = (codim < dimension ? codim : dimension-1);
187 for(
unsigned int i = order-1; i > 0; --i )
189 const unsigned int n = BaseImpl::template setup< vcodim, dim >( i, count+numBaseM, points );
191 for( ; points != end; ++points )
195 for(
unsigned int j = 0; j < dimension-1; ++j )
206 points->
point_[ dimension-1 ] = 1;
219 template<
class F,
unsigned int dim >
244 template<
class F,
unsigned int dim >
246 struct EquidistantPointSet< F, dim >::Topology
248 typedef EquidistantPointSetImpl< T, F > Impl;
256 const unsigned int size = GenericGeometry::Size< T, dimension-pdim >::value;
257 unsigned int count[ size ];
258 for(
unsigned int i = 0; i < size; ++i )
260 p += Impl::template setup< dimension-pdim, dimension >( order, count, p );
265 template<
class F,
unsigned int dim >
269 unsigned int order = Base::order();
272 points_.resize( Impl::size( order ) );
274 ForLoop< Topology< T >::template Init, 0, dimension >::apply( order, p );
Definition brezzidouglasmarini1cube2d.hh:14
@ value
Definition tensor.hh:165
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
Vector point_
Definition emptypoints.hh:39
LocalKey localKey_
Definition emptypoints.hh:40
Definition emptypoints.hh:48
Dune::LagrangePoint< Field, dimension > LagrangePoint
Definition emptypoints.hh:56
unsigned int order() const
Definition emptypoints.hh:87
std::vector< LagrangePoint > points_
Definition emptypoints.hh:99
Definition equidistantpoints.hh:221
EquidistantPointSet(unsigned int order)
Definition equidistantpoints.hh:228
bool build()
Definition equidistantpoints.hh:267
static const unsigned int dimension
Definition equidistantpoints.hh:226
static bool supports(unsigned int order)
Definition equidistantpoints.hh:236
Definition equidistantpoints.hh:30
Definition equidistantpoints.hh:34
F Field
Definition equidistantpoints.hh:44
Definition equidistantpoints.hh:68
static unsigned int setup(const unsigned int order, unsigned int *count, LagrangePoint< Field, dim > *points)
Definition equidistantpoints.hh:91
F Field
Definition equidistantpoints.hh:80
Definition equidistantpoints.hh:138
F Field
Definition equidistantpoints.hh:150
static unsigned int setup(const unsigned int order, unsigned int *count, LagrangePoint< Field, dim > *points)
Definition equidistantpoints.hh:164
Definition equidistantpoints.hh:253
static void apply(const unsigned int order, LagrangePoint *&p)
Definition equidistantpoints.hh:254