1#ifndef DUNE_FEM_SPACE_LAGRANGE_LAGRANGEPOINTS_HH
2#define DUNE_FEM_SPACE_LAGRANGE_LAGRANGEPOINTS_HH
8#include <dune/geometry/referenceelements.hh>
33 template<
unsigned int topologyId,
unsigned int dim,
unsigned int polOrder >
41 static const unsigned int dimension = BaseType::dimension;
48 template<
unsigned int codim >
67 BaseType::dofSubEntity( codim, subEntity );
70 void dofSubEntity (
unsigned int &codim,
unsigned int &subEntity,
unsigned int &dofNumber )
72 BaseType::dofSubEntity( codim, subEntity, dofNumber );
78 return BaseType::entityDofNumber( codim, subEntity, dof );
82 template<
unsigned int dim,
unsigned int maxPolOrder >
98 unsigned int subEntity,
99 unsigned int dofNumber )
const = 0;
109 virtual unsigned int maxDofs (
unsigned int codim )
const = 0;
123 virtual unsigned int numDofs (
unsigned int codim,
unsigned int subEntity )
const = 0;
131 virtual unsigned int numDofs (
unsigned int codim )
const = 0;
139 template<
unsigned int topologyId,
unsigned int dim,
unsigned int maxPolOrder,
int polOrder >
150 entityDofNumber (
unsigned int codim,
unsigned int subEntity,
unsigned int dofNumber )
const
157 return GeometryType( topologyId, dim );
162 virtual unsigned int maxDofs (
unsigned int codim )
const
164 return LagrangePointType::maxDofs( codim );
170 numDofs (
unsigned int codim,
unsigned int subEntity )
const
172 return LagrangePointType::numDofs( codim, subEntity );
177 virtual unsigned int numDofs (
unsigned int codim )
const
179 return LagrangePointType::numDofs( codim );
182 virtual int order ()
const {
return polOrder; }
195 template<
class FieldImp,
int dim,
unsigned int maxPolOrder >
221 assert( lagrangePointImpl_ ) ;
222 return *lagrangePointImpl_;
229 lagrangePointImpl_( 0 )
234 delete lagrangePointImpl_;
241 assert( lagrangePointImpl_ == 0 );
242 lagrangePointImpl_ = lpImpl ;
247 return dofInfos_[ index ];
252 unsigned int &subEntity,
253 unsigned int &dofNumber )
const
262 unsigned int subEntity,
263 unsigned int dofNumber )
const
265 return lagrangePointImpl().
entityDofNumber( codim, subEntity, dofNumber );
279 unsigned int maxDofs (
unsigned int codim )
const
281 return lagrangePointImpl().
maxDofs( codim );
296 unsigned int numDofs (
unsigned int codim,
unsigned int subEntity )
const
298 return lagrangePointImpl().
numDofs( codim, subEntity );
307 unsigned int numDofs (
unsigned int codim )
const
309 return lagrangePointImpl().
numDofs( codim );
314 return lagrangePointImpl().
order();
320 dofInfos_.push_back(
dofInfo );
324 std::vector< LocalKey > dofInfos_;
325 const LagrangePointInterfaceType* lagrangePointImpl_;
329 template<
class FieldImp,
unsigned int topologyId,
unsigned int dim,
unsigned int maxPolOrder >
351 struct CreateLagrangePoint
359 if(
order != pOrd ) return ;
361 for(
unsigned int i = 0; i < numLagrangePoints; ++i )
363 LagrangePointType pt( i );
369 unsigned int codim, subEntity, dofNumber;
370 pt.dofSubEntity( codim, subEntity, dofNumber );
375 LagrangePointImplementationType;
401 template<
class FieldImp,
unsigned int topologyId,
unsigned int dim,
unsigned int maxPolOrder >
407 template<
class Field,
int dim,
unsigned int maxPolOrder >
423 template<
typename ct,
int quaddim >
459 template<
class Gr
idPart,
unsigned int maxPolOrder >
467 template<
class Gr
idPart,
int codim,
unsigned int polOrder >
487 typedef Dune::ReferenceElement< FieldType, dimension > ReferenceElementType;
488 typedef Dune::ReferenceElements< FieldType, dimension > ReferenceElementsType;
491 const unsigned int subEntity,
492 const bool beginIterator )
493 : lagrangePointSet_( &lagrangePointSet ),
494 refElement_( &ReferenceElementsType::general( lagrangePointSet_->geometryType() ) ),
495 subEntity_( subEntity ),
499 subSubEntity_( subEntity_ ),
501 numDofs_( lagrangePointSet_->numDofs(
codimension, subSubEntity_ ) )
509 : lagrangePointSet_( 0 ),
519 assert( lagrangePointSet_ );
522 return lagrangePointSet_->
entityDofNumber( codim_, subSubEntity_, dofNumber_ );
535 if( (other.codim_ != codim_)
536 || (other.subIndex_ != subIndex_)
537 || (other.dofNumber_ != dofNumber_) )
540 return (other.lagrangePointSet_ == lagrangePointSet_)
541 && (other.subEntity_ == subEntity_);
546 return !(*
this == other);
550 unsigned int subEntity )
552 return ThisType( lagrangePointSet, subEntity,
true );
556 unsigned int subEntity )
558 return ThisType( lagrangePointSet, subEntity,
false );
564 assert( lagrangePointSet_ );
565 assert( refElement_ );
567 while( dofNumber_ >= numDofs_ )
569 const ReferenceElementType &refElement = *refElement_;
573 while( subIndex_ >= numSubIndices_ )
578 numSubIndices_ = refElement.size( subEntity_,
codimension, codim_ );
580 subSubEntity_ = refElement.subEntity( subEntity_,
codimension, subIndex_, codim_ );
581 numDofs_ = lagrangePointSet_->
numDofs( codim_, subSubEntity_ );
586 const ReferenceElementType *refElement_;
587 unsigned int subEntity_;
590 unsigned int subIndex_, numSubIndices_;
591 unsigned int subSubEntity_;
592 unsigned int dofNumber_, numDofs_;
600 template<
class Gr
idPart,
unsigned int polOrder >
621 const unsigned int subEntity,
622 const bool beginIterator )
623 : lagrangePointSet_( &lagrangePointSet ),
624 numDofs_( lagrangePointSet_->size() ),
625 index_( beginIterator ? 0 : numDofs_ )
627 assert( subEntity == 0 );
632 : lagrangePointSet_( 0 ),
639 assert( lagrangePointSet_ );
640 assert( index_ < numDofs_ );
646 assert( index_ < numDofs_ );
653 return (other.index_ == index_)
654 && (other.lagrangePointSet_ == lagrangePointSet_);
659 return !(*
this == other);
664 unsigned int subEntity )
666 return ThisType( lagrangePointSet, subEntity,
true );
670 unsigned int subEntity )
672 return ThisType( lagrangePointSet, subEntity,
false );
677 unsigned int numDofs_, index_;
682 template<
class Gr
idPart,
unsigned int maxPolOrder >
684 :
public CachingPointList< GridPart, 0, LagrangePointSetTraits< typename GridPart::ctype, GridPart::dimension, maxPolOrder > >
703 template<
unsigned int codim >
712 typedef typename BaseType::IntegrationPointListType::IntegrationPointListType
713 LagrangePointListType;
718 :
BaseType( geometry, polynomialOrder ), lagrangePointList_( this->quadImp().ipList() )
723 :
BaseType( other ), lagrangePointList_( this->quadImp().ipList() )
730 return lagrangePointList_.dofInfo( index );
734 unsigned int &subEntity )
const
736 unsigned int dofNumber;
737 lagrangePointList_.dofSubEntity( index, codim, subEntity, dofNumber );
741 unsigned int &subEntity,
unsigned int &dofNumber )
const
743 lagrangePointList_.dofSubEntity( index, codim, subEntity, dofNumber );
747 unsigned int dofNumber )
const
749 return lagrangePointList_.entityDofNumber( codim, subEntity, dofNumber );
752 unsigned int maxDofs (
unsigned int codim )
const
754 return lagrangePointList_.maxDofs( codim );
757 unsigned int numDofs (
unsigned int codim,
unsigned int subEntity )
const
759 return lagrangePointList_.numDofs( codim, subEntity );
762 unsigned int numDofs (
unsigned int codim )
const
764 return lagrangePointList_.numDofs( codim );
773 template<
unsigned int codim >
780 template<
unsigned int codim >
788 const LagrangePointListType &lagrangePointList_;
Definition: bindguard.hh:11
Definition: forloop.hh:17
integration point list supporting base function caching
Definition: cachingpointlist.hh:103
actual interface class for integration point lists
Definition: quadrature.hh:161
IntegrationPointListType::CoordinateType CoordinateType
type of coordinate
Definition: quadrature.hh:180
Generic implementation of an IntegrationPointList.
Definition: quadratureimp.hh:33
void addIntegrationPoint(const CoordinateType &point)
Adds an integration point to the list.
Definition: quadratureimp.hh:169
size_t id() const
obtain the identifier of the integration point list
Definition: quadratureimp.hh:122
Definition: genericlagrangepoints.hh:21
A single lagrange point.
Definition: lagrangepoints.hh:36
void dofSubEntity(unsigned int &codim, unsigned int &subEntity)
Definition: lagrangepoints.hh:65
static const unsigned int numLagrangePoints
Definition: lagrangepoints.hh:46
static unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dof)
Definition: lagrangepoints.hh:76
static const unsigned int polynomialOrder
Definition: lagrangepoints.hh:45
static const unsigned int dimension
Definition: lagrangepoints.hh:41
LagrangePoint(unsigned int index)
Definition: lagrangepoints.hh:57
void dofSubEntity(unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: lagrangepoints.hh:70
LagrangePoint(const BaseType &point)
Definition: lagrangepoints.hh:61
BaseType::DofCoordinateType DofCoordinateType
Definition: lagrangepoints.hh:43
Definition: lagrangepoints.hh:50
static unsigned int maxDofs()
Definition: lagrangepoints.hh:51
Definition: lagrangepoints.hh:84
virtual unsigned int maxDofs(unsigned int codim) const =0
obtain the maximal number of DoFs in one entity of a codimension
virtual unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dofNumber) const =0
static const unsigned int maxPolynomialOrder
Definition: lagrangepoints.hh:92
virtual GeometryType geometryType() const =0
LagrangePointInterface()=default
static const unsigned int dimension
Definition: lagrangepoints.hh:90
virtual unsigned int numDofs(unsigned int codim, unsigned int subEntity) const =0
obtain the number of DoFs on one entity
virtual ~LagrangePointInterface()=default
destructor
static int maxOrder()
Definition: lagrangepoints.hh:111
virtual unsigned int numDofs(unsigned int codim) const =0
obtain the total number of DoFs in a codimension
virtual int order() const
Definition: lagrangepoints.hh:133
Definition: lagrangepoints.hh:142
virtual unsigned int maxDofs(unsigned int codim) const
obtain the maximal number of DoFs in one entity of a codimension
Definition: lagrangepoints.hh:162
virtual unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dofNumber) const
Definition: lagrangepoints.hh:150
virtual GeometryType geometryType() const
Definition: lagrangepoints.hh:155
virtual ~LagrangePointImplementation()=default
LagrangePointImplementation()=default
virtual int order() const
Definition: lagrangepoints.hh:182
virtual unsigned int numDofs(unsigned int codim, unsigned int subEntity) const
Definition: lagrangepoints.hh:170
virtual unsigned int numDofs(unsigned int codim) const
Definition: lagrangepoints.hh:177
Set of lagrange points.
Definition: lagrangepoints.hh:198
void dofSubEntity(unsigned int index, unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber) const
Definition: lagrangepoints.hh:250
~LagrangePointListInterface()
Definition: lagrangepoints.hh:232
unsigned int maxDofs(unsigned int codim) const
obtain the maximal number of DoFs in one entity of a codimension
Definition: lagrangepoints.hh:279
void setLagrangePointImpl(const LagrangePointInterfaceType *lpImpl)
Definition: lagrangepoints.hh:239
FieldVector< FieldType, dimension > CoordinateType
type of points
Definition: lagrangepoints.hh:213
unsigned int numDofs(unsigned int codim, unsigned int subEntity) const
obtain the number of DoFs on one entity
Definition: lagrangepoints.hh:296
static const int dimension
dimension of points
Definition: lagrangepoints.hh:207
LagrangePointListInterface(const size_t id)
Definition: lagrangepoints.hh:226
LagrangePointListInterface(const ThisType &)=delete
GeometryType geometryType() const
obtain GeometryType for this integration point list
Definition: lagrangepoints.hh:268
FieldImp FieldType
field type of points
Definition: lagrangepoints.hh:204
unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dofNumber) const
Definition: lagrangepoints.hh:261
static int maxOrder()
Definition: lagrangepoints.hh:284
static const unsigned int maxPolynomialOrder
polynomial order of corresponding base functions
Definition: lagrangepoints.hh:210
int order() const
obtain order of the integration point list
Definition: lagrangepoints.hh:312
const LocalKey & dofInfo(unsigned int index) const
Definition: lagrangepoints.hh:245
void addDofInfo(const LocalKey &dofInfo)
Definition: lagrangepoints.hh:318
unsigned int numDofs(unsigned int codim) const
obtain the total number of DoFs in a codimension
Definition: lagrangepoints.hh:307
Definition: lagrangepoints.hh:332
@ dimension
Definition: lagrangepoints.hh:341
LagrangePointListImplementation(const size_t id)
Definition: lagrangepoints.hh:380
FieldVector< FieldType, dimension > CoordinateType
type of points
Definition: lagrangepoints.hh:347
LagrangePointListImplementation(const ThisType &)=delete
FieldImp FieldType
field type of points
Definition: lagrangepoints.hh:338
static const int maxPolynomialOrder
polynomial order of corresponding base functions
Definition: lagrangepoints.hh:344
LagrangePointListImplementation(const GeometryType &geo, const int order, const size_t id)
Definition: lagrangepoints.hh:386
Definition: lagrangepoints.hh:409
static const int codimension
codimension of point set
Definition: lagrangepoints.hh:420
static const unsigned int maxPolynomialOrder
polynomial order of corresponding base functions
Definition: lagrangepoints.hh:414
Fem::IntegrationPointList< FieldType, dimension, PointListTraits > IntegrationPointListType
type of used integration point list
Definition: lagrangepoints.hh:451
static const int dimension
dimension of points
Definition: lagrangepoints.hh:417
Field FieldType
field type of coordinates
Definition: lagrangepoints.hh:411
IntegrationPointListType::CoordinateType CoordinateType
type of global coordinate
Definition: lagrangepoints.hh:454
default defines for used point lists
Definition: lagrangepoints.hh:425
LagrangePointListImplementation< ct,(1<<(dimension-1)) -1, dimension, maxPolynomialOrder > PyramidQuadratureType
Definition: lagrangepoints.hh:442
LagrangePointListInterface< ct, quaddim, maxPolynomialOrder > IntegrationPointListType
type of integration point list implemementation
Definition: lagrangepoints.hh:445
LagrangePointListImplementation< ct, 0, 0, maxPolynomialOrder > PointQuadratureType
Definition: lagrangepoints.hh:427
int QuadratureKeyType
Definition: lagrangepoints.hh:447
LagrangePointListImplementation< ct, 0, dimension, maxPolynomialOrder > SimplexQuadratureType
Definition: lagrangepoints.hh:433
LagrangePointListImplementation< ct, 0, 1, maxPolynomialOrder > LineQuadratureType
Definition: lagrangepoints.hh:430
LagrangePointListImplementation< ct,(1<<(dimension-1)), dimension, maxPolynomialOrder > PrismQuadratureType
Definition: lagrangepoints.hh:439
Definition: lagrangepoints.hh:685
BaseType::CoordinateType CoordinateType
Definition: lagrangepoints.hh:700
Codim< codim >::SubEntityIteratorType beginSubEntity(unsigned int subEntity) const
Definition: lagrangepoints.hh:775
unsigned int numDofs(unsigned int codim, unsigned int subEntity) const
Definition: lagrangepoints.hh:757
unsigned int maxDofs(unsigned int codim) const
Definition: lagrangepoints.hh:752
ThisType & operator=(const ThisType &)=delete
GridPartType::ctype FieldType
Definition: lagrangepoints.hh:694
Codim< codim >::SubEntityIteratorType endSubEntity(unsigned int subEntity) const
Definition: lagrangepoints.hh:782
void dofSubEntity(unsigned int index, unsigned int &codim, unsigned int &subEntity) const
Definition: lagrangepoints.hh:733
GridPart GridPartType
Definition: lagrangepoints.hh:692
void dofSubEntity(unsigned int index, unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber) const
Definition: lagrangepoints.hh:740
LagrangePointSet(const GeometryType &geometry, const int polynomialOrder)
constructor
Definition: lagrangepoints.hh:717
unsigned int numDofs(unsigned int codim) const
Definition: lagrangepoints.hh:762
const LocalKey & localKey(unsigned int index) const
Definition: lagrangepoints.hh:728
static const int dimension
Definition: lagrangepoints.hh:696
LagrangePointSet(const ThisType &other)
copy constructor
Definition: lagrangepoints.hh:722
unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dofNumber) const
Definition: lagrangepoints.hh:746
@ maxPolynomialOrder
Definition: lagrangepoints.hh:698
std::size_t size() const
get number of Lagrange points
Definition: lagrangepoints.hh:768
LagrangePointSetTraits< typename GridPart::ctype, GridPart::dimension, maxPolOrder > Traits
Definition: lagrangepoints.hh:690
Traits::CoordinateType PointType
Definition: lagrangepoints.hh:701
Definition: lagrangepoints.hh:469
static const int codimension
Definition: lagrangepoints.hh:478
GridPartType::ctype FieldType
Definition: lagrangepoints.hh:475
bool operator!=(const ThisType &other) const
Definition: lagrangepoints.hh:544
bool operator==(const ThisType &other) const
Definition: lagrangepoints.hh:533
FieldVector< FieldType, dimension > pointType
Definition: lagrangepoints.hh:482
GridPart GridPartType
Definition: lagrangepoints.hh:473
LagrangePointSet< GridPartType, polynomialOrder > LagrangePointSetType
Definition: lagrangepoints.hh:484
ThisType & operator++()
Definition: lagrangepoints.hh:525
static ThisType begin(const LagrangePointSetType &lagrangePointSet, unsigned int subEntity)
Definition: lagrangepoints.hh:549
static ThisType end(const LagrangePointSetType &lagrangePointSet, unsigned int subEntity)
Definition: lagrangepoints.hh:555
unsigned int operator*() const
Definition: lagrangepoints.hh:517
SubEntityLagrangePointIterator()
Definition: lagrangepoints.hh:508
static const int dimension
Definition: lagrangepoints.hh:477
static const unsigned int polynomialOrder
Definition: lagrangepoints.hh:480
Definition: lagrangepoints.hh:602
FieldVector< FieldType, dimension > pointType
Definition: lagrangepoints.hh:615
SubEntityLagrangePointIterator()
Definition: lagrangepoints.hh:631
LagrangePointSet< GridPartType, polynomialOrder > LagrangePointSetType
Definition: lagrangepoints.hh:617
static ThisType end(const LagrangePointSetType &lagrangePointSet, unsigned int subEntity)
Definition: lagrangepoints.hh:669
GridPart GridPartType
Definition: lagrangepoints.hh:606
static ThisType begin(const LagrangePointSetType &lagrangePointSet, unsigned int subEntity)
Definition: lagrangepoints.hh:663
GridPartType::ctype FieldType
Definition: lagrangepoints.hh:608
Definition: lagrangepoints.hh:705
SubEntityLagrangePointIterator< GridPartType, codim, maxPolynomialOrder > SubEntityIteratorType
type of iterator over DoF numbers in a subentity
Definition: lagrangepoints.hh:708
Definition: localkey.hh:21
unsigned int subEntity() const
Definition: localkey.hh:26
unsigned int index() const
Definition: localkey.hh:28
unsigned int codim() const
Definition: localkey.hh:27