dune-fem  2.4.1-rc
genericlagrangepoints.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_LAGRANGE_GENERICLAGRANGEPOINTS_HH
2 #define DUNE_FEM_SPACE_LAGRANGE_GENERICLAGRANGEPOINTS_HH
3 
4 // C++ includes
5 #include <iostream>
6 
7 // dune-common includes
8 #include <dune/common/fvector.hh>
9 
10 // local includes
11 #include "genericgeometry.hh"
12 
13 
14 namespace Dune
15 {
16 
17  namespace Fem
18  {
19 
20  template< class GenericGeometryType, unsigned int order, bool bottom = true >
22 
23 
24  template< unsigned int order, bool bottom >
25  class GenericLagrangePoint< PointGeometry, order, bottom >
26  {
27  public:
29  static const unsigned int dimension = GeometryType::dimension;
30 
32 
33  static const unsigned int polynomialOrder = order;
34 
35  template< class, unsigned int, bool >
36  friend class GenericLagrangePoint;
37 
38  template< class, class, unsigned int >
40 
41  private:
43 
44  public:
45  static const unsigned int numLagrangePoints = 1;
46 
47  protected:
48  DofCoordinateType dofCoordinate_;
49 
50  public:
51  template< unsigned int codim >
52  struct Codim;
53 
54  public:
55  GenericLagrangePoint ( unsigned int index )
56  {
57  dofCoordinate( index, dofCoordinate_ );
58  }
59 
60  GenericLagrangePoint ( const ThisType &point )
61  : dofCoordinate_( point.dofCoordinate_ )
62  {}
63 
64  template< class LocalCoordinateType >
65  static void dofSubEntity ( LocalCoordinateType &coordinate,
66  unsigned int &codim,
67  unsigned int &subEntity )
68  {
69  codim = 0;
70  subEntity = 0;
71  }
72 
73  template< class LocalCoordinateType >
74  static void dofSubEntity ( LocalCoordinateType &coordinate,
75  unsigned int &codim,
76  unsigned int &subEntity,
77  unsigned int &dofNumber )
78  {
79  codim = 0;
80  subEntity = 0;
81  dofNumber = 0;
82  }
83 
84  void dofSubEntity ( unsigned int &codim,
85  unsigned int &subEntity )
86  {
87  dofSubEntity( dofCoordinate_, codim, subEntity );
88  }
89 
90  void dofSubEntity ( unsigned int &codim,
91  unsigned int &subEntity,
92  unsigned int &dofNumber )
93  {
94  dofSubEntity( dofCoordinate_, codim, subEntity, dofNumber );
95  }
96 
97  static unsigned int entityDofNumber ( unsigned int codim,
98  unsigned int subEntity,
99  unsigned int dof )
100  {
101  //assert( (codim == 0) && (subEntity == 0) && (dof == 0) );
102  return 0;
103  }
104 
105  template< class LocalCoordinateType >
106  static unsigned int height ( LocalCoordinateType &coordinate )
107  {
108  return polynomialOrder;
109  }
110 
111  unsigned int height ()
112  {
113  return height( dofCoordinate_ );
114  }
115 
116  template< class FieldType >
117  void local ( FieldVector< FieldType, dimension > &coordinate ) const
118  {
119  const FieldType factor = FieldType( 1 ) / FieldType( polynomialOrder );
120  for( unsigned int i = 0; i < dimension; ++i )
121  coordinate[ i ] = factor * dofCoordinate_[ i ];
122  }
123 
130  static unsigned int maxDofs ( unsigned int codim )
131  {
132  return ((codim == 0) ? 1 : 0);
133  }
134 
142  static unsigned int numDofs ( unsigned int codim, unsigned int subEntity )
143  {
144  return ((codim == 0) ? 1 : 0);
145  }
146 
153  static unsigned int numDofs ( unsigned int codim )
154  {
155  return ((codim == 0) ? 1 : 0);
156  }
157 
158  protected:
159  template< class LocalCoordinateType >
160  static inline void dofCoordinate ( unsigned int index,
161  LocalCoordinateType &coordinate )
162  {
163  assert( index <= numLagrangePoints );
164  coordinate = 0;
165  }
166  };
167 
168 
170  template< unsigned int order, bool bottom >
171  template< unsigned int codim >
172  struct GenericLagrangePoint< PointGeometry, order, bottom >::Codim
173  {
174  static unsigned int maxDofs ()
175  {
176  return ((codim == 0) ? 1 : 0);
177  }
178  };
182  template< class BaseGeometry, bool bottom >
183  class GenericLagrangePoint< PyramidGeometry< BaseGeometry >, 0, bottom >
184  {
185  public:
186  typedef BaseGeometry BaseGeometryType;
188 
189  static const unsigned int dimension = GeometryType::dimension;
190 
192 
193  static const unsigned int polynomialOrder = 0;
194 
195  template< class, unsigned int, bool >
196  friend class GenericLagrangePoint;
197 
198  template< class, class, unsigned int >
200 
201  private:
203 
204  public:
205  static const unsigned int numLagrangePoints = 1;
206 
207  protected:
208  DofCoordinateType dofCoordinate_;
209 
210  public:
211  template< unsigned int codim >
212  struct Codim;
213 
214  public:
215  GenericLagrangePoint ( unsigned int index )
216  {
217  dofCoordinate( index, dofCoordinate_ );
218  }
219 
220  GenericLagrangePoint ( const ThisType &point )
221  : dofCoordinate_( point.dofCoordinate_ )
222  {}
223 
224  template< class LocalCoordinateType >
225  static void dofSubEntity ( LocalCoordinateType &coordinate,
226  unsigned int &codim,
227  unsigned int &subEntity )
228  {
229  codim = (bottom ? 0 : dimension);
230  subEntity = 0;
231  }
232 
233  template< class LocalCoordinateType >
234  static void dofSubEntity ( LocalCoordinateType &coordinate,
235  unsigned int &codim,
236  unsigned int &subEntity,
237  unsigned int &dofNumber )
238  {
239  codim = (bottom ? 0 : dimension);
240  subEntity = 0;
241  dofNumber = 0;
242  }
243 
244  void dofSubEntity ( unsigned int &codim,
245  unsigned int &subEntity )
246  {
247  dofSubEntity( dofCoordinate_, codim, subEntity );
248  }
249 
250  void dofSubEntity ( unsigned int &codim,
251  unsigned int &subEntity,
252  unsigned int &dofNumber )
253  {
254  dofSubEntity( dofCoordinate_, codim, subEntity, dofNumber );
255  }
256 
257  static unsigned int entityDofNumber ( unsigned int codim,
258  unsigned int subEntity,
259  unsigned int dof )
260  {
261  return 0;
262  }
263 
264  template< class LocalCoordinateType >
265  static unsigned int height ( LocalCoordinateType &coordinate )
266  {
267  return polynomialOrder;
268  }
269 
270  unsigned int height ()
271  {
272  return height( dofCoordinate_ );
273  }
274 
275  template< class FieldType >
276  void local ( FieldVector< FieldType, dimension > &coordinate ) const
277  {
278  const FieldType factor = FieldType( 1 ) / FieldType( polynomialOrder );
279  for( unsigned int i = 0; i < dimension; ++i )
280  coordinate[ i ] = factor * dofCoordinate_[ i ];
281  }
282 
289  static unsigned int maxDofs ( unsigned int codim )
290  {
291  if( bottom )
292  return ((codim == 0) ? 1 : 0);
293  else
294  return ((codim == dimension) ? 1 : 0);
295  }
296 
304  static unsigned int numDofs ( unsigned int codim, unsigned int subEntity )
305  {
306  if( bottom )
307  return ((codim == 0) ? 1 : 0);
308  else
309  return ((codim == dimension) ? 1 : 0);
310  }
311 
318  static unsigned int numDofs ( unsigned int codim )
319  {
320  if( bottom )
321  return ((codim == 0) ? 1 : 0);
322  else
323  return ((codim == dimension) ? 1 : 0);
324  }
325 
326  protected:
327  template< class LocalCoordinateType >
328  static void dofCoordinate ( unsigned int index,
329  LocalCoordinateType &coordinate )
330  {
331  assert( index <= numLagrangePoints );
332  coordinate = 0;
333  }
334  };
335 
336 
338  template< class BaseGeometry, bool bottom >
339  template< unsigned int codim >
340  struct GenericLagrangePoint< PyramidGeometry< BaseGeometry >, 0, bottom >::Codim
341  {
342  static inline unsigned int maxDofs ()
343  {
344  if( bottom )
345  return ((codim == 0) ? 1 : 0);
346  else
347  return ((codim == dimension) ? 1 : 0);
348  }
349  };
353  template< class BaseGeometry, unsigned int order, bool bottom >
354  class GenericLagrangePoint< PyramidGeometry< BaseGeometry >, order, bottom >
355  {
356  public:
357  typedef BaseGeometry BaseGeometryType;
359  static const unsigned int dimension = GeometryType :: dimension;
360 
362 
363  static const unsigned int polynomialOrder = order;
364 
365  template< class, unsigned int, bool >
366  friend class GenericLagrangePoint;
367 
368  template< class, class, unsigned int >
370 
371  private:
373 
374  typedef GenericLagrangePoint< GeometryType, polynomialOrder - 1, false >
378 
379  public:
380  static const unsigned int numLagrangePoints
381  = DimensionReductionType::numLagrangePoints + OrderReductionType::numLagrangePoints;
382 
383  protected:
384  DofCoordinateType dofCoordinate_;
385 
386  public:
387  template< unsigned int codim >
388  struct Codim;
389 
390  public:
391  GenericLagrangePoint ( unsigned int index )
392  {
393  dofCoordinate( index, dofCoordinate_ );
394  }
395 
396  GenericLagrangePoint ( const ThisType &point )
397  : dofCoordinate_( point.dofCoordinate_ )
398  {}
399 
400  template< class LocalCoordinateType >
401  static void dofSubEntity ( LocalCoordinateType &coordinate,
402  unsigned int &codim,
403  unsigned int &subEntity )
404  {
405  if( !useDimReduction( coordinate ) )
406  {
407  --(*coordinate);
408  OrderReductionType::dofSubEntity( coordinate, codim, subEntity );
409  ++(*coordinate);
410 
411  if( bottom && (codim > 0) )
412  subEntity += BaseGeometryType::numSubEntities( codim - 1 );
413  }
414  else
415  {
416  DimensionReductionType::dofSubEntity( coordinate.base(), codim, subEntity );
417  if( bottom )
418  ++codim;
419  }
420  }
421 
422  template< class LocalCoordinateType >
423  static void dofSubEntity ( LocalCoordinateType &coordinate,
424  unsigned int &codim,
425  unsigned int &subEntity,
426  unsigned int &dofNumber )
427  {
428  if( !useDimReduction( coordinate ) )
429  {
430  --(*coordinate);
431  OrderReductionType::template dofSubEntity( coordinate, codim, subEntity, dofNumber );
432  ++(*coordinate);
433 
434  if( bottom )
435  subEntity += (codim > 0 ? BaseGeometryType :: numSubEntities( codim - 1 ) : 0);
436  else
437  dofNumber += DimensionReductionType::numDofs( codim, subEntity );
438  }
439  else
440  {
441  DimensionReductionType::dofSubEntity( coordinate.base(), codim, subEntity, dofNumber );
442  if( bottom )
443  ++codim;
444  }
445  }
446 
447 
448  void dofSubEntity ( unsigned int &codim,
449  unsigned int &subEntity )
450  {
451  dofSubEntity( dofCoordinate_, codim, subEntity );
452  }
453 
454  void dofSubEntity ( unsigned int &codim,
455  unsigned int &subEntity,
456  unsigned int &dofNumber )
457  {
458  dofSubEntity( dofCoordinate_, codim, subEntity, dofNumber );
459  }
460 
461  static unsigned int entityDofNumber ( unsigned int codim,
462  unsigned int subEntity,
463  unsigned int dof )
464  {
465  if( bottom )
466  {
467  if( codim == 0 )
468  return OrderReductionType::entityDofNumber( codim, subEntity, dof )
469  + DimensionReductionType::numLagrangePoints;
470 
471  const unsigned int numBaseSubEntities
472  = BaseGeometryType::numSubEntities( codim - 1 );
473  if( subEntity >= numBaseSubEntities )
474  return OrderReductionType::entityDofNumber( codim, subEntity - numBaseSubEntities, dof )
475  + DimensionReductionType::numLagrangePoints;
476  else
477  return DimensionReductionType::entityDofNumber( codim - 1, subEntity, dof );
478  }
479  else
480  {
481  const unsigned int numBaseEntityDofs
482  = DimensionReductionType::numDofs( codim, subEntity );
483  if( dof >= numBaseEntityDofs )
484  return OrderReductionType::entityDofNumber( codim, subEntity, dof - numBaseEntityDofs )
485  + DimensionReductionType::numLagrangePoints;
486  else
487  return DimensionReductionType::entityDofNumber( codim, subEntity, dof );
488  }
489  }
490 
491  template< class LocalCoordinateType >
492  static unsigned int height ( LocalCoordinateType &coordinate )
493  {
494  if( !useDimReduction( coordinate ) ) {
495  --(*coordinate);
496  unsigned int h = OrderReductionType :: height( coordinate );
497  ++(*coordinate);
498  return h;
499  } else
500  return DimensionReductionType :: height( coordinate.base() );
501  }
502 
503  unsigned int height ()
504  {
505  return height( dofCoordinate_ );
506  }
507 
508  template< class FieldType >
509  void local ( FieldVector< FieldType, dimension > &coordinate ) const
510  {
511  const FieldType factor = FieldType( 1 ) / FieldType( polynomialOrder );
512  for( unsigned int i = 0; i < dimension; ++i )
513  coordinate[ i ] = factor * dofCoordinate_[ i ];
514  }
515 
522  static unsigned int maxDofs ( unsigned int codim )
523  {
524  const unsigned int maxOrderDofs
525  = OrderReductionType::maxDofs( codim );
526 
527  if( bottom && (codim == 0) )
528  return maxOrderDofs;
529 
530  const unsigned int maxDimDofs
531  = DimensionReductionType::maxDofs( bottom ? codim - 1 : codim );
532 
533  return (bottom ? std::max( maxDimDofs, maxOrderDofs )
534  : maxDimDofs + maxOrderDofs);
535  }
536 
544  static unsigned int numDofs ( unsigned int codim, unsigned int subEntity )
545  {
546  if( bottom )
547  {
548  if( bottom && (codim == 0) )
549  return OrderReductionType::numDofs( codim, subEntity );
550 
551  const unsigned int numBaseSubEntities
552  = BaseGeometryType::numSubEntities( codim - 1 );
553  if( subEntity < numBaseSubEntities )
554  return DimensionReductionType::numDofs( codim - 1, subEntity );
555  else
556  return OrderReductionType::numDofs( codim, subEntity - numBaseSubEntities );
557  }
558  else
559  {
560  return DimensionReductionType::numDofs( codim, subEntity )
561  + OrderReductionType::numDofs( codim, subEntity );
562  }
563  }
564 
571  static unsigned int numDofs ( unsigned int codim )
572  {
573  if( bottom )
574  {
575  const unsigned int orderDofs = OrderReductionType::numDofs( codim );
576  if( codim > 0 )
577  return orderDofs + DimensionReductionType::numDofs( codim - 1 );
578  else
579  return orderDofs;
580  }
581  else
582  {
583  return DimensionReductionType::numDofs( codim )
584  + OrderReductionType::numDofs( codim );
585  }
586  }
587 
588  template< class LocalCoordinateType >
589  static bool useDimReduction ( const LocalCoordinateType &coordinate )
590  {
591  return (*coordinate == 0);
592  }
593 
594  protected:
595  template< class LocalCoordinateType >
596  static void dofCoordinate ( unsigned int index,
597  LocalCoordinateType &coordinate )
598  {
599  assert( index <= numLagrangePoints );
600 
601  if( index < DimensionReductionType::numLagrangePoints )
602  {
603  (*coordinate) = 0;
604  DimensionReductionType :: dofCoordinate( index, coordinate.base() );
605  }
606  else
607  {
608  const int orderIndex = index - DimensionReductionType::numLagrangePoints;
609  OrderReductionType::dofCoordinate( orderIndex, coordinate );
610  ++(*coordinate);
611  }
612  }
613  };
614 
615 
617  template< class BaseGeometry, unsigned int order, bool bottom >
618  template< unsigned int codim >
619  struct GenericLagrangePoint< PyramidGeometry< BaseGeometry >, order, bottom >::Codim
620  {
621  static unsigned int maxDofs ()
622  {
623  const unsigned int maxOrderDofs
624  = OrderReductionType::template Codim< codim >::maxDofs();
625 
626  const unsigned int maxDimDofs
627  = DimensionReductionType::template Codim< (bottom ? codim - 1 : codim) >::maxDofs();
628 
629  if( bottom )
630  return std::max( maxDimDofs, maxOrderDofs );
631  else
632  return maxDimDofs + maxOrderDofs;
633  }
634  };
638  template< class FirstGeometry, class SecondGeometry, unsigned int order, bool bottom >
639  class GenericLagrangePoint< ProductGeometry< FirstGeometry, SecondGeometry >, order, bottom >
640  {
641  public:
643  static const unsigned int dimension = GeometryType::dimension;
644 
646 
647  static const unsigned int polynomialOrder = order;
648 
649  template< class, unsigned int, bool >
650  friend class GenericLagrangePoint;
651 
652  template< class, class, unsigned int >
654 
655  private:
657 
660 
661  public:
662  static const unsigned int numLagrangePoints
663  = FirstReductionType::numLagrangePoints * SecondReductionType::numLagrangePoints;
664 
665  protected:
666  DofCoordinateType dofCoordinate_;
667 
668  private:
669  template< unsigned int codim, unsigned int i >
670  struct CodimIterator;
671 
672  public:
673  template< unsigned int codim >
674  struct Codim;
675 
676  public:
677  GenericLagrangePoint ( unsigned int index )
678  {
679  dofCoordinate( index, dofCoordinate_ );
680  }
681 
682  GenericLagrangePoint ( const ThisType &point )
683  : dofCoordinate_( point.dofCoordinate_ )
684  {}
685 
686  template< class LocalCoordinateType >
687  static void dofSubEntity( LocalCoordinateType &coordinate,
688  unsigned int &codim,
689  unsigned int &subEntity )
690  {
691  unsigned int firstCodim, secondCodim;
692  unsigned int firstSubEntity, secondSubEntity;
693 
694  FirstReductionType::dofSubEntity( coordinate.first(), firstCodim, firstSubEntity );
695  SecondReductionType::dofSubEntity( coordinate.second(), secondCodim, secondSubEntity );
696 
697  codim = firstCodim + secondCodim;
698 
699  subEntity = 0;
700  for( unsigned int i = 0; i < secondCodim; ++i )
701  subEntity += FirstGeometry::numSubEntities( codim-i ) * SecondGeometry::numSubEntities( i );
702  subEntity += firstSubEntity + secondSubEntity * FirstGeometry::numSubEntities( firstCodim );
703  }
704 
705  template< class LocalCoordinateType >
706  static void dofSubEntity( LocalCoordinateType &coordinate,
707  unsigned int &codim,
708  unsigned int &subEntity,
709  unsigned int &dofNumber )
710  {
711  unsigned int firstCodim, secondCodim;
712  unsigned int firstSubEntity, secondSubEntity;
713  unsigned int firstDofNumber, secondDofNumber;
714 
715  FirstReductionType::dofSubEntity( coordinate.first(), firstCodim, firstSubEntity, firstDofNumber );
716  SecondReductionType::dofSubEntity( coordinate.second(), secondCodim, secondSubEntity, secondDofNumber );
717 
718  codim = firstCodim + secondCodim;
719 
720  subEntity = 0;
721  for( unsigned int i = 0; i < secondCodim; ++i )
722  subEntity += FirstGeometry::numSubEntities( codim-i ) * SecondGeometry::numSubEntities( i );
723  subEntity += firstSubEntity + secondSubEntity * FirstGeometry::numSubEntities( firstCodim );
724 
725  dofNumber = firstDofNumber + secondDofNumber * FirstReductionType::numDofs( firstCodim, firstSubEntity );
726  }
727 
728  void dofSubEntity ( unsigned int &codim, unsigned int &subEntity )
729  {
730  dofSubEntity( dofCoordinate_, codim, subEntity );
731  }
732 
733  void dofSubEntity ( unsigned int &codim,
734  unsigned int &subEntity,
735  unsigned int &dofNumber )
736  {
737  dofSubEntity( dofCoordinate_, codim, subEntity, dofNumber );
738  }
739 
740  static unsigned int entityDofNumber ( unsigned int codim,
741  unsigned int subEntity,
742  unsigned int dofNumber )
743  {
744  unsigned int firstCodim = codim;
745  unsigned int secondCodim = 0;
746  for( ; secondCodim < codim; --firstCodim, ++secondCodim )
747  {
748  const unsigned int num
749  = FirstGeometry::numSubEntities( firstCodim ) * SecondGeometry::numSubEntities( secondCodim );
750 
751  if( subEntity < num )
752  break;
753  subEntity -= num;
754  }
755 
756  const unsigned int n = FirstGeometry::numSubEntities( firstCodim );
757  const unsigned int firstSubEntity = subEntity % n;
758  const unsigned int secondSubEntity = subEntity / n;
759 
760  const unsigned int m = FirstReductionType::numDofs( firstCodim, firstSubEntity );
761  const unsigned int firstDofNumber = dofNumber % m;
762  const unsigned int secondDofNumber = dofNumber / m;
763 
764  const unsigned int firstEntityDofNumber
765  = FirstReductionType::entityDofNumber( firstCodim, firstSubEntity, firstDofNumber );
766  const unsigned int secondEntityDofNumber
767  = SecondReductionType::entityDofNumber( secondCodim, secondSubEntity, secondDofNumber );
768 
769  return firstEntityDofNumber + secondEntityDofNumber * FirstReductionType::numLagrangePoints;
770  }
771 
772  template< class LocalCoordinateType >
773  static unsigned int height ( LocalCoordinateType &coordinate )
774  {
775  const unsigned int firstHeight = FirstReductionType::height( coordinate.first() );
776  const unsigned int secondHeight = SecondReductionType::height( coordinate.second() );
777 
778  return ((firstHeight < secondHeight) ? firstHeight : secondHeight);
779  }
780 
781  unsigned int height ()
782  {
783  return height( dofCoordinate_ );
784  }
785 
786  template< class FieldType >
787  void local ( FieldVector< FieldType, dimension > &coordinate ) const
788  {
789  const FieldType factor = FieldType( 1 ) / FieldType( polynomialOrder );
790  for( unsigned int i = 0; i < dimension; ++i )
791  coordinate[ i ] = factor * dofCoordinate_[ i ];
792  }
793 
800  static unsigned int maxDofs ( unsigned int codim )
801  {
802  unsigned int max = 0;
803  for( unsigned int i = 0; i <= codim; ++i ) {
804  const unsigned int n
805  = FirstReductionType :: maxDofs( codim - i )
806  * SecondReductionType :: maxDofs( i );
807  max = (max >= n) ? max : n;
808  }
809  return max;
810  }
811 
819  static unsigned int numDofs ( unsigned int codim, unsigned int subEntity )
820  {
821  unsigned int firstCodim = codim;
822  unsigned int secondCodim = 0;
823  for( ; secondCodim <= codim; --firstCodim, ++secondCodim )
824  {
825  const unsigned int numSubEntities
826  = FirstGeometry::numSubEntities( firstCodim ) * SecondGeometry :: numSubEntities( secondCodim );
827 
828  if( subEntity < numSubEntities )
829  break;
830  subEntity -= numSubEntities;
831  }
832 
833  const unsigned int n = FirstGeometry::numSubEntities( firstCodim );
834  const unsigned int firstSubEntity = subEntity % n;
835  const unsigned int secondSubEntity = subEntity / n;
836 
837  return FirstReductionType :: numDofs( firstCodim, firstSubEntity )
838  * SecondReductionType :: numDofs( secondCodim, secondSubEntity );
839  }
840 
847  static unsigned int numDofs ( unsigned int codim )
848  {
849  unsigned int count = 0;
850 
851  unsigned int firstCodim = codim;
852  unsigned int secondCodim = 0;
853  for( ; secondCodim <= codim; --firstCodim, ++secondCodim )
854  count += FirstReductionType :: numDofs( firstCodim )
855  * SecondReductionType :: numDofs( secondCodim );
856 
857  return count;
858  }
859 
860  protected:
861  template< class LocalCoordinateType >
862  static void dofCoordinate ( unsigned int index,
863  LocalCoordinateType &coordinate )
864  {
865  assert( index <= numLagrangePoints );
866 
867  const unsigned int firstIndex
868  = index % FirstReductionType :: numLagrangePoints;
869  const unsigned int secondIndex
870  = index / FirstReductionType :: numLagrangePoints;
871 
872  FirstReductionType :: dofCoordinate( firstIndex, coordinate.first() );
873  SecondReductionType :: dofCoordinate( secondIndex, coordinate.second() );
874  }
875  };
876 
877 
879  template< class FirstGeometry, class SecondGeometry, unsigned int order, bool bottom >
880  template< unsigned int codim >
881  struct GenericLagrangePoint< ProductGeometry< FirstGeometry, SecondGeometry >, order, bottom >::Codim
882  {
883  static unsigned int maxDofs ()
884  {
885  return CodimIterator< codim, codim >::maxDofs();
886  }
887  };
892  template< class FirstGeometry, class SecondGeometry, unsigned int order, bool bottom >
893  template< unsigned int codim, unsigned int i >
894  struct GenericLagrangePoint< ProductGeometry< FirstGeometry, SecondGeometry >, order, bottom >::CodimIterator
895  {
896  static unsigned int maxDofs ()
897  {
898  if( i == 0 )
899  {
900  typedef typename FirstReductionType::template Codim< codim > FirstCodim;
901  typedef typename SecondReductionType::template Codim< 0 > SecondCodim;
902  return FirstCodim::maxDofs() * SecondCodim::maxDofs();
903  }
904  else
905  {
906  typedef typename FirstReductionType::template Codim< codim-i > FirstCodim;
907  typedef typename SecondReductionType::template Codim< i > SecondCodim;
908  const unsigned int n = FirstCodim::maxDofs() * SecondCodim::maxDofs();
909 
910  const unsigned int m = CodimIterator< codim, i-1 >::maxDofs();
911  return std::max( m, n );
912  }
913  }
914  };
917  } // namespace Fem
918 
919 } // namespace Dune
920 
921 #endif // #ifndef DUNE_FEM_SPACE_LAGRANGE_GENERICLAGRANGEPOINTS_HH
unsigned int height()
Definition: genericlagrangepoints.hh:503
static void dofCoordinate(unsigned int index, LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:862
static unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dof)
Definition: genericlagrangepoints.hh:461
BaseGeometry BaseGeometryType
Definition: genericlagrangepoints.hh:357
static unsigned int numDofs(unsigned int codim)
obtain the total number of DoFs in a codimension
Definition: genericlagrangepoints.hh:318
static unsigned int maxDofs(unsigned int codim)
obtain the maximal number of DoFs in one entity of a codimension
Definition: genericlagrangepoints.hh:130
unsigned int height()
Definition: genericlagrangepoints.hh:111
void dofSubEntity(unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:448
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:234
Definition: genericlagrangepoints.hh:21
static void dofCoordinate(unsigned int index, LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:160
static unsigned int numDofs(unsigned int codim, unsigned int subEntity)
obtain the number of DoFs on one entity
Definition: genericlagrangepoints.hh:819
void dofSubEntity(unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:454
void local(FieldVector< FieldType, dimension > &coordinate) const
Definition: genericlagrangepoints.hh:276
void dofSubEntity(unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:733
static bool useDimReduction(const LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:589
GenericLagrangePoint(const ThisType &point)
Definition: genericlagrangepoints.hh:60
static constexpr T max(T a)
Definition: utility.hh:65
static unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dof)
Definition: genericlagrangepoints.hh:97
GenericLagrangePoint(const ThisType &point)
Definition: genericlagrangepoints.hh:396
GenericLagrangePoint(unsigned int index)
Definition: genericlagrangepoints.hh:391
static unsigned int numDofs(unsigned int codim)
obtain the total number of DoFs in a codimension
Definition: genericlagrangepoints.hh:153
DofCoordinateType dofCoordinate_
Definition: genericlagrangepoints.hh:208
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:74
void dofSubEntity(unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:90
static void dofCoordinate(unsigned int index, LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:328
DofCoordinateType dofCoordinate_
Definition: genericlagrangepoints.hh:48
generic geometry modelling a pyramid over a base geometry
Definition: genericgeometry.hh:89
static unsigned int numDofs(unsigned int codim, unsigned int subEntity)
obtain the number of DoFs on one entity
Definition: genericlagrangepoints.hh:142
static unsigned int height(LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:492
PointGeometry GeometryType
Definition: genericlagrangepoints.hh:28
static double max(const Double &v, const double p)
Definition: double.hh:387
static unsigned int height(LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:106
LocalCoordinate< GeometryType, unsigned int > DofCoordinateType
Definition: genericlagrangepoints.hh:31
static unsigned int numDofs(unsigned int codim)
obtain the total number of DoFs in a codimension
Definition: genericlagrangepoints.hh:571
static unsigned int height(LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:773
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:65
GenericLagrangePoint(unsigned int index)
Definition: genericlagrangepoints.hh:55
static unsigned int maxDofs(unsigned int codim)
obtain the maximal number of DoFs in one entity of a codimension
Definition: genericlagrangepoints.hh:289
void local(FieldVector< FieldType, dimension > &coordinate) const
Definition: genericlagrangepoints.hh:117
GenericLagrangePoint(const ThisType &point)
Definition: genericlagrangepoints.hh:682
Definition: coordinate.hh:4
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:423
PyramidGeometry< BaseGeometryType > GeometryType
Definition: genericlagrangepoints.hh:358
static unsigned int maxDofs(unsigned int codim)
obtain the maximal number of DoFs in one entity of a codimension
Definition: genericlagrangepoints.hh:800
generic geometry modelling a single point
Definition: genericgeometry.hh:60
void local(FieldVector< FieldType, dimension > &coordinate) const
Definition: genericlagrangepoints.hh:787
void local(FieldVector< FieldType, dimension > &coordinate) const
Definition: genericlagrangepoints.hh:509
unsigned int height()
Definition: genericlagrangepoints.hh:270
LocalCoordinate< GeometryType, unsigned int > DofCoordinateType
Definition: genericlagrangepoints.hh:645
LocalCoordinate< GeometryType, unsigned int > DofCoordinateType
Definition: genericlagrangepoints.hh:191
static void dofCoordinate(unsigned int index, LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:596
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:401
static unsigned int height(LocalCoordinateType &coordinate)
Definition: genericlagrangepoints.hh:265
void dofSubEntity(unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:728
void dofSubEntity(unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:250
GenericLagrangePoint(const ThisType &point)
Definition: genericlagrangepoints.hh:220
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity, unsigned int &dofNumber)
Definition: genericlagrangepoints.hh:706
GenericLagrangePoint(unsigned int index)
Definition: genericlagrangepoints.hh:215
BaseGeometry BaseGeometryType
Definition: genericlagrangepoints.hh:186
DofCoordinateType dofCoordinate_
Definition: genericlagrangepoints.hh:384
GenericLagrangePoint(unsigned int index)
Definition: genericlagrangepoints.hh:677
generic geometry modelling the product of two base geometries
Definition: genericgeometry.hh:134
ProductGeometry< FirstGeometry, SecondGeometry > GeometryType
Definition: genericlagrangepoints.hh:642
static unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dofNumber)
Definition: genericlagrangepoints.hh:740
Definition: genericbasefunctions.hh:15
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:225
static unsigned int maxDofs(unsigned int codim)
obtain the maximal number of DoFs in one entity of a codimension
Definition: genericlagrangepoints.hh:522
PyramidGeometry< BaseGeometryType > GeometryType
Definition: genericlagrangepoints.hh:187
static void dofSubEntity(LocalCoordinateType &coordinate, unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:687
void dofSubEntity(unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:244
static unsigned int numDofs(unsigned int codim, unsigned int subEntity)
obtain the number of DoFs on one entity
Definition: genericlagrangepoints.hh:304
static const Point & coordinate(const Point &x)
Definition: coordinate.hh:11
static unsigned int entityDofNumber(unsigned int codim, unsigned int subEntity, unsigned int dof)
Definition: genericlagrangepoints.hh:257
static unsigned int numDofs(unsigned int codim)
obtain the total number of DoFs in a codimension
Definition: genericlagrangepoints.hh:847
LocalCoordinate< GeometryType, unsigned int > DofCoordinateType
Definition: genericlagrangepoints.hh:361
static unsigned int numDofs(unsigned int codim, unsigned int subEntity)
obtain the number of DoFs on one entity
Definition: genericlagrangepoints.hh:544
void dofSubEntity(unsigned int &codim, unsigned int &subEntity)
Definition: genericlagrangepoints.hh:84