1 #ifndef DUNE_EQUIDISTANTPOINTS_HH
2 #define DUNE_EQUIDISTANTPOINTS_HH
6 #include <dune/common/fvector.hh>
7 #include <dune/common/forloop.hh>
8 #include <dune/geometry/topologyfactory.hh>
9 #include <dune/geometry/genericgeometry/topologytypes.hh>
10 #include <dune/geometry/genericgeometry/subtopologies.hh>
21 template<
class F,
unsigned int dim >
22 class EquidistantPointSet;
27 template<
class Topology,
class F >
28 class EquidistantPointSetImpl;
31 class EquidistantPointSetImpl< GenericGeometry::Point, F >
35 typedef GenericGeometry::Point Topology;
38 friend class EquidistantPointSetImpl< GenericGeometry::Prism< Topology >, F >;
39 friend class EquidistantPointSetImpl< GenericGeometry::Pyramid< Topology >, F >;
44 static const unsigned int dimension = Topology::dimension;
46 static unsigned int size ( const unsigned int order )
52 template<
unsigned int codim,
unsigned int dim >
53 static unsigned int setup (
const unsigned int order,
59 points->
point_ = Field( 0 );
64 template<
class BaseTopology,
class F >
65 class EquidistantPointSetImpl< GenericGeometry::Prism< BaseTopology >, F >
67 typedef EquidistantPointSetImpl< GenericGeometry::Prism< BaseTopology >, F >
This;
69 typedef GenericGeometry::Prism< BaseTopology > Topology;
72 friend class EquidistantPointSetImpl< GenericGeometry::Prism< Topology >, F >;
73 friend class EquidistantPointSetImpl< GenericGeometry::Pyramid< Topology >, F >;
75 typedef EquidistantPointSetImpl< BaseTopology, F > BaseImpl;
80 static const unsigned int dimension = Topology::dimension;
82 static unsigned int size ( const unsigned int order )
84 return BaseImpl::size( order ) * (order+1);
88 template<
unsigned int codim,
unsigned int dim >
89 static unsigned int setup (
const unsigned int order,
93 unsigned int size = 0;
94 unsigned int numBaseN = 0;
96 if( codim < dimension )
98 const unsigned int vcodim = (codim < dimension ? codim : dimension-1);
100 for(
unsigned int i = 1; i < order; ++i )
102 const unsigned int n = BaseImpl::template setup< vcodim, dim >( order, count, points );
103 for(
unsigned int j = 0; j < n; ++j )
116 const unsigned int vcodim = (codim > 0 ? codim : 1);
117 const unsigned int numBaseM = GenericGeometry::Size< BaseTopology, vcodim-1 >
::value;
118 const unsigned int n = BaseImpl::template setup< vcodim-1, dim >( order, count+numBaseN, points );
119 for(
unsigned int j = 0; j < n; ++j )
124 points[ j + n ].
point_[ dimension-1 ] =
Field( 1 );
134 template<
class BaseTopology,
class F >
135 class EquidistantPointSetImpl< GenericGeometry::Pyramid< BaseTopology >, F >