Dune Core Modules (2.3.1)

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
13// dune-common includes
16
17// dune-geometry includes
18#include <dune/geometry/type.hh>
19
20// local includes
21#include <dune/grid/common/gridenums.hh>
22#include <dune/grid/common/exceptions.hh>
25#include <dune/grid/common/gridview.hh>
26#include <dune/grid/common/defaultgridview.hh>
28
29// include this file after all other, because other files might undef the
30// macros that are defined in that file
32
33namespace Dune {
34
345 // Forward Declarations
346 // --------------------
347
348 template<int mydim, int cdim, class GridImp,template<int,int,class> class GeometryImp> class Geometry;
349 template< int mydim, int cdim, class GridImp > class GlobalGeometryReference;
350 template< int mydim, int cdim, class GridImp > class LocalGeometryReference;
351 // dim is necessary because Entity will be specialized for codim==0 _and_ codim==dim
352 // EntityImp gets GridImp as 3rd template parameter to distinguish between const and mutable grid
353 template<int codim, int dim, class GridImp,template<int,int,class> class EntityImp> class Entity;
354 template<class GridImp, class EntityPointerImp> class EntityPointer;
355 template< int codim, class Grid, class IteratorImp > class EntityIterator;
356 template<class GridImp, class EntitySeedImp> class EntitySeed;
357 template< class GridImp, class IntersectionImp > class Intersection;
358 template< class GridImp, class IntersectionIteratorImp, class IntersectionImp > class IntersectionIterator;
359 template<class GridImp, class IndexSetImp, class IndexTypeImp=unsigned int> class IndexSet;
360 template<class GridImp, class IdSetImp, class IdTypeImp> class IdSet;
361
362
363 //************************************************************************
364 // G R I D
365 //************************************************************************
366
385 template< int dim, int dimworld, class ct, class GridFamily>
386 class Grid {
387 typedef typename GridFamily::Traits::Grid GridImp;
389 public:
390
391 //===========================================================
395 //===========================================================
396
398 enum {
400 dimension=dim
401 };
402
404 enum {
406 dimensionworld=dimworld
407 };
409
410 //===========================================================
414 //===========================================================
415
417 template <PartitionIteratorType pitype>
419 {
420 typedef typename GridFamily::Traits::template Partition<pitype>::LevelGridView
421 LevelGridView;
422 typedef typename GridFamily::Traits::template Partition<pitype>::LeafGridView
423 LeafGridView;
424 };
427 typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
428
429
434 template <int cd>
435 struct Codim
436 {
438 typedef typename GridFamily::Traits::template Codim<cd>::Geometry Geometry;
439
441 typedef typename GridFamily::Traits::template Codim<cd>::LocalGeometry LocalGeometry;
442
444 typedef typename GridFamily::Traits::template Codim<cd>::Entity Entity;
445
447 typedef typename GridFamily::Traits::template Codim<cd>::EntityPointer EntityPointer;
448
450 typedef typename GridFamily::Traits::template Codim<cd>::EntitySeed EntitySeed;
451
453 template <PartitionIteratorType pitype>
455 {
462 typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LevelIterator LevelIterator;
469 typedef typename GridFamily::Traits::template Codim<cd>::template Partition<pitype>::LeafIterator LeafIterator;
470 };
471
474 typedef typename GridFamily::Traits::template Codim<cd>::LevelIterator LevelIterator;
475
478 typedef typename GridFamily::Traits::template Codim<cd>::LeafIterator LeafIterator;
479 };
480
484 typedef typename GridFamily::Traits::LeafIntersection LeafIntersection;
485
489 typedef typename GridFamily::Traits::LevelIntersection LevelIntersection;
490
496 typedef typename GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator;
497
503 typedef typename GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator;
504
510 typedef typename GridFamily::Traits::HierarchicIterator HierarchicIterator;
511
516 typedef typename GridFamily::Traits::LevelIndexSet LevelIndexSet;
517
522 typedef typename GridFamily::Traits::LeafIndexSet LeafIndexSet;
523
530 typedef typename GridFamily::Traits::GlobalIdSet GlobalIdSet;
531
537 typedef typename GridFamily::Traits::LocalIdSet LocalIdSet;
538
543 typedef typename GridFamily::Traits::CollectiveCommunication CollectiveCommunication;
544
546 typedef ct ctype;
548
549
550 //===========================================================
554 //===========================================================
555
559 int maxLevel() const
560 {
561 CHECK_INTERFACE_IMPLEMENTATION(asImp().maxLevel());
562 return asImp().maxLevel();
563 }
564
566 int size (int level, int codim) const
567 {
568 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,codim));
569 return asImp().size(level,codim);
570 }
571
573 int size (int codim) const
574 {
575 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(codim));
576 return asImp().size(codim);
577 }
578
580 int size (int level, GeometryType type) const
581 {
582 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(level,type));
583 return asImp().size(level,type);
584 }
585
587 int size (GeometryType type) const
588 {
589 CHECK_INTERFACE_IMPLEMENTATION(asImp().size(type));
590 return asImp().size(type);
591 }
593
594
599 size_t numBoundarySegments () const
600 {
601 CHECK_INTERFACE_IMPLEMENTATION( asImp().numBoundarySegments());
602 return asImp().numBoundarySegments();
603 }
604
605 //===========================================================
609 //===========================================================
610
612 template<PartitionIteratorType pitype>
613 typename Partition<pitype>::LevelGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.") levelView(int level) const {
614 CHECK_INTERFACE_IMPLEMENTATION((asImp().template levelView<pitype>(level)));
615 return asImp().template levelView<pitype>(level);
616 }
617
619 template<PartitionIteratorType pitype>
620 typename Partition<pitype>::LeafGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to leafGridView.") leafView() const {
621 CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafView<pitype>()));
622 return asImp().template leafView<pitype>();
623 }
624
626 LevelGridView levelView(int level) const DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.") {
627 CHECK_INTERFACE_IMPLEMENTATION((asImp().levelView(level)));
628 return asImp().levelView(level);
629 }
630
632 LeafGridView leafView() const DUNE_DEPRECATED_MSG("The method leafView has been renamed to leafGridView.") {
633 CHECK_INTERFACE_IMPLEMENTATION((asImp().leafView()));
634 return asImp().leafView();
635 }
636
638 template<PartitionIteratorType pitype>
639 typename Partition<pitype>::LevelGridView levelGridView(int level) const {
640 CHECK_INTERFACE_IMPLEMENTATION((asImp().template levelGridView<pitype>(level)));
641 return asImp().template levelGridView<pitype>(level);
642 }
643
645 template<PartitionIteratorType pitype>
646 typename Partition<pitype>::LeafGridView leafGridView() const {
647 CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafGridView<pitype>()));
648 return asImp().template leafGridView<pitype>();
649 }
650
652 LevelGridView levelGridView(int level) const {
653 CHECK_INTERFACE_IMPLEMENTATION((asImp().levelGridView(level)));
654 return asImp().levelGridView(level);
655 }
656
658 LeafGridView leafGridView() const {
659 CHECK_INTERFACE_IMPLEMENTATION((asImp().leafGridView()));
660 return asImp().leafGridView();
661 }
662
664
665
666 //===========================================================
670 //===========================================================
671
673 template<int cd, PartitionIteratorType pitype>
675 {
676 CHECK_INTERFACE_IMPLEMENTATION((asImp().template lbegin<cd,pitype>(level)));
677 return asImp().template lbegin<cd,pitype>(level);
678 }
679
681 template<int cd, PartitionIteratorType pitype>
683 {
684 CHECK_INTERFACE_IMPLEMENTATION((asImp().template lend<cd,pitype>(level)));
685 return asImp().template lend<cd,pitype>(level);
686 }
687
689 template<int cd>
691 {
692 CHECK_INTERFACE_IMPLEMENTATION((asImp().template lbegin<cd>(level)));
693 return asImp().template lbegin<cd>(level);
694 }
695
697 template<int cd>
699 {
700 CHECK_INTERFACE_IMPLEMENTATION((asImp().template lend<cd>(level)));
701 return asImp().template lend<cd>(level);
702 }
703
705 template<int cd, PartitionIteratorType pitype>
707 {
708 CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafbegin<cd,pitype>()));
709 return asImp().template leafbegin<cd,pitype>();
710 }
711
713 template<int cd, PartitionIteratorType pitype>
715 {
716 CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafend<cd,pitype>()));
717 return asImp().template leafend<cd,pitype>();
718 }
719
721 template<int cd>
723 {
724 CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafbegin<cd,All_Partition>()));
725 return asImp().template leafbegin<cd,All_Partition>();
726 }
727
729 template<int cd>
731 {
732 CHECK_INTERFACE_IMPLEMENTATION((asImp().template leafend<cd,All_Partition>()));
733 return asImp().template leafend<cd,All_Partition>();
734 }
736
737
738 //===========================================================
742 //===========================================================
743
745 const GlobalIdSet &globalIdSet () const
746 {
747 CHECK_INTERFACE_IMPLEMENTATION(asImp().globalIdSet());
748 return asImp().globalIdSet();
749 }
750
752 const LocalIdSet &localIdSet () const
753 {
754 CHECK_INTERFACE_IMPLEMENTATION(asImp().localIdSet());
755 return asImp().localIdSet();
756 }
757
759 const LevelIndexSet &levelIndexSet ( int level ) const
760 {
761 CHECK_INTERFACE_IMPLEMENTATION(asImp().levelIndexSet(level));
762 return asImp().levelIndexSet(level);
763 }
764
767 {
768 CHECK_INTERFACE_IMPLEMENTATION(asImp().leafIndexSet());
769 return asImp().leafIndexSet();
770 }
772
773
774 //===========================================================
778 //===========================================================
779
785 void globalRefine (int refCount)
786 {
788 return;
789 }
790
798 bool mark( int refCount, const typename Codim<0>::Entity & e )
799 {
800 return asImp().mark(refCount,e);
801 }
802
809 int getMark(const typename Codim<0>::Entity & e) const
810 {
811 return asImp().getMark(e);
812 }
813
820 bool preAdapt ()
821 {
822 return asImp().preAdapt();
823 }
824
839 bool adapt ()
840 {
841 return asImp().adapt();
842 }
843
849 {
850 return asImp().postAdapt();
851 }
853
854
855 //===========================================================
859 //===========================================================
860
862 int overlapSize (int level, int codim) const
863 {
864 CHECK_INTERFACE_IMPLEMENTATION(asImp().overlapSize(level,codim));
865 return asImp().overlapSize(level,codim);
866 }
867
869 int overlapSize (int codim) const
870 {
871 CHECK_INTERFACE_IMPLEMENTATION(asImp().overlapSize(codim));
872 return asImp().overlapSize(codim);
873 }
874
876 int ghostSize (int level, int codim) const
877 {
878 CHECK_INTERFACE_IMPLEMENTATION(asImp().ghostSize(level,codim));
879 return asImp().ghostSize(level,codim);
880 }
881
883 int ghostSize (int codim) const
884 {
885 CHECK_INTERFACE_IMPLEMENTATION(asImp().ghostSize(codim));
886 return asImp().ghostSize(codim);
887 }
888
900 template<class DataHandleImp, class DataTypeImp>
902 {
903 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir,level)));
904 return;
905 }
906
917 template<class DataHandleImp, class DataTypeImp>
919 {
920 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().template communicate<DataHandleImp,DataTypeImp>(data,iftype,dir)));
921 return;
922 }
923
926 {
927 CHECK_INTERFACE_IMPLEMENTATION(asImp().comm());
928 return asImp().comm();
929 }
931
936 {
937 CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance());
938 return asImp().loadBalance();
939 }
940
948 template<class DataHandle>
949 bool loadBalance (DataHandle& data)
950 {
951 CHECK_INTERFACE_IMPLEMENTATION(asImp().loadBalance(data));
952 return asImp().loadBalance(data);
953 }
954
956 template < class EntitySeed >
957 typename Codim< EntitySeed :: codimension > :: EntityPointer
958 entityPointer( const EntitySeed& seed ) const
959 {
960 CHECK_INTERFACE_IMPLEMENTATION( asImp().entityPointer( seed ) );
961 return asImp().entityPointer( seed );
962 }
963 protected:
965 GridImp& asImp () {return static_cast<GridImp &> (*this);}
967 const GridImp& asImp () const {return static_cast<const GridImp &>(*this);}
968 };
969
970#undef CHECK_INTERFACE_IMPLEMENTATION
971#undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
972
973
1012 template<int dim,
1013 int dimworld,
1014 class ct,
1015 class GridFamily>
1016 class GridDefaultImplementation : public Grid <dim,dimworld,ct,GridFamily>
1017 {
1018 typedef typename GridFamily::Traits::Grid GridImp;
1019
1020 public:
1026 typedef typename GridFamily::Traits Traits;
1027
1029 template<PartitionIteratorType pitype>
1030 typename Traits::template Partition<pitype>::LevelGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.")
1031 levelView(int level) const {
1032 typedef typename Traits::template Partition<pitype>::LevelGridView View;
1033 typedef typename View::GridViewImp ViewImp;
1034 return View(ViewImp(asImp(),level));
1035 }
1036
1038 template<PartitionIteratorType pitype>
1039 typename Traits::template Partition<pitype>::LeafGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to leafGridView.") leafView() const {
1040 typedef typename Traits::template Partition<pitype>::LeafGridView View;
1041 typedef typename View::GridViewImp ViewImp;
1042 return View(ViewImp(asImp()));
1043 }
1044
1046 typename Traits::template Partition<All_Partition>::LevelGridView
1047 levelView(int level) const DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.") {
1048 typedef typename Traits::template Partition<All_Partition>::LevelGridView View;
1049 typedef typename View::GridViewImp ViewImp;
1050 return View(ViewImp(asImp(),level));
1051 }
1052
1054 typename Traits::template Partition<All_Partition>::LeafGridView
1055 leafView() const DUNE_DEPRECATED_MSG("The method leafView has been renamed to leafGridView.") {
1056 typedef typename Traits::template Partition<All_Partition>::LeafGridView View;
1057 typedef typename View::GridViewImp ViewImp;
1058 return View(ViewImp(asImp()));
1059 }
1060
1062 template<PartitionIteratorType pitype>
1063 typename Traits::template Partition<pitype>::LevelGridView
1064 levelGridView(int level) const {
1065 typedef typename Traits::template Partition<pitype>::LevelGridView View;
1066 typedef typename View::GridViewImp ViewImp;
1067 return View(ViewImp(asImp(),level));
1068 }
1069
1071 template<PartitionIteratorType pitype>
1072 typename Traits::template Partition<pitype>::LeafGridView
1074 typedef typename Traits::template Partition<pitype>::LeafGridView View;
1075 typedef typename View::GridViewImp ViewImp;
1076 return View(ViewImp(asImp()));
1077 }
1078
1080 typename Traits::template Partition<All_Partition>::LevelGridView
1081 levelGridView(int level) const {
1082 typedef typename Traits::template Partition<All_Partition>::LevelGridView View;
1083 typedef typename View::GridViewImp ViewImp;
1084 return View(ViewImp(asImp(),level));
1085 }
1086
1088 typename Traits::template Partition<All_Partition>::LeafGridView
1090 typedef typename Traits::template Partition<All_Partition>::LeafGridView View;
1091 typedef typename View::GridViewImp ViewImp;
1092 return View(ViewImp(asImp()));
1093 }
1094
1095 //***************************************************************
1096 // Interface for Adaptation
1097 //***************************************************************
1098
1121 bool mark( int refCount, const typename Traits :: template Codim<0>::Entity & e )
1122 {
1123 return false;
1124 }
1125
1133 int getMark ( const typename Traits::template Codim< 0 >::Entity &e ) const
1134 {
1135 return 0;
1136 }
1137
1145 bool adapt () { return false; }
1146
1148 bool preAdapt () { return false; }
1149
1151 void postAdapt() {}
1152
1154 int ghostSize (int level, int codim) const { return 0; }
1155
1157 int overlapSize (int level, int codim) const { return 0; }
1158
1160 int ghostSize (int codim) const { return 0; }
1161
1163 int overlapSize (int codim) const { return 0; }
1164
1166 template<class DataHandleImp, class DataTypeImp>
1168 InterfaceType iftype, CommunicationDirection dir, int level) const
1169 {}
1170
1172 template<class DataHandleImp, class DataTypeImp>
1174 InterfaceType iftype, CommunicationDirection dir) const
1175 {}
1176
1179 {
1180 return false;
1181 }
1182
1184 template<class DataHandle>
1185 bool loadBalance (DataHandle& data)
1186 {
1187 return false;
1188 }
1189
1190 protected:
1197 template<class T>
1199 : public T // implement friendship via subclassing
1200 {
1201 public:
1203 typedef typename T::Implementation ImplementationType;
1204 private:
1205 // constructor in only need to compile
1206 ReturnImplementationType(const T& t) : T(t) {}
1207 };
1208
1209 template<class T>
1210 class ReturnImplementationType<const T>
1211 : public T // implement friendship via subclassing
1212 {
1213 public:
1214 typedef const typename T::Implementation ImplementationType;
1215 private:
1216 // constructor in only need to compile
1217 ReturnImplementationType(const T& t) : T(t) {}
1218 };
1219
1221 template <class InterfaceType>
1223 getRealImplementation (InterfaceType &i) { return i.impl(); }
1224
1225 protected:
1226 using Grid< dim, dimworld, ct, GridFamily >::asImp;
1227 };
1228
1242 template <int dim, int dimw, class GridImp,
1243 template<int,int,class> class GeometryImp,
1244 template<int,int,class> class EntityImp,
1245 template<int,class> class EntityPointerImp,
1246 template<int,PartitionIteratorType,class> class LevelIteratorImp,
1247 template<class> class LeafIntersectionImp,
1248 template<class> class LevelIntersectionImp,
1249 template<class> class LeafIntersectionIteratorImp,
1250 template<class> class LevelIntersectionIteratorImp,
1251 template<class> class HierarchicIteratorImp,
1252 template<int,PartitionIteratorType,class> class LeafIteratorImp,
1253 class LevelIndexSetImp, class LeafIndexSetImp,
1254 class GlobalIdSetImp, class GIDType, class LocalIdSetImp, class LIDType, class CCType,
1255 template<class,PartitionIteratorType> class LevelGridViewTraits,
1256 template<class,PartitionIteratorType> class LeafGridViewTraits,
1257 template<int,class> class EntitySeedImp,
1258 template<int,int,class> class LocalGeometryImp = GeometryImp
1259 >
1261 {
1263 typedef GridImp Grid;
1264
1273
1276
1281 template <int cd>
1282 struct Codim
1283 {
1284 public:
1285 typedef GeometryImp<dim-cd, dimw, const GridImp> GeometryImpl;
1286 typedef LocalGeometryImp<dim-cd, dim, const GridImp> LocalGeometryImpl;
1288
1289 typedef Dune::Geometry<dim-cd, dimw, const GridImp, GeometryImp> Geometry;
1291 typedef Dune::Geometry<dim-cd, dim, const GridImp, LocalGeometryImp> LocalGeometry;
1293 // we could - if needed - introduce another struct for dimglobal of Geometry
1295
1298
1301
1306 template <PartitionIteratorType pitype>
1308 {
1313 };
1314
1317
1320
1321 private:
1322 friend class Dune::Entity<cd, dim, const GridImp, EntityImp>;
1323 typedef EntityPointerImp<cd,const GridImp> EntityPointerImpl;
1324 };
1325
1330 template <PartitionIteratorType pitype>
1332 {
1336
1340 };
1341
1350
1353 };
1354
1355 // Definition of capabilities for the interface class
1356 namespace Capabilities
1357 {
1358 // capabilities for the interface class depend on the implementation
1359 template< int dim, int dimworld, typename ct, class GridFamily , int cdim >
1360 struct hasEntity< GridDefaultImplementation<dim,dimworld,ct,GridFamily>, cdim >
1361 {
1363 typedef typename GridType::Traits::Grid GridImp;
1364 static const bool v = hasEntity<GridImp,cdim>::v;
1365 };
1366
1367 } // end namespace Capabilities
1368
1374 template <class InterfaceType>
1376 {
1377 typedef typename InterfaceType::Implementation ImplementationType;
1379 explicit MakeableInterfaceObject ( const ImplementationType &realImp )
1380 : InterfaceType( realImp )
1381 {}
1382 };
1383}
1384
1385#include "geometry.hh"
1386#include "entity.hh"
1387#include "entitypointer.hh"
1388#include "intersection.hh"
1389#include "intersectioniterator.hh"
1390#include "entityiterator.hh"
1391#include "indexidset.hh"
1392
1393#endif // #ifndef DUNE_GRID_HH
Provides check for implementation of interface methods when using static polymorphism,...
#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__)
Definition: bartonnackmanifcheck.hh:53
CommDataHandleIF describes the features of a data handle for communication in parallel runs using the...
Definition: datahandleif.hh:75
interface class for an iterator over grid entities
Definition: entityiterator.hh:37
Wrapper class for pointers to entities.
Definition: entitypointer.hh:92
Store a reference to an entity with a minimal memory footprint.
Definition: entityseed.hh:24
Wrapper class for entities.
Definition: entity.hh:57
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:25
Wrapper class for geometries.
Definition: geometry.hh:102
Helper class to choose correct implementation return type for getRealImplementation.
Definition: grid.hh:1200
T::Implementation ImplementationType
The correct type of the implementation to return.
Definition: grid.hh:1203
Definition: grid.hh:1017
Traits::template Partition< pitype >::LevelGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.") levelView(int level) const
View for a grid level.
Definition: grid.hh:1030
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: grid.hh:1173
bool adapt()
Refine all positive marked leaf entities coarsen all negative marked entities if possible.
Definition: grid.hh:1145
bool mark(int refCount, const typename Traits ::template Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: grid.hh:1121
Traits::template Partition< pitype >::LeafGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to leafGridView.") leafView() const
View for the leaf grid.
Definition: grid.hh:1039
void postAdapt()
clean up some markers
Definition: grid.hh:1151
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: grid.hh:1133
Traits::template Partition< All_Partition >::LevelGridView levelView(int level) const DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.")
View for a grid level for All_Partition.
Definition: grid.hh:1047
Traits::template Partition< All_Partition >::LeafGridView leafView() const DUNE_DEPRECATED_MSG("The method leafView has been renamed to leafGridView.")
View for the leaf grid for All_Partition.
Definition: grid.hh:1055
int ghostSize(int level, int codim) const
ghostSize is zero by default
Definition: grid.hh:1154
Traits::template Partition< pitype >::LeafGridView leafGridView() const
View for the leaf grid.
Definition: grid.hh:1073
static ReturnImplementationType< InterfaceType >::ImplementationType & getRealImplementation(InterfaceType &i)
return real implementation of interface class
Definition: grid.hh:1223
bool preAdapt()
returns true, if at least one entity is marked for adaption
Definition: grid.hh:1148
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Definition: grid.hh:1167
bool loadBalance(DataHandle &data)
default implementation of load balance does nothing and returns false
Definition: grid.hh:1185
int ghostSize(int codim) const
ghostSize is zero by default
Definition: grid.hh:1160
int overlapSize(int level, int codim) const
overlapSize is zero by default
Definition: grid.hh:1157
bool loadBalance()
default implementation of load balance does nothing and returns false
Definition: grid.hh:1178
Traits::template Partition< All_Partition >::LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: grid.hh:1081
GridFamily::Traits Traits
The traits of this class.
Definition: grid.hh:1026
int overlapSize(int codim) const
overlapSize is zero by default
Definition: grid.hh:1163
Traits::template Partition< pitype >::LevelGridView levelGridView(int level) const
View for a grid level.
Definition: grid.hh:1064
Traits::template Partition< All_Partition >::LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: grid.hh:1089
Grid view abstract base class.
Definition: gridview.hh:57
Grid abstract base class.
Definition: grid.hh:386
const LevelIndexSet & levelIndexSet(int level) const
return const reference to the grids level index set for level level
Definition: grid.hh:759
Codim< cd >::template Partition< All_Partition >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level for PartitionType All_Partition.
Definition: grid.hh:690
int size(int level, GeometryType type) const
Return number of entities per level and geometry type in this process.
Definition: grid.hh:580
GridFamily::Traits::LocalIdSet LocalIdSet
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entiti...
Definition: grid.hh:537
GridFamily::Traits::LeafIntersectionIterator LeafIntersectionIterator
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine,...
Definition: grid.hh:496
int size(int level, int codim) const
Return number of grid entities of a given codim on a given level in this process.
Definition: grid.hh:566
bool preAdapt()
To be called after entities have been marked and before adapt() is called.
Definition: grid.hh:820
GridFamily::Traits::LevelIndexSet LevelIndexSet
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent,...
Definition: grid.hh:516
@ dimension
The dimension of the grid.
Definition: grid.hh:400
GridFamily::Traits::CollectiveCommunication CollectiveCommunication
A type that is a model of Dune::CollectiveCommunication. It provides a portable way for collective co...
Definition: grid.hh:543
GridImp & asImp()
Barton-Nackman trick.
Definition: grid.hh:965
void communicate(CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const
Communicate information on distributed entities on the leaf grid Template parameter is a model of Dun...
Definition: grid.hh:918
GridFamily::Traits::HierarchicIterator HierarchicIterator
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine,...
Definition: grid.hh:510
Codim< cd >::template Partition< All_Partition >::LevelIterator lend(int level) const
one past the end on this level for PartitionType All_Partition
Definition: grid.hh:698
GridFamily::Traits::LeafIntersection LeafIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: grid.hh:484
Partition< pitype >::LevelGridView levelGridView(int level) const
View for a grid level.
Definition: grid.hh:639
GridFamily::Traits::LevelIntersectionIterator LevelIntersectionIterator
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine,...
Definition: grid.hh:503
LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: grid.hh:658
GridFamily::Traits::GlobalIdSet GlobalIdSet
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entiti...
Definition: grid.hh:530
const GridImp & asImp() const
Barton-Nackman trick.
Definition: grid.hh:967
@ dimensionworld
The dimension of the world the grid lives in.
Definition: grid.hh:406
void postAdapt()
To be called after grid has been adapted and information left over by the adaptation has been process...
Definition: grid.hh:848
Codim< cd >::template Partition< pitype >::LeafIterator leafbegin() const
Iterator to first entity of given codim on leaf grid.
Definition: grid.hh:706
bool mark(int refCount, const typename Codim< 0 >::Entity &e)
Marks an entity to be refined/coarsened in a subsequent adapt.
Definition: grid.hh:798
Partition< pitype >::LevelGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.") levelView(int level) const
View for a grid level.
Definition: grid.hh:613
Codim< EntitySeed::codimension >::EntityPointer entityPointer(const EntitySeed &seed) const
obtain EntityPointer from EntitySeed.
Definition: grid.hh:958
GridFamily::Traits::LeafIndexSet LeafIndexSet
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent,...
Definition: grid.hh:522
LevelGridView levelView(int level) const DUNE_DEPRECATED_MSG("The method levelView has been renamed to levelGridView.")
View for a grid level for All_Partition.
Definition: grid.hh:626
int ghostSize(int level, int codim) const
Return size of ghost region for a given codim on a given level.
Definition: grid.hh:876
int maxLevel() const
Return maximum level defined in this grid. Levels are numbered 0 ... maxLevel with 0 the coarsest lev...
Definition: grid.hh:559
Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Definition: grid.hh:682
Partition< pitype >::LeafGridView DUNE_DEPRECATED_MSG("The method levelView has been renamed to leafGridView.") leafView() const
View for the leaf grid.
Definition: grid.hh:620
size_t numBoundarySegments() const
returns the number of boundary segments within the macro grid
Definition: grid.hh:599
Partition< pitype >::LeafGridView leafGridView() const
View for the leaf grid.
Definition: grid.hh:646
const GlobalIdSet & globalIdSet() const
return const reference to the grids global id set
Definition: grid.hh:745
Codim< cd >::template Partition< All_Partition >::LeafIterator leafbegin() const
Iterator to first entity of given codim on leaf grid for PartitionType All_Partition.
Definition: grid.hh:722
int getMark(const typename Codim< 0 >::Entity &e) const
returns adaptation mark for given entity
Definition: grid.hh:809
GridFamily::Traits::LevelIntersection LevelIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: grid.hh:489
int overlapSize(int codim) const
Return size of overlap region for a given codim on the leaf grid.
Definition: grid.hh:869
const LeafIndexSet & leafIndexSet() const
return const reference to the grids leaf index set
Definition: grid.hh:766
const LocalIdSet & localIdSet() const
return const reference to the grids local id set
Definition: grid.hh:752
LevelGridView levelGridView(int level) const
View for a grid level for All_Partition.
Definition: grid.hh:652
bool loadBalance(DataHandle &data)
Re-balances the load each process has to handle for a parallel grid and moves the data.
Definition: grid.hh:949
Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: grid.hh:674
Codim< cd >::template Partition< All_Partition >::LeafIterator leafend() const
one past the end on the leaf grid for PartitionType All_Partition
Definition: grid.hh:730
Codim< cd >::template Partition< pitype >::LeafIterator leafend() const
one past the end on the leaf level grid
Definition: grid.hh:714
bool loadBalance()
Re-balances the load each process has to handle for a parallel grid,.
Definition: grid.hh:935
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: grid.hh:901
Partition< All_Partition >::LevelGridView LevelGridView
View types for All_Partition.
Definition: grid.hh:426
int ghostSize(int codim) const
Return size of ghost region for a given codim on the leaf grid.
Definition: grid.hh:883
int overlapSize(int level, int codim) const
Return size of overlap for a given codim on a given level.
Definition: grid.hh:862
bool adapt()
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
Definition: grid.hh:839
int size(int codim) const
Return number of leaf entities of a given codim in this process.
Definition: grid.hh:573
ct ctype
Define type used for coordinates in grid module.
Definition: grid.hh:546
LeafGridView leafView() const DUNE_DEPRECATED_MSG("The method leafView has been renamed to leafGridView.")
View for the leaf grid for All_Partition.
Definition: grid.hh:632
void globalRefine(int refCount)
Refine the grid refCount times using the default refinement rule.
Definition: grid.hh:785
int size(GeometryType type) const
Return number of leaf entities per geometry type in this process.
Definition: grid.hh:587
const CollectiveCommunication & comm() const
return const reference to a collective communication object. The return type is a model of Dune::Coll...
Definition: grid.hh:925
Id Set Interface.
Definition: indexidset.hh:403
Index Set Interface base class.
Definition: indexidset.hh:78
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:83
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: intersection.hh:161
A set of traits classes to store static information about grid implementation.
Interface class EntitySeed.
Describes the parallel communication interface class for MessageBuffers and DataHandles.
Implements a vector constructed from a given type representing a field and a compile-time given size.
Provides base classes for index and id sets.
Dune namespace.
Definition: alignment.hh:14
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:164
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:80
Traits associated with a specific grid partition type.
Definition: grid.hh:1308
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: grid.hh:1312
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: grid.hh:1310
Traits associated with a specific codim.
Definition: grid.hh:1283
Partition< All_Partition >::LeafIterator LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition: grid.hh:1316
Dune::Entity< cd, dim, const GridImp, EntityImp > Entity
The type of the entity.
Definition: grid.hh:1294
Dune::Geometry< dim-cd, dim, const GridImp, LocalGeometryImp > LocalGeometry
The type of the local geometry associated with the entity.
Definition: grid.hh:1291
Partition< All_Partition >::LevelIterator LevelIterator
The type of the entity pointer for entities of this codim.
Definition: grid.hh:1319
Dune::Geometry< dim-cd, dimw, const GridImp, GeometryImp > Geometry
IMPORTANT: Codim<codim>::Geometry == Geometry<dim-codim,dimw>
Definition: grid.hh:1289
Dune::EntityPointer< const GridImp, EntityPointerImp< cd, const GridImp > > EntityPointer
The type of the entity pointer for entities of this codim.
Definition: grid.hh:1297
Dune::EntitySeed< const GridImp, EntitySeedImp< cd, const GridImp > > EntitySeed
The type of the entity seed of this codim.
Definition: grid.hh:1300
Traits associated with a specific grid partition type.
Definition: grid.hh:1332
Dune::GridView< LevelGridViewTraits< const GridImp, pitype > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: grid.hh:1335
Dune::GridView< LeafGridViewTraits< const GridImp, pitype > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: grid.hh:1339
A traits struct that collects all associated types of one grid model.
Definition: grid.hh:1261
Dune::IntersectionIterator< const GridImp, LeafIntersectionIteratorImp< const GridImp >, LeafIntersectionImp< const GridImp > > LeafIntersectionIterator
The type of the intersection iterator at the leafs of the grid.
Definition: grid.hh:1270
Dune::IntersectionIterator< const GridImp, LevelIntersectionIteratorImp< const GridImp >, LevelIntersectionImp< const GridImp > > LevelIntersectionIterator
The type of the intersection iterator at the levels of the grid.
Definition: grid.hh:1272
Dune::Intersection< const GridImp, LeafIntersectionImp< const GridImp > > LeafIntersection
The type of the intersection at the leafs of the grid.
Definition: grid.hh:1266
CCType CollectiveCommunication
The type of the collective communication.
Definition: grid.hh:1352
IdSet< const GridImp, GlobalIdSetImp, GIDType > GlobalIdSet
The type of the global id set.
Definition: grid.hh:1347
Dune::Intersection< const GridImp, LevelIntersectionImp< const GridImp > > LevelIntersection
The type of the intersection at the levels of the grid.
Definition: grid.hh:1268
Dune::EntityIterator< 0, const GridImp, HierarchicIteratorImp< const GridImp > > HierarchicIterator
The type of the hierarchic iterator.
Definition: grid.hh:1275
IndexSet< const GridImp, LevelIndexSetImp > LevelIndexSet
The type of the level index set.
Definition: grid.hh:1343
IndexSet< const GridImp, LeafIndexSetImp > LeafIndexSet
The type of the leaf index set.
Definition: grid.hh:1345
IdSet< const GridImp, LocalIdSetImp, LIDType > LocalIdSet
The type of the local id set.
Definition: grid.hh:1349
GridImp Grid
The type that implements the grid.
Definition: grid.hh:1263
A struct collecting all types depending on the partition iterator type.
Definition: grid.hh:455
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: grid.hh:462
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: grid.hh:469
A Traits struct that collects all associated types of one implementation.
Definition: grid.hh:436
GridFamily::Traits::template Codim< cd >::Entity Entity
A type that is a model of a Dune::Entity<cd,dim,...>.
Definition: grid.hh:444
GridFamily::Traits::template Codim< cd >::LocalGeometry LocalGeometry
A type that is a model of Dune::Geometry<dim-cd,dim>.
Definition: grid.hh:441
GridFamily::Traits::template Codim< cd >::LevelIterator LevelIterator
A type that is a model of Dune::LevelIterator with partition type All_Partition.
Definition: grid.hh:474
GridFamily::Traits::template Codim< cd >::Geometry Geometry
A type that is a model of Dune::Geometry<dim-cd,dimworld>.
Definition: grid.hh:438
GridFamily::Traits::template Codim< cd >::EntitySeed EntitySeed
A type that is a model (not yet) of Dune::EntitySeed<cd,dim,...>.
Definition: grid.hh:450
GridFamily::Traits::template Codim< cd >::EntityPointer EntityPointer
A type that is a model of Dune::EntityPointer<cd,dim,...>.
Definition: grid.hh:447
GridFamily::Traits::template Codim< cd >::LeafIterator LeafIterator
A type that is a model of Dune::LeafIterator with partition type All_Partition.
Definition: grid.hh:478
Types for GridView.
Definition: grid.hh:419
Definition: grid.hh:1376
MakeableInterfaceObject(const ImplementationType &realImp)
create interface object by calling the contructor of the base class
Definition: grid.hh:1379
A unique label for each type of element that can occur in a grid.
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)