Dune Core Modules (2.9.0)

Dune::ALU3dGrid< dim, dimworld, elType, Comm > Class Template Reference

[ 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 &macroTriangFilename, 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 GlobalIdSetglobalIdSet () 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 LocalIdSetlocalIdSet () const
 get global id set of grid
 
const Traits ::LeafIndexSetleafIndexSet () const
 get leaf index set of the grid
 
const Traits ::LevelIndexSetlevelIndexSet (int level) const
 get level index set of the grid
 
std::shared_ptr< LevelIndexSetImpaccessLevelIndexSet (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 Communicationcomm () 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 ([[maybe_unused]] 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 ThisTypeoperator= (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
 

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 ct ctype
 Define type used for coordinates in grid module.
 
template<class T >
using Communication_t = typename T::Communication
 
template<class T >
using DeprecatedCollectiveCommunication_t = typename T::CollectiveCommunication
 

Parallel data distribution and communication

template<class DataHandle >
bool loadBalance (DataHandle &data)
 Re-balances the load each process has to handle for a parallel grid and moves the data. More...
 
GridImp & asImp ()
 Barton-Nackman trick.
 
const GridImp & asImp () const
 Barton-Nackman trick.
 

Detailed Description

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm>
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 :

For installation instructions see http://www.dune-project.org/external_libraries/install_alugrid.html .

Author
Robert Kloefkorn

Member Enumeration Documentation

◆ anonymous enum

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
anonymous enum
protected

element chunk for refinement

Enumerator
newElementsChunk_ 

normal default number of new elements for new adapt method

◆ anonymous enum

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
anonymous enum
protected

upper estimate on number of elements that could be created when a new element is created

Enumerator
refineEstimate_ 

if one element is refined then it causes apporximately not more than this number of new elements

Constructor & Destructor Documentation

◆ ALU3dGrid()

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
Dune::ALU3dGrid< dim, dimworld, elType, Comm >::ALU3dGrid ( const std::string &  macroTriangFilename,
const MPICommunicatorType  mpiComm,
const ALUGridVertexProjectionPairType &  bndPrj,
const ALUGridRefinementType  refinementType 
)
inline

Constructor which reads an ALU3dGrid Macro Triang file or given GridFile

References Dune::dverb.

Member Function Documentation

◆ accessLevelIndexSet()

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
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]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
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, and Dune::Simd::Overloads::max().

◆ adapt() [2/2]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class GridImp , class DataHandle >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::adapt ( AdaptDataHandleInterface< GridImp, DataHandle > &  handle)
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
handlehandler for restriction and prolongation operations which is a Model of the AdaptDataHandleInterface class.

◆ comm()

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
const Communication& Dune::ALU3dGrid< dim, dimworld, elType, Comm >::comm ( ) const
inline

return const reference to a communication object. The return type is a model of Dune::Communication.

◆ communicate()

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class DataHandle , class Data >
LevelCommunication Dune::ALU3dGrid< dim, dimworld, elType, Comm >::communicate ( CommDataHandleIF< DataHandle, Data > &  data,
InterfaceType  iftype,
CommunicationDirection  dir,
int  level 
) const
inline

◆ getMark() [1/2]

template<int dim, int dimworld, class ct , class GridFamily >
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark ( const typename Codim< 0 >::Entity e) const
inlineinherited

returns adaptation mark for given entity

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark currently set for given Entity e

References Dune::Grid< dim, dimworld, ct, GridFamily >::asImp().

◆ getMark() [2/2]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
int Dune::ALU3dGrid< dim, dimworld, elType, Comm >::getMark ( const typename Traits::template Codim< 0 >::Entity e) const
inline

returns adaptation mark for given entity

Parameters
[in]eEntity for which adaptation mark should be determined
Returns
int adaptation mark currently set for given Entity e

◆ loadBalance() [1/6]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance ( )
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

Referenced by Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance(), and Dune::ALU3dGrid< dim, dimworld, elType, Comm >::repartition().

◆ loadBalance() [2/6]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class DataHandleImpl , class Data >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance ( CommDataHandleIF< DataHandleImpl, Data > &  dataHandleIF)
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
optionaldataHandleIF 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/6]

template<int dim, int dimworld, class ct , class GridFamily >
template<class DataHandle >
bool Dune::Grid< dim, dimworld, ct, GridFamily >::loadBalance ( DataHandle &  data)
inlineinherited

Re-balances the load each process has to handle for a parallel grid and moves the data.

Parameters
dataA data handle telling the method which data should be communicated and how. Has to adhere to the interface describe by CommDataHandleIf just like the data handle for the communicate methods.
Returns
True if the grid has changed.

◆ loadBalance() [4/6]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
alu_inline bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance ( GatherScatterType *  lbData)
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
datathe 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>
void xtractData ( MessageBufferImp& buff, Dune::Entity<0> & e, size_t numChildren );
// 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 ();
Wrapper class for entities.
Definition: entity.hh:66
Returns
true if the grid has changed

◆ loadBalance() [5/6]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class LBWeights >
std::enable_if< !IsDataHandle< LBWeights >::value, bool >::type Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance ( LBWeights &  weights)
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
weightsclass 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() [6/6]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class LBWeights , class DataHandleImpl , class Data >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::loadBalance ( LBWeights &  weights,
CommDataHandleIF< DataHandleImpl, Data > &  dataHandleIF 
)
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
weightsclass 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.
dataHandleIFdata 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]

template<int dim, int dimworld, class ct , class GridFamily >
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark ( int  refCount,
const typename Codim< 0 >::Entity e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity that should be marked
Returns
true if Entity was marked, false otherwise.

References Dune::Grid< dim, dimworld, ct, GridFamily >::asImp().

◆ mark() [2/3]

bool Dune::GridDefaultImplementation< dim, dimworld, alu3d_ctype , ALU3dGridFamily< dim, dimworld, elType, Comm > >::mark ( int  refCount,
const typename Traits ::template Codim< 0 >::Entity e 
)
inlineinherited

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity 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
    bool mark( int refCount,
    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
    This template method will vanish due to the inheritance rules.

◆ mark() [3/3]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::mark ( int  refCount,
const typename Traits::template Codim< 0 >::Entity e 
)
inline

Marks an entity to be refined/coarsened in a subsequent adapt.

Parameters
[in]refCountNumber of subdivisions that should be applied. Negative value means coarsening.
[in]eEntity that should be marked
Returns
true if Entity was marked, false otherwise.

◆ repartition() [1/2]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class LBDestinations >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::repartition ( LBDestinations &  destinations)
inline

Distribute the grid based on a user defined partitioning.

Parameters
destinationsclass 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]

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
template<class LBDestinations , class DataHandleImpl , class Data >
bool Dune::ALU3dGrid< dim, dimworld, elType, Comm >::repartition ( LBDestinations &  destinations,
CommDataHandleIF< DataHandleImpl, Data > &  dataHandleIF 
)
inline

Distribute the grid based on a user defined partitioning.

Parameters
destinationsclass 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.
dataHandleIFdata 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()

template<int dim, int dimworld, ALU3dGridElementType elType, class Comm >
static void Dune::ALU3dGrid< dim, dimworld, elType, Comm >::setLoadBalanceMethod ( const int  mthd,
const double  ldbUnder = 0.0,
const double  ldbOver = 1.2 
)
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 balancing
NONE = 0
// collect all to rank 0
COLLECT = 1,
// assuming the elements to be ordered by a
// space filling curve approach
// here, the edges in the graph are neglected
// parallel version
ALUGRID_SpaceFillingCurveLinkage = 4,
// serial version that requires the whole graph to be avaiable
ALUGRID_SpaceFillingCurveSerialLinkage = 5,
// METIS method for graph partitioning (with linkage storage)
//METIS_PartGraphKwayLinkage = 6,
//METIS_PartGraphRecursiveLinkage = 7,
// ALU sfc without linkage
ALUGRID_SpaceFillingCurve = 9,
ALUGRID_SpaceFillingCurveSerial = 10,
// METIS method for graph partitioning
METIS_PartGraphKway = 11,
METIS_PartGraphRecursive = 12,
// ZOLTAN partitioning
ZOLTAN_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:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 26, 22:29, 2024)