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 >
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,
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);
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 >
226 static const unsigned int dimension = dim;
244 template<
class F,
unsigned int dim >
254 static void apply (
const unsigned int order, LagrangePoint *&p )
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 ) );
273 LagrangePoint *p = &(points_[ 0 ]);
274 ForLoop< Topology< T >::template Init, 0, dimension >::apply( order, p );
Definition: tensor.hh:165
static unsigned int setup(const unsigned int order, unsigned int *count, LagrangePoint< Field, dim > *points)
Definition: equidistantpoints.hh:91
Definition: equidistantpoints.hh:33
unsigned int index() const
Return offset within subentity.
Definition: localkey.hh:67
static void apply(const unsigned int order, LagrangePoint *&p)
Definition: equidistantpoints.hh:254
unsigned int subEntity() const
Return number of associated subentity.
Definition: localkey.hh:55
Vector point_
Definition: emptypoints.hh:39
Definition: equidistantpoints.hh:30
bool build()
Definition: equidistantpoints.hh:267
Describe position of one degree of freedom.
Definition: localkey.hh:21
Definition: equidistantpoints.hh:137
F Field
Definition: equidistantpoints.hh:150
EquidistantPointSet(unsigned int order)
Definition: equidistantpoints.hh:228
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:14
static unsigned int setup(const unsigned int order, unsigned int *count, LagrangePoint< Field, dim > *points)
Definition: equidistantpoints.hh:164
static bool supports(unsigned int order)
Definition: equidistantpoints.hh:236
F Field
Definition: equidistantpoints.hh:80
Definition: equidistantpoints.hh:24
Definition: emptypoints.hh:15
F Field
Definition: equidistantpoints.hh:44
Definition: equidistantpoints.hh:67
Definition: equidistantpoints.hh:252
LocalKey localKey_
Definition: emptypoints.hh:40
Definition: emptypoints.hh:47