Dune Core Modules (2.9.0)
[ provides Dune::Grid ] More...
#include <dune/alugrid/3d/grid.hh>
Classes | |
struct | Partition |
Types for GridView. More... | |
Public Types | |
typedef Partition< All_Partition >::LevelGridView | LevelGridView |
View types for All_Partition. | |
typedef ALU3dGridHierarchicIndexSet< dim, dimworld, elType, Comm > | HierarchicIndexSet |
Type of the hierarchic index set. | |
typedef GridFamily::LevelIndexSetImp | LevelIndexSetImp |
Type of the level index set, needed by data handle. | |
typedef GridFamily::LeafIndexSetImp | LeafIndexSetImp |
Type of the leaf index set, needed by data handle. | |
typedef Traits::DuneBoundaryProjectionType | DuneBoundaryProjectionType |
boundary projection type | |
typedef ALU3DSPACE ProjectVertex | ALUGridVertexProjectionType |
type of vertex projection | |
typedef ALU3DSPACE ProjectVertexPtr | ALUGridVertexProjectionPointerType |
type of ALUGrid Vertex Projection Interface (shared_ptr) | |
typedef Traits::Communication | Communication |
type of collective communication object | |
typedef Traits::GlobalIdSet | GlobalIdSet |
Type of the global id set. | |
typedef Traits::LocalIdSet | LocalIdSet |
Type of the local id set. | |
Public Member Functions | |
ALU3dGrid (const std::string ¯oTriangFilename, const MPICommunicatorType mpiComm, const ALUGridVertexProjectionPairType &bndPrj, const ALUGridRefinementType refinementType) | |
virtual | ~ALU3dGrid () |
Desctructor. | |
int | maxLevel () const |
Return maximum level defined in this grid. Levels are numbered maxLevel with 0 the coarsest level. | |
template<int cd, PartitionIteratorType pitype> | |
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. | |
template<int cd, PartitionIteratorType pitype> | |
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator | lend (int level) const |
one past the end on this level | |
template<int cd> | |
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. | |
template<int cd> | |
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator | lend (int level) const |
one past the end on this level | |
template<int codim, PartitionIteratorType pitype> | |
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator | leafbegin () const |
General definiton for a leaf iterator. | |
template<int codim, PartitionIteratorType pitype> | |
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator | leafend () const |
General definition for an end iterator on leaf level. | |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafbegin () const |
General definiton for a leaf iterator. | |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafend () const |
General definition for an end iterator on leaf level. | |
int | size (int level, int cd) const |
number of grid entities per level and codim | |
int | size (int codim) const |
number of leaf entities per codim in this process | |
int | size (int level, GeometryType type) const |
number of entities per level and geometry type in this process | |
size_t | numBoundarySegments () const |
number of boundary segments | |
int | size (GeometryType type) const |
number of leaf entities per geometry type in this process | |
int | global_size (int cd) const |
number of grid entities on all levels for given codim | |
const GlobalIdSet & | globalIdSet () const |
get global id set of grid | |
template<PartitionIteratorType pitype> | |
Partition< pitype >::MacroGridView | macroGridView () const |
View for te macro grid with some alu specific methods. | |
MacroGridView | macroGridView () const |
View for te macro grid with some alu specific methods (All_Partition) | |
const LocalIdSet & | localIdSet () const |
get global id set of grid | |
const Traits::LeafIndexSet & | leafIndexSet () const |
get leaf index set of the grid | |
const Traits::LevelIndexSet & | levelIndexSet (int level) const |
get level index set of the grid | |
std::shared_ptr< LevelIndexSetImp > | accessLevelIndexSet (int level) const |
return instance of level index set More... | |
bool | loadBalance () |
Calculates load of each process and repartition by using ALUGrid's default partitioning method. The specific load balancing algorithm is selected from a file alugrid.cfg. More... | |
template<class DataHandleImpl , class Data > | |
bool | loadBalance (CommDataHandleIF< DataHandleImpl, Data > &dataHandleIF) |
Calculates load of each process and repartition by using ALUGrid's default partitioning method. The specific load balancing algorithm is selected from a file alugrid.cfg. More... | |
template<class LBWeights , class DataHandleImpl , class Data > | |
bool | loadBalance (LBWeights &weights, CommDataHandleIF< DataHandleImpl, Data > &dataHandleIF) |
Calculates load of each process and repartition by using ALUGrid's default partitioning method, the partitioning can be optimized by providing weights for each element on the macro grid. The specific load balancing algorithm is selected from a file alugrid.cfg. More... | |
template<class LBWeights > | |
std::enable_if<!IsDataHandle< LBWeights >::value, bool >::type | loadBalance (LBWeights &weights) |
Calculates load of each process and repartition by using ALUGrid's default partitioning method, the partitioning can be optimized by providing weights for each element on the macro grid. The specific load balancing algorithm is selected from a file alugrid.cfg. More... | |
template<class LBDestinations > | |
bool | repartition (LBDestinations &destinations) |
Distribute the grid based on a user defined partitioning. More... | |
template<class LBDestinations , class DataHandleImpl , class Data > | |
bool | repartition (LBDestinations &destinations, CommDataHandleIF< DataHandleImpl, Data > &dataHandleIF) |
Distribute the grid based on a user defined partitioning. More... | |
int | ghostSize (int level, int codim) const |
ghostSize is one for codim 0 and zero otherwise for this grid | |
int | overlapSize (int level, int codim) const |
overlapSize is zero for this grid | |
int | ghostSize (int codim) const |
ghostSize is one for codim 0 and zero otherwise for this grid | |
int | overlapSize (int codim) const |
overlapSize is zero for this grid | |
template<class DataHandle , class Data > | |
LevelCommunication | communicate (CommDataHandleIF< DataHandle, Data > &data, InterfaceType iftype, CommunicationDirection dir, int level) const |
template<class DataHandle , class Data > | |
LeafCommunication | communicate (CommDataHandleIF< DataHandle, Data > &data, InterfaceType iftype, CommunicationDirection dir) const |
Communicate information on distributed entities on the leaf grid. Template parameter is a model of Dune::CommDataHandleIF. | |
const Communication & | comm () const |
return const reference to a communication object. The return type is a model of Dune::Communication. More... | |
bool | preAdapt () |
returns if a least one entity was marked for coarsening | |
void | postAdapt () |
clear all entity new markers if lockPostAdapt_ is set | |
bool | adapt () |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible. More... | |
template<class GridImp , class DataHandle > | |
bool | adapt (AdaptDataHandleInterface< GridImp, DataHandle > &handle) |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible. More... | |
void | globalRefine (int refCount) |
uses the interface, mark on entity and refineLocal | |
bool | writeMacroGrid (const std::string path, const std::string filename, const ALU3DSPACE MacroFileHeader::Format format=ALU3DSPACE MacroFileHeader::defaultFormat) const |
write macro grid in ALUGrid macro format to path/filename.rank | |
void | backup (std::ostream &, const ALU3DSPACE MacroFileHeader::Format format) const |
backup to ostream | |
void | restore (std::istream &) |
restore from istream | |
bool | mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. More... | |
int | getMark (const typename Traits::template Codim< 0 >::Entity &e) const |
returns adaptation mark for given entity More... | |
const std::vector< GeometryType > & | geomTypes (int codim) const |
deliver all geometry types used in this grid | |
Traits::LevelGridView | levelGridView (int level) const |
View for a grid level for All_Partition. | |
Traits::LeafGridView | leafGridView () const |
View for the leaf grid for All_Partition. | |
bool | mark (int refCount, const typename Traits ::template Codim< 0 >::Entity &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. More... | |
bool | loadBalance (DataHandle &data) |
default implementation of load balance does nothing and returns false | |
Adaptivity and grid refinement | |
bool | mark (int refCount, const typename Codim< 0 >::Entity &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. More... | |
int | getMark (const typename Codim< 0 >::Entity &e) const |
returns adaptation mark for given entity More... | |
Static Public Member Functions | |
static std::string | name () |
for grid identification | |
static void | setLoadBalanceMethod (const int mthd, const double ldbUnder=0.0, const double ldbOver=1.2) |
Set load balancing method and lower and upper bound for decision on whether to load balance or not. More... | |
static const ReferenceElementType & | referenceElement () |
return reference to Dune reference element according to elType | |
static const ReferenceFaceType & | faceReferenceElement () |
return reference to Dune face reference element according to elType | |
Protected Types | |
enum | { newElementsChunk_ = 128 } |
element chunk for refinement More... | |
enum | { refineEstimate_ = 8 } |
upper estimate on number of elements that could be created when a new element is created More... | |
typedef GridFamily::LocalIdSetImp | LocalIdSetImp |
Type of the local id set. | |
Protected Member Functions | |
bool | loadBalance (GatherScatterType *lbData) |
Calculates load of each process and repartition the grid if neccessary. For parameters of the load balancing process see the README file of the ALUGrid package. More... | |
void | clearIsNewMarkers () |
clear all entity new markers | |
ALU3dGrid (const ThisType &) | |
Copy constructor should not be used. | |
const ThisType & | operator= (const ThisType &) |
assignment operator should not be used | |
void | calcExtras () |
reset size and global size, update Level- and LeafIndexSet, if they exist | |
void | calcMaxLevel () |
calculate maxlevel | |
void | recalcGlobalSize () |
make grid walkthrough and calc global size | |
void | checkMacroGridFile (const std::string filename) |
check whether macro grid format is of our type | |
void | checkMacroGrid () |
check whether macro grid has the right element type | |
Parallel data distribution and communication | |
GridImp & | asImp () |
Barton-Nackman trick. | |
const GridImp & | asImp () const |
Barton-Nackman trick. | |
Exported types | |
typedef GridFamily::Traits::LeafIntersection | LeafIntersection |
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in the leaf view. | |
typedef GridFamily::Traits::LevelIntersection | LevelIntersection |
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in a level view. | |
typedef GridFamily::Traits::LeafIntersectionIterator | LeafIntersectionIterator |
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an leaf element (entity of codimension 0) with other leaf elements. | |
typedef GridFamily::Traits::LevelIntersectionIterator | LevelIntersectionIterator |
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an element (entity of codimension 0) with other elements on the same level. | |
typedef GridFamily::Traits::HierarchicIterator | HierarchicIterator |
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine, but not to modify, entities of codimension 0 that result from refinement of an entity of codimension 0. | |
typedef GridFamily::Traits::LevelIndexSet | LevelIndexSet |
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities on a grid level. | |
typedef GridFamily::Traits::LeafIndexSet | LeafIndexSet |
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities in the leaf grid. | |
typedef alu3d_ctype | ctype |
Define type used for coordinates in grid module. | |
using | Communication_t = typename T::Communication |
using | DeprecatedCollectiveCommunication_t = typename T::CollectiveCommunication |
Detailed Description
class Dune::ALU3dGrid< dim, dimworld, elType, Comm >
[ provides Dune::Grid ]
3D grid with support for hexahedrons and tetrahedrons. The ALU3dGrid implements the Dune GridInterface for 3d tetrahedral and hexahedral meshes. This grid can be locally adapted and used in parallel computations using dynamic load balancing.
- Note
- Adaptive parallel grid supporting dynamic load balancing, written mainly by Bernard Schupp. This grid supports hexahedrons and tetrahedrons.
(see ALUGrid homepage: http://www.mathematik.uni-freiburg.de/IAM/Research/alugrid/)
Two tools are available for partitioning :
- Metis ( version 4.0 and higher, see http://glaros.dtc.umn.edu/gkhome/views/metis/metis/ )
- ParMETIS ( http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview )
For installation instructions see http://www.dune-project.org/external_libraries/install_alugrid.html .
Member Enumeration Documentation
◆ anonymous enum
|
protected |
◆ anonymous enum
|
protected |
Constructor & Destructor Documentation
◆ ALU3dGrid()
|
inline |
Constructor which reads an ALU3dGrid Macro Triang file or given GridFile
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::calcExtras(), Dune::ALU3dGrid< dim, dimworld, elType, Comm >::checkMacroGrid(), Dune::ALU3dGrid< dim, dimworld, elType, Comm >::checkMacroGridFile(), Dune::ALU3dGrid< dim, dimworld, elType, Comm >::clearIsNewMarkers(), Dune::ALU3dGrid< dim, dimworld, elType, Comm >::comm(), and Dune::dverb.
Member Function Documentation
◆ accessLevelIndexSet()
alu_inline_tmp std::shared_ptr< typename ALU3dGrid< dim, dimworld, elType, Comm >::LevelIndexSetImp > Dune::ALU3dGrid< dim, dimworld, elType, Comm >::accessLevelIndexSet | ( | int | level | ) | const |
return instance of level index set
- Note
- if index set for this level has not been created then this instance will be deleted once the shared_ptr goes out of scope.
◆ adapt() [1/2]
alu_inline_tmp bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::adapt |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
\return true if a least one entity was refined The complete adaptation process works as follows: - mark entities with the mark() method - call preAdapt() - if preAdapt() returned true: possibly save current solution - call adapt() - if adapt() returned true: possibly interpolate the (saved) solution - call postAdapt()
References DUNE_THROW.
◆ adapt() [2/2]
|
inline |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
\return true if a least one entity was refined The complete adaptation process works as follows: - mark entities with the mark() method - call preAdapt() - if preAdapt() returned true: possibly save current solution - call adapt() - if adapt() returned true: possibly interpolate the (saved) solution - call postAdapt()
- Parameters
-
handle handler for restriction and prolongation operations which is a Model of the AdaptDataHandleInterface class.
◆ comm()
|
inline |
return const reference to a communication object. The return type is a model of Dune::Communication.
Referenced by Dune::ALU3dGrid< dim, dimworld, elType, Comm >::ALU3dGrid().
◆ communicate()
|
inline |
◆ getMark() [1/2]
|
inlineinherited |
◆ getMark() [2/2]
|
inline |
◆ loadBalance() [1/5]
|
inline |
Calculates load of each process and repartition by using ALUGrid's default partitioning method. The specific load balancing algorithm is selected from a file alugrid.cfg.
- Returns
- true if grid has changed
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance().
Referenced by Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance(), and Dune::ALU3dGrid< dim, dimworld, elType, Comm >::repartition().
◆ loadBalance() [2/5]
|
inline |
Calculates load of each process and repartition by using ALUGrid's default partitioning method. The specific load balancing algorithm is selected from a file alugrid.cfg.
- Parameters
-
optional dataHandleIF data handle that implements the Dune::CommDataHandleIF interface to include user data during load balancing
- Returns
- true if grid has changed
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance().
◆ loadBalance() [3/5]
|
protected |
Calculates load of each process and repartition the grid if neccessary. For parameters of the load balancing process see the README file of the ALUGrid package.
- Parameters
-
data the data handler class that must implement three methods: // calls data inline on macro element. From there the data of// all children can be written to the message buffer.// MessageBufferImp implements the MessageBufferIF interface.template<class MessageBufferImp>void inlineData ( MessageBufferImp& buff, Dune::Entity<0> & e);// calls data xtract on macro element. From there the data of// all children can be restored from the message buffer.// numChildren is the number of all children underneath the// macro element e.// MessageBufferImp implements the MessageBufferIF interface.template<class MessageBufferImp>// This method is called at the end of the load balancing process// before adaptation markers are removed. Here the user can apply// a data compression or other features. This method can be// empty if nothing should be done.void compress ();
- Returns
- true if the grid has changed
◆ loadBalance() [4/5]
|
inline |
Calculates load of each process and repartition by using ALUGrid's default partitioning method, the partitioning can be optimized by providing weights for each element on the macro grid. The specific load balancing algorithm is selected from a file alugrid.cfg.
- Parameters
-
weights class with double operator()(const Entity<0>&) returning a weight for each element which the includes in its internal loadbalancing process - for ALUGrid these are all macro elements.
- Returns
- true if grid has changed
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance().
◆ loadBalance() [5/5]
|
inline |
Calculates load of each process and repartition by using ALUGrid's default partitioning method, the partitioning can be optimized by providing weights for each element on the macro grid. The specific load balancing algorithm is selected from a file alugrid.cfg.
- Parameters
-
weights class with double operator()(const Entity<0>&) returning a weight for each element which the includes in its internal loadbalancing process - for ALUGrid these are all macro elements. dataHandleIF data handle that implements the Dune::CommDataHandleIF interface to include user data during load balancing
- Returns
- true if grid has changed
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance().
◆ mark() [1/3]
|
inlineinherited |
◆ mark() [2/3]
|
inlineinherited |
Marks an entity to be refined/coarsened in a subsequent adapt.
- Parameters
-
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening. [in] e Entity to Entity that should be refined
- Returns
- true if Entity was marked, false otherwise.
- Note
- default implementation is: return false; for grids with no adaptation.
- for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as typename Traits::template Codim<0>::Entity & e ).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_inline.hh:190
◆ mark() [3/3]
|
inline |
◆ repartition() [1/2]
|
inline |
Distribute the grid based on a user defined partitioning.
- Parameters
-
destinations class with int operator()(const Entity<0>&) returning the new owner process of this element. A destination has to be provided for all elements in the grid hierarchy but depending on the grid implementation it is possibly called on a subset only. The elements for which the method is called will be moved to the new processor together with all children. ALUGrid requires destinations for all macro elements.
- Returns
- true if grid has changed
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance().
◆ repartition() [2/2]
|
inline |
Distribute the grid based on a user defined partitioning.
- Parameters
-
destinations class with int operator()(const Entity<0>&) returning the new owner process of this element. A destination has to be provided for all elements in the grid hierarchy but depending on the grid implementation it is possibly called on a subset only. The elements for which the method is called will be moved to the new processor together with all children. ALUGrid requires destinations for all macro elements. dataHandleIF data handle that implements the Dune::CommDataHandleIF interface to include user data during load balancing
- Returns
- true if grid has changed
References Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance().
◆ setLoadBalanceMethod()
|
inlinestatic |
Set load balancing method and lower and upper bound for decision on whether to load balance or not.
- Note
- Possible choices of load balancing methods are: // no load balancingNONE = 0// collect all to rank 0COLLECT = 1,// assuming the elements to be ordered by a// space filling curve approach// here, the edges in the graph are neglected// parallel versionALUGRID_SpaceFillingCurveLinkage = 4,// serial version that requires the whole graph to be avaiableALUGRID_SpaceFillingCurveSerialLinkage = 5,// METIS method for graph partitioning (with linkage storage)//METIS_PartGraphKwayLinkage = 6,//METIS_PartGraphRecursiveLinkage = 7,// ALU sfc without linkageALUGRID_SpaceFillingCurve = 9,ALUGRID_SpaceFillingCurveSerial = 10,// METIS method for graph partitioningMETIS_PartGraphKway = 11,METIS_PartGraphRecursive = 12,// ZOLTAN partitioningZOLTAN_LB_HSFC = 13 ,ZOLTAN_LB_GraphPartitioning = 14 ,ZOLTAN_LB_PARMETIS = 15
References DUNE_THROW.
The documentation for this class was generated from the following files:
- dune/alugrid/3d/communication.hh
- dune/alugrid/3d/grid.hh
- dune/alugrid/3d/grid_imp.cc
- dune/alugrid/3d/grid_inline.hh