dune-grid 3.0-git
common/grid.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_GRID_HH
4#define DUNE_GRID_HH
5
9// system includes
10#include <iostream>
11#include <string>
12#include <vector>
13
14// dune-common includes
15#include <dune/common/fvector.hh>
16#include <dune/common/typetraits.hh>
17#include <dune/common/deprecated.hh>
18
19// dune-geometry includes
20#include <dune/geometry/type.hh>
21
22// local includes
30
31// include this file after all other, because other files might undef the
32// macros that are defined in that file
33#include <dune/common/bartonnackmanifcheck.hh>
34
35namespace Dune {
36
333 // Forward Declarations
334 // --------------------
335
336 template<int mydim, int cdim, class GridImp,template<int,int,class> class GeometryImp> class Geometry;
337 template< int mydim, int cdim, class GridImp > class GlobalGeometryReference;
338 template< int mydim, int cdim, class GridImp > class LocalGeometryReference;
339 // dim is necessary because Entity will be specialized for codim==0 _and_ codim==dim
340 // EntityImp gets GridImp as 3rd template parameter to distinguish between const and mutable grid
341 template<int codim, int dim, class GridImp,template<int,int,class> class EntityImp> class Entity;
342 template< int codim, class Grid, class IteratorImp > class EntityIterator;
343 template<class GridImp, class EntitySeedImp> class EntitySeed;
344 template< class GridImp, class IntersectionImp > class Intersection;
345 template< class GridImp, class IntersectionIteratorImp, class IntersectionImp > class IntersectionIterator;
346 template< class GridImp, class IndexSetImp, class IndexTypeImp = unsigned int, class TypesImp = std::vector< GeometryType > > class IndexSet;
347 template<class GridImp, class IdSetImp, class IdTypeImp> class IdSet;
348
349
350 //************************************************************************
351 // G R I D
352 //************************************************************************
353
372 template< int dim, int dimworld, class ct, class GridFamily>
373 class Grid {
374 typedef typename GridFamily::Traits::Grid GridImp;
376 public:
377
378 //===========================================================
382 //===========================================================
383
385 enum {
387 dimension=dim
388 };
389
391 enum {
393 dimensionworld=dimworld
394 };
396
397 //===========================================================
401 //===========================================================
402
404 typedef typename GridFamily::Traits::LeafGridView LeafGridView;
406 typedef typename GridFamily::Traits::LevelGridView LevelGridView;
407
408
413 template <int cd>
414 struct Codim
415 {
417 typedef typename GridFamily::Traits::template Codim<cd>::Geometry Geometry;
418
420 typedef typename GridFamily::Traits::template Codim<cd>::LocalGeometry LocalGeometry;
421
423 typedef typename GridFamily::Traits::template Codim<cd>::Entity Entity;
424
426 typedef typename GridFamily::Traits::template Codim<cd>::EntitySeed EntitySeed;
427
429 template <PartitionIteratorType pitype>
431 {
438 typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LevelIterator LevelIterator;
445 typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LeafIterator LeafIterator;
446 };
447
450 typedef typename GridFamily::Traits::template Codim<cd>::LevelIterator LevelIterator;
451
454 typedef typename GridFamily::Traits::template Codim<cd>::LeafIterator LeafIterator;
455 };
456
460 typedef typename GridFamily::Traits::LeafIntersection LeafIntersection;
461
465 typedef typename GridFamily::Traits::LevelIntersection LevelIntersection;
466
472 typedef typename GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator;
473
479 typedef typename GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator;
480
486 typedef typename GridFamily::Traits::HierarchicIterator HierarchicIterator;
487
492 typedef typename GridFamily::Traits::LevelIndexSet LevelIndexSet;
493
498 typedef typename GridFamily::Traits::LeafIndexSet LeafIndexSet;
499
506 typedef typename GridFamily::Traits::GlobalIdSet GlobalIdSet;
507
513 typedef typename GridFamily::Traits::LocalIdSet LocalIdSet;
514
519 typedef typename GridFamily::Traits::CollectiveCommunication CollectiveCommunication;
520
522 typedef ct ctype;
524
525
526 //===========================================================
530 //===========================================================
531
535 int maxLevel() const
536 {
537 CHECK_INTERFACE_IMPLEMENTATION(asImp().maxLevel());
538 return asImp().maxLevel();
539 }
540
542 int size (int level, int codim) const
543 {
544 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,codim));
545 return asImp().size(level,codim);
546 }
547
549 int size (int codim) const
550 {
551 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(codim));
552 return asImp().size(codim);
553 }
554
556 int size (int level, GeometryType type) const
557 {
558 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,type));
559 return asImp().size(level,type);
560 }
561
563 int size (GeometryType type) const
564 {
565 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(type));
566 return asImp().size(type);
567 }
569
570
575 size_t numBoundarySegments () const
576 {
577 CHECK_INTERFACE_IMPLEMENTATION( asImp().numBoundarySegments());
578 return asImp().numBoundarySegments();
579 }
580
581 //===========================================================
585 //===========================================================
586
588 LevelGridView levelGridView(int level) const {
589 CHECK_INTERFACE_IMPLEMENTATION((asImp().levelGridView(level)));
590 return asImp().levelGridView(level);
591 }
592
595 CHECK_INTERFACE_IMPLEMENTATION((asImp().leafGridView()));
596 return asImp().leafGridView();
597 }
598
600
601
602 //===========================================================
606 //===========================================================
607
609 const GlobalIdSet &globalIdSet () const
610 {
611 CHECK_INTERFACE_IMPLEMENTATION(asImp().globalIdSet());
612 return asImp().globalIdSet();
613 }
614
616 const LocalIdSet &localIdSet () const
617 {
618 CHECK_INTERFACE_IMPLEMENTATION(asImp().localIdSet());
619 return asImp().localIdSet();
620 }
621
623 const LevelIndexSet &levelIndexSet ( int level ) const
624 {
625 CHECK_INTERFACE_IMPLEMENTATION(asImp().levelIndexSet(level));
626 return asImp().levelIndexSet(level);
627 }
628
631 {
632 CHECK_INTERFACE_IMPLEMENTATION(asImp().leafIndexSet());
633 return asImp().leafIndexSet();
634 }
636
637
638 //===========================================================
642 //===========================================================
643
649 void globalRefine (int refCount)
650 {
651 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(asImp().globalRefine(refCount));
652 return;
653 }
654
662 bool mark( int refCount, const typename Codim<0>::Entity & e )
663 {
664 return asImp().mark(refCount,e);
665 }
666
673 int getMark(const typename Codim<0>::Entity & e) const
674 {
675 return asImp().getMark(e);
676 }
677
684 bool preAdapt ()
685 {
686 return asImp().preAdapt();
687 }
688
703 bool adapt ()
704 {
705 return asImp().adapt();
706 }
707
713 {
714 return asImp().postAdapt();
715 }
717
718
719 //===========================================================
723 //===========================================================
724
726 DUNE_DEPRECATED_MSG("overlapSize() is deprecated. Use the method on the LevelGridView instead.")
727 int overlapSize (int level, int codim) const
728 {
729 CHECK_INTERFACE_IMPLEMENTATION(asImp().overlapSize(level,codim));
730 return asImp().overlapSize(level,codim);
731 }
732
734 DUNE_DEPRECATED_MSG("overlapSize() is deprecated. Use the method on the LeafGridView instead.")
735 int overlapSize (int codim) const
736 {
737 CHECK_INTERFACE_IMPLEMENTATION(asImp().overlapSize(codim));
738 return asImp().overlapSize(codim);
739 }
740
742 DUNE_DEPRECATED_MSG("ghostSize() is deprecated. Use the method on the LevelGridView instead.")
743 int ghostSize (int level, int codim) const
744 {
745 CHECK_INTERFACE_IMPLEMENTATION(asImp().ghostSize(level,codim));
746 return asImp().ghostSize(level,codim);
747 }
748
750 DUNE_DEPRECATED_MSG("ghostSize() is deprecated. Use the method on the LeafGridView instead.")
751 int ghostSize (int codim) const
752 {
753 CHECK_INTERFACE_IMPLEMENTATION(asImp().ghostSize(codim));
754 return asImp().ghostSize(codim);
755 }
756
768 template<class DataHandleImp, class DataTypeImp>
769 DUNE_DEPRECATED_MSG("communicate() is deprecated. Use the method on the LevelGridView instead.")
770 void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, InterfaceType iftype, CommunicationDirection dir, int level) const
771 {
772 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir,level)));
773 return;
774 }
775
786 template<class DataHandleImp, class DataTypeImp>
787 DUNE_DEPRECATED_MSG("communicate() is deprecated. Use the method on the LeafGridView instead.")
788 void communicate (CommDataHandleIF<DataHandleImp,DataTypeImp> & data, InterfaceType iftype, CommunicationDirection dir) const
789 {
790 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir)));
791 return;
792 }
793
796 {
797 CHECK_INTERFACE_IMPLEMENTATION(asImp().comm());
798 return asImp().comm();
799 }
801
806 {
807 CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance());
808 return asImp().loadBalance();
809 }
810
818 template<class DataHandle>
819 bool loadBalance (DataHandle& data)
820 {
821 CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance(data));
822 return asImp().loadBalance(data);
823 }
824
826 template < class EntitySeed >
827 typename Codim< EntitySeed :: codimension > :: Entity
828 entity( const EntitySeed& seed ) const
829 {
830 //CHECK_INTERFACE_IMPLEMENTATION( asImp().entity( seed ) );
831 return asImp().entity( seed );
832 }
833 protected:
835 GridImp& asImp () {return static_cast<GridImp &> (*this);}
837 const GridImp& asImp () const {return static_cast<const GridImp &>(*this);}
838 };
839
840#undef CHECK_INTERFACE_IMPLEMENTATION
841#undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
842
859 template<int dim, int dimworld, class ct, class GridFamily>
862 {
863 return grid.levelGridView(level);
864 }
865
876 template<int dim, int dimworld, class ct, class GridFamily>
879 {
880 return grid.leafGridView();
881 }
882
919 template<int dim,
920 int dimworld,
921 class ct,
922 class GridFamily>
923 class GridDefaultImplementation : public Grid <dim,dimworld,ct,GridFamily>
924 {
925 typedef typename GridFamily::Traits::Grid GridImp;
926
927 public:
933 typedef typename GridFamily::Traits Traits;
934
936 typename Traits::LevelGridView levelGridView(int level) const
937 {
938 typedef typename Traits::LevelGridView View;
939 typedef typename View::GridViewImp ViewImp;
940 return View(ViewImp(asImp(),level));
941 }
942
944 typename Traits::LeafGridView leafGridView() const
945 {
946 typedef typename Traits::LeafGridView View;
947 typedef typename View::GridViewImp ViewImp;
948 return View(ViewImp(asImp()));
949 }
950
951 //***************************************************************
952 // Interface for Adaptation
953 //***************************************************************
954
977 bool mark( int refCount, const typename Traits :: template Codim<0>::Entity & e )
978 {
979 return false;
980 }
981
989 int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const
990 {
991 return 0;
992 }
993
1001 bool adapt () { return false; }
1002
1004 bool preAdapt () { return false; }
1005
1007 void postAdapt() {}
1008
1010 int ghostSize (int level, int codim) const { return 0; }
1011
1013 int overlapSize (int level, int codim) const { return 0; }
1014
1016 int ghostSize (int codim) const { return 0; }
1017
1019 int overlapSize (int codim) const { return 0; }
1020
1022 template<class DataHandleImp, class DataTypeImp>
1026
1028 template<class DataHandleImp, class DataTypeImp>
1032
1035 {
1036 return false;
1037 }
1038
1040 template<class DataHandle>
1041 bool loadBalance (DataHandle& data)
1042 {
1043 return false;
1044 }
1045
1046 protected:
1053 template<class T>
1055 : public T // implement friendship via subclassing
1056 {
1057 public:
1059 typedef typename T::Implementation ImplementationType;
1060 private:
1061 // constructor in only need to compile
1062 ReturnImplementationType(const T& t) : T(t) {}
1063 };
1064
1065 template<class T>
1067 : public T // implement friendship via subclassing
1068 {
1069 public:
1070 typedef const typename T::Implementation ImplementationType;
1071 private:
1072 // constructor in only need to compile
1073 ReturnImplementationType(const T& t) : T(t) {}
1074 };
1075
1077 // This rather involved return type computation does the following:
1078 //
1079 // 1) It detects whether the function was passed an lvalue or an
1080 // rvalue by checking whether InterfaceType is a reference (in which
1081 // case the argument is an lvalue). This relies on the special template
1082 // matching rules for unqualified rvalue references.
1083 // 2) If it is an lvalue, it
1084 // - strips the reference from InterfaceType
1085 // - uses the resulting type to extract the implementation type
1086 // - re-adds an lvalue reference
1087 // This procedure transfers a possible cv-qualification from the
1088 // interface type to the implementation type
1089 // 3) If it is an lvalue, it
1090 // - strips the reference anyway. This is required to make this TMP
1091 // compile if the other branch (lvalue) is taken because in that
1092 // case, the compiler still evaluates the rvalue result and without
1093 // the reference stripping step, it would pass a reference into
1094 // ReturnImplementationType, which would in turn cause a compiler
1095 // error.
1096 // - looks up the implementation type with the stripped interface type
1097 // - removes a possible const from the result; the type is a temporary
1098 // anyway, so there is no reason to keep the const qualifier around.
1099 template <class InterfaceType>
1100 static typename std::conditional<
1101 std::is_reference<
1103 >::value,
1104 typename std::add_lvalue_reference<
1105 typename ReturnImplementationType<
1106 typename std::remove_reference<
1108 >::type
1109 >::ImplementationType
1110 >::type,
1111 typename std::remove_const<
1112 typename ReturnImplementationType<
1113 typename std::remove_reference<
1115 >::type
1116 >::ImplementationType
1117 >::type
1118 >::type
1119 getRealImplementation (InterfaceType &&i) { return i.impl(); }
1120
1121
1122 protected:
1123 using Grid< dim, dimworld, ct, GridFamily >::asImp;
1124 };
1125
1139 template <int dim, int dimw, class GridImp,
1140 template<int,int,class> class GeometryImp,
1141 template<int,int,class> class EntityImp,
1142 template<int,PartitionIteratorType,class> class LevelIteratorImp,
1143 template<class> class LeafIntersectionImp,
1144 template<class> class LevelIntersectionImp,
1145 template<class> class LeafIntersectionIteratorImp,
1146 template<class> class LevelIntersectionIteratorImp,
1147 template<class> class HierarchicIteratorImp,
1148 template<int,PartitionIteratorType,class> class LeafIteratorImp,
1149 class LevelIndexSetImp, class LeafIndexSetImp,
1150 class GlobalIdSetImp, class GIDType, class LocalIdSetImp, class LIDType, class CCType,
1151 template<class> class LevelGridViewTraits,
1152 template<class> class LeafGridViewTraits,
1153 template<int,class> class EntitySeedImp,
1154 template<int,int,class> class LocalGeometryImp = GeometryImp
1155 >
1157 {
1159 typedef GridImp Grid;
1160
1169
1172
1177 template <int cd>
1178 struct Codim
1179 {
1180 public:
1181 typedef GeometryImp<dim-cd, dimw, const GridImp> GeometryImpl;
1182 typedef LocalGeometryImp<dim-cd, dim, const GridImp> LocalGeometryImpl;
1184
1185 typedef Dune::Geometry<dim-cd, dimw, const GridImp, GeometryImp> Geometry;
1187 typedef Dune::Geometry<dim-cd, dim, const GridImp, LocalGeometryImp> LocalGeometry;
1189 // we could - if needed - introduce another struct for dimglobal of Geometry
1191
1194
1199 template <PartitionIteratorType pitype>
1207
1210
1213
1214 private:
1215 friend class Dune::Entity<cd, dim, const GridImp, EntityImp>;
1216 };
1217
1222
1231
1234 };
1235
1236 // Definition of capabilities for the interface class
1237 namespace Capabilities
1238 {
1239
1240 // capabilities for the interface class depend on the implementation
1241 template< int dim, int dimworld, typename ct, class GridFamily , int codim >
1242 struct hasEntity< Grid< dim, dimworld, ct, GridFamily >, codim >
1243 {
1245 };
1246
1247 // capabilities for the interface class depend on the implementation
1248 template< int dim, int dimworld, typename ct, class GridFamily , int cdim >
1249 struct hasEntity< GridDefaultImplementation<dim,dimworld,ct,GridFamily>, cdim >
1250 {
1252 typedef typename GridType::Traits::Grid GridImp;
1253 static const bool v = hasEntity<GridImp,cdim>::v;
1254 };
1255
1256 } // end namespace Capabilities
1257
1263 template <class InterfaceType>
1265 {
1266 typedef typename InterfaceType::Implementation ImplementationType;
1269 : InterfaceType( realImp )
1270 {}
1271 };
1272}
1273
1274#include "geometry.hh"
1275#include "entity.hh"
1276#include "entitypointer.hh"
1277#include "intersection.hh"
1278#include "intersectioniterator.hh"
1279#include "entityiterator.hh"
1280#include "indexidset.hh"
1281
1282#endif // #ifndef DUNE_GRID_HH
Describes the parallel communication interface class for MessageBuffers and DataHandles.
Provides base classes for index and id sets.
CommunicationDirection
Define a type for communication direction parameter.
Definition gridenums.hh:168
InterfaceType
Parameter to be used for the communication functions.
Definition gridenums.hh:84
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
leaf grid view for the given grid
Definition common/grid.hh:878
Grid< dim, dimworld, ct, GridFamily >::LevelGridView levelGridView(const Grid< dim, dimworld, ct, GridFamily > &grid, int level)
level grid view for the given grid and level.
Definition common/grid.hh:861
Include standard header files.
Definition agrid.hh:60
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition common/intersection.hh:162
Definition geometryreference.hh:91
Specialize with 'true' for all codims that a grid implements entities for. (default=false)
Definition common/capabilities.hh:56
static const bool v
Definition common/capabilities.hh:57
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition datahandleif.hh:73
Wrapper class for entities.
Definition common/entity.hh:62
interface class for an iterator over grid entities
Definition entityiterator.hh:37
Store a reference to an entity with a minimal memory footprint.
Definition common/entityseed.hh:24
Definition common/grid.hh:924
static std::conditional< std::is_reference< InterfaceType >::value, typenamestd::add_lvalue_reference< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type, typenamestd::remove_const< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type getRealImplementation(InterfaceType &&i)
return real implementation of interface class
Definition common/grid.hh:1119
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition common/grid.hh:1029
bool adapt()
Refine all positive marked leaf entities coarsen all negative marked entities if possible.
Definition common/grid.hh:1001
bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition common/grid.hh:977
void postAdapt()
clean up some markers
Definition common/grid.hh:1007
int getMark(const typename Traits::template Codim< 0 >::Entity &e) const
returns adaptation mark for given entity, i.e. here the default implementation returns 0.
Definition common/grid.hh:989
int ghostSize(int level, int codim) const
ghostSize is zero by default
Definition common/grid.hh:1010
bool preAdapt()
returns true, if at least one entity is marked for adaption
Definition common/grid.hh:1004
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Definition common/grid.hh:1023
bool loadBalance(DataHandle &data)
default implementation of load balance does nothing and returns false
Definition common/grid.hh:1041
int ghostSize(int codim) const
ghostSize is zero by default
Definition common/grid.hh:1016
int overlapSize(int level, int codim) const
overlapSize is zero by default
Definition common/grid.hh:1013
Traits::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition common/grid.hh:944
bool loadBalance()
default implementation of load balance does nothing and returns false
Definition common/grid.hh:1034
Traits::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition common/grid.hh:936
GridFamily::Traits Traits
The traits of this class.
Definition common/grid.hh:933
int overlapSize(int codim) const
overlapSize is zero by default
Definition common/grid.hh:1019
Wrapper class for geometries.
Definition common/geometry.hh:66
Definition common/grid.hh:337
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition common/intersectioniterator.hh:81
Index Set Interface base class.
Definition indexidset.hh:76
Id Set Interface.
Definition indexidset.hh:397
Grid abstract base class.
Definition common/grid.hh:373
const LevelIndexSet & levelIndexSet(int level) const
return const reference to the grids level index set for level level
Definition common/grid.hh:623
int size(int level, GeometryType type) const
Return number of entities per level and geometry type in this process.
Definition common/grid.hh:556
GridFamily::Traits::LocalIdSet LocalIdSet
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entiti...
Definition common/grid.hh:513
GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine,...
Definition common/grid.hh:472
int size(int level, int codim) const
Return number of grid entities of a given codim on a given level in this process.
Definition common/grid.hh:542
bool preAdapt()
To be called after entities have been marked and before adapt() is called.
Definition common/grid.hh:684
GridFamily::Traits::LevelIndexSet LevelIndexSet
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent,...
Definition common/grid.hh:492
GridFamily::Traits::CollectiveCommunication CollectiveCommunication
A type that is a model of Dune::CollectiveCommunication. It provides a portable way for collective co...
Definition common/grid.hh:519
GridImp & asImp()
Barton-Nackman trick.
Definition common/grid.hh:835
GridFamily::Traits::HierarchicIterator HierarchicIterator
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
Definition common/grid.hh:486
GridFamily::Traits::LevelGridView LevelGridView
type of view for level grid
Definition common/grid.hh:406
GridFamily::Traits::LeafIntersection LeafIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition common/grid.hh:460
@ dimension
The dimension of the grid.
Definition common/grid.hh:387
GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine,...
Definition common/grid.hh:479
LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition common/grid.hh:594
GridFamily::Traits::GlobalIdSet GlobalIdSet
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entiti...
Definition common/grid.hh:506
const GridImp & asImp() const
Barton-Nackman trick.
Definition common/grid.hh:837
void postAdapt()
To be called after grid has been adapted and information left over by the adaptation has been process...
Definition common/grid.hh:712
@ dimensionworld
The dimension of the world the grid lives in.
Definition common/grid.hh:393
bool mark(int refCount, const typename Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition common/grid.hh:662
Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
obtain Entity from EntitySeed.
Definition common/grid.hh:828
GridFamily::Traits::LeafIndexSet LeafIndexSet
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent,...
Definition common/grid.hh:498
int ghostSize(int level, int codim) const
Return size of ghost region for a given codim on a given level.
Definition common/grid.hh:743
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest lev...
Definition common/grid.hh:535
size_t numBoundarySegments() const
returns the number of boundary segments within the macro grid
Definition common/grid.hh:575
const GlobalIdSet & globalIdSet() const
return const reference to the grids global id set
Definition common/grid.hh:609
int getMark(const typename Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition common/grid.hh:673
GridFamily::Traits::LevelIntersection LevelIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition common/grid.hh:465
const LeafIndexSet & leafIndexSet() const
return const reference to the grids leaf index set
Definition common/grid.hh:630
const LocalIdSet & localIdSet() const
return const reference to the grids local id set
Definition common/grid.hh:616
LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition common/grid.hh:588
bool loadBalance(DataHandle &data)
Re-balances the load each process has to handle for a parallel grid and moves the data.
Definition common/grid.hh:819
GridFamily::Traits::LeafGridView LeafGridView
type of view for leaf grid
Definition common/grid.hh:404
bool loadBalance()
Re-balances the load each process has to handle for a parallel grid,.
Definition common/grid.hh:805
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Communicate information on distributed entities on a given level Template parameter is a model of Dun...
Definition common/grid.hh:770
int overlapSize(int level, int codim) const
Return size of overlap for a given codim on a given level.
Definition common/grid.hh:727
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Definition common/grid.hh:703
int size(int codim) const
Return number of leaf entities of a given codim in this process.
Definition common/grid.hh:549
ct ctype
Define type used for coordinates in grid module.
Definition common/grid.hh:522
void globalRefine(int refCount)
Refine the grid refCount times using the default refinement rule.
Definition common/grid.hh:649
int size(GeometryType type) const
Return number of leaf entities per geometry type in this process.
Definition common/grid.hh:563
const CollectiveCommunication & comm() const
return const reference to a collective communication object. The return type is a model of Dune::Coll...
Definition common/grid.hh:795
A Traits struct that collects all associated types of one implementation.
Definition common/grid.hh:415
GridFamily::Traits::template Codim< cd >::Entity Entity
A type that is a model of a Dune::Entity<cd,dim,...>.
Definition common/grid.hh:423
GridFamily::Traits::template Codim< cd >::LocalGeometry LocalGeometry
A type that is a model of Dune::Geometry<dim-cd,dim>.
Definition common/grid.hh:420
GridFamily::Traits::template Codim< cd >::LevelIterator LevelIterator
A type that is a model of Dune::LevelIterator with partition type All_Partition.
Definition common/grid.hh:450
GridFamily::Traits::template Codim< cd >::Geometry Geometry
A type that is a model of Dune::Geometry<dim-cd,dimworld>.
Definition common/grid.hh:417
GridFamily::Traits::template Codim< cd >::EntitySeed EntitySeed
A type that is a model (not yet) of Dune::EntitySeed<cd,dim,...>.
Definition common/grid.hh:426
GridFamily::Traits::template Codim< cd >::LeafIterator LeafIterator
A type that is a model of Dune::LeafIterator with partition type All_Partition.
Definition common/grid.hh:454
A struct collecting all types depending on the partition iterator type.
Definition common/grid.hh:431
GridFamily::Traits::template Codim< cd >::template Partition< pitype >::LevelIterator LevelIterator
A type that is a model of Dune::LevelIterator<cd,pitype,...> which is s type of iterator that may be ...
Definition common/grid.hh:438
GridFamily::Traits::template Codim< cd >::template Partition< pitype >::LeafIterator LeafIterator
A type that is a model of Dune::LeafIterator<cd,pitype,...> which is a type of iterator that may be u...
Definition common/grid.hh:445
Helper class to choose correct implementation return type for getRealImplementation.
Definition common/grid.hh:1056
T::Implementation ImplementationType
The correct type of the implementation to return.
Definition common/grid.hh:1059
const T::Implementation ImplementationType
Definition common/grid.hh:1070
A traits struct that collects all associated types of one grid model.
Definition common/grid.hh:1157
Dune::IntersectionIterator< const GridImp, LeafIntersectionIteratorImp< const GridImp >, LeafIntersectionImp< const GridImp > > LeafIntersectionIterator
The type of the intersection iterator at the leafs of the grid.
Definition common/grid.hh:1166
IdSet< const GridImp, LocalIdSetImp, LIDType > LocalIdSet
The type of the local id set.
Definition common/grid.hh:1230
Dune::GridView< LeafGridViewTraits< const GridImp > > LeafGridView
type of view for leaf grid
Definition common/grid.hh:1219
IdSet< const GridImp, GlobalIdSetImp, GIDType > GlobalIdSet
The type of the global id set.
Definition common/grid.hh:1228
Dune::EntityIterator< 0, const GridImp, HierarchicIteratorImp< const GridImp > > HierarchicIterator
The type of the hierarchic iterator.
Definition common/grid.hh:1171
IndexSet< const GridImp, LeafIndexSetImp > LeafIndexSet
The type of the leaf index set.
Definition common/grid.hh:1226
Dune::Intersection< const GridImp, LeafIntersectionImp< const GridImp > > LeafIntersection
The type of the intersection at the leafs of the grid.
Definition common/grid.hh:1162
IndexSet< const GridImp, LevelIndexSetImp > LevelIndexSet
The type of the level index set.
Definition common/grid.hh:1224
Dune::GridView< LevelGridViewTraits< const GridImp > > LevelGridView
type of view for level grid
Definition common/grid.hh:1221
Dune::IntersectionIterator< const GridImp, LevelIntersectionIteratorImp< const GridImp >, LevelIntersectionImp< const GridImp > > LevelIntersectionIterator
The type of the intersection iterator at the levels of the grid.
Definition common/grid.hh:1168
Dune::Intersection< const GridImp, LevelIntersectionImp< const GridImp > > LevelIntersection
The type of the intersection at the levels of the grid.
Definition common/grid.hh:1164
CCType CollectiveCommunication
The type of the collective communication.
Definition common/grid.hh:1233
GridImp Grid
The type that implements the grid.
Definition common/grid.hh:1159
Traits associated with a specific codim.
Definition common/grid.hh:1179
Partition< All_Partition >::LevelIterator LevelIterator
The type of the entity pointer for entities of this codim.
Definition common/grid.hh:1212
Dune::EntitySeed< const GridImp, EntitySeedImp< cd, const GridImp > > EntitySeed
The type of the entity seed of this codim.
Definition common/grid.hh:1193
LocalGeometryImp< dim-cd, dim, const GridImp > LocalGeometryImpl
Definition common/grid.hh:1182
GeometryImp< dim-cd, dimw, const GridImp > GeometryImpl
Definition common/grid.hh:1181
Dune::Geometry< dim-cd, dim, const GridImp, LocalGeometryImp > LocalGeometry
The type of the local geometry associated with the entity.
Definition common/grid.hh:1187
Dune::Geometry< dim-cd, dimw, const GridImp, GeometryImp > Geometry
IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
Definition common/grid.hh:1185
Dune::Entity< cd, dim, const GridImp, EntityImp > Entity
The type of the entity.
Definition common/grid.hh:1190
Partition< All_Partition >::LeafIterator LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition common/grid.hh:1209
Traits associated with a specific grid partition type.
Definition common/grid.hh:1201
Dune::EntityIterator< cd, const GridImp, LevelIteratorImp< cd, pitype, const GridImp > > LevelIterator
The type of the iterator over the level entities of this codim on this partition.
Definition common/grid.hh:1203
Dune::EntityIterator< cd, const GridImp, LeafIteratorImp< cd, pitype, const GridImp > > LeafIterator
The type of the iterator over the leaf entities of this codim on this partition.
Definition common/grid.hh:1205
GridDefaultImplementation< dim, dimworld, ct, GridFamily > GridType
Definition common/grid.hh:1251
Definition common/grid.hh:1265
InterfaceType::Implementation ImplementationType
Definition common/grid.hh:1266
MakeableInterfaceObject(const ImplementationType &realImp)
create interface object by calling the contructor of the base class
Definition common/grid.hh:1268
Grid view abstract base class.
Definition common/gridview.hh:60
A set of traits classes to store static information about grid implementation.
Wrapper and interface class for a static iterator (EntityPointer)
Interface class EntitySeed.