Dune::ALU3dGrid< dim, dimworld, elType > Class Template Reference
#include <grid.hh>
Inheritance diagram for Dune::ALU3dGrid< dim, dimworld, elType >:

Detailed Description
template<int dim, int dimworld, ALU3dGridElementType elType>
class Dune::ALU3dGrid< dim, dimworld, elType >
[ 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 dynamcic load balancing.
- Note:
- Adaptive parallel grid supporting dynamic load balancing, written mainly by Bernard Schupp. This grid supports hexahedrons and tetrahedrons.
Two tools are available for partitioning :
- Metis ( version 4.0 and higher, see http://www-users.cs.umn.edu/~karypis/metis/metis/ )
- Party Lib ( version 1.1 and higher, see http://wwwcs.upb.de/fachbereich/AG/monien/RESEARCH/PART/party.html)
Public Types | |||||||
typedef ALU3dGridFamily< dim, dimworld, elType >::Traits | Traits | ||||||
my Traits class | |||||||
typedef ALU3dGridHierarchicIndexSet< dim, dimworld, elType > | 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 SelectType< elType==tetra, ReferenceSimplex< alu3d_ctype, dim >, ReferenceCube< alu3d_ctype, dim > >::Type | ReferenceElementType | ||||||
reference element type | |||||||
Exported constants | |||||||
enum | { dimension = dim } | ||||||
A constant that exports the template parameter dim. More... | |||||||
enum | { dimensionworld = dimworld } | ||||||
A constant that exports the template parameter dimworld. More... | |||||||
Exported types | |||||||
typedef ct | ctype | ||||||
Define type used for coordinates in grid module. | |||||||
Public Member Functions | |||||||
~ALU3dGrid () | |||||||
Desctructor. | |||||||
std::string | name () const | ||||||
for grid identification | |||||||
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 | |||||||
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 | |||||||
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 | |||||||
bool | loadBalance () | ||||||
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. | |||||||
template<class DataHandle> | |||||||
bool | loadBalance (DataHandle &data) | ||||||
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. | |||||||
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 DataHandleImp, class DataTypeImp> | |||||||
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 Dune::CommDataHandleIF. | |||||||
template<class DataHandleImp, class DataTypeImp> | |||||||
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 Dune::CommDataHandleIF. | |||||||
const CollectiveCommunicationType & | comm () const | ||||||
return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication. | |||||||
bool | preAdapt () | ||||||
returns if a least one entity was marked for coarsening | |||||||
void | postAdapt () | ||||||
clear all entity new markers | |||||||
bool | adapt () | ||||||
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
| |||||||
template<class DofManagerType, class RestrictProlongOperatorType> | |||||||
bool | adapt (DofManagerType &dm, RestrictProlongOperatorType &rp, bool verbose=false) | ||||||
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
| |||||||
bool | globalRefine (int refCount) | ||||||
uses the interface, mark on entity and refineLocal | |||||||
template<GrapeIOFileFormatType ftype> | |||||||
bool | writeGrid (const std::string filename, alu3d_ctype time) const | ||||||
write Grid to file in specified FileFormatType | |||||||
bool | writeGrid_Ascii (const std::string filename, alu3d_ctype time, bool scientific=false) const | ||||||
write leaf grid in macro grid format to ascii file | |||||||
template<GrapeIOFileFormatType ftype> | |||||||
bool | readGrid (const std::string filename, alu3d_ctype &time) | ||||||
read Grid from file filename and store time of mesh in time | |||||||
bool | mark (int refCount, const typename Traits::template Codim< 0 >::EntityPointer &ep) | ||||||
Marks an entity to be refined/coarsened in a subsequent adapt.
| |||||||
int | getMark (const typename Traits::template Codim< 0 >::EntityPointer &) const | ||||||
returns adaptation mark for given entity pointer
| |||||||
const std::vector< GeometryType > & | geomTypes (int codim) const | ||||||
deliver all geometry types used in this grid | |||||||
const ReferenceElementType & | referenceElement () const | ||||||
return reference to Dune reference element according to elType | |||||||
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const | ||||||
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const | ||||||
Adaptivity and grid refinement | |||||||
bool | mark (int refCount, const typename Codim< 0 >::EntityPointer &e) | ||||||
Marks an entity to be refined/coarsened in a subsequent adapt. | |||||||
int | getMark (const typename Codim< 0 >::EntityPointer &e) const | ||||||
returns adaptation mark for given entity pointer | |||||||
Protected Types | |||||||
enum | { MAXL = 64 } | ||||||
max number of levels More... | |||||||
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 ALU3dGridFamily< dim, dimworld, elType >::LocalIdSetImp | LocalIdSetImp | ||||||
Type of the local id set. | |||||||
typedef ALU3dGridFamily< dim, dimworld, elType >::GlobalIdSetImp | GlobalIdSetImp | ||||||
Type of the global id set. | |||||||
typedef Traits::GlobalIdSet | GlobalIdSet | ||||||
Type of the global id set. | |||||||
typedef Traits::LocalIdSet | LocalIdSet | ||||||
Type of the local id set. | |||||||
typedef ALU3dGridLeafIterator< 0, All_Partition, MyType > | LeafIteratorImp | ||||||
a standard leaf iterator | |||||||
Protected Member Functions | |||||||
ALU3dGrid (const std::string macroTriangFilename, int myrank=-1) | |||||||
ALU3dGrid (const MyType &g) | |||||||
Copy constructor should not be used. | |||||||
ALU3dGrid< dim, dimworld, elType > & | operator= (const MyType &g) | ||||||
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 | |||||||
ReturnImplementationType< InterfaceType >::ImplementationType & | getRealImplementation (InterfaceType &i) const | ||||||
return real implementation of interface class | |||||||
GridImp & | asImp () | ||||||
Barton-Nackman trick. | |||||||
const GridImp & | asImp () const | ||||||
Barton-Nackman trick. |
Member Enumeration Documentation
anonymous enum [protected] |
anonymous enum [protected] |
anonymous enum [protected] |
anonymous enum [inherited] |
anonymous enum [inherited] |
Constructor & Destructor Documentation
Dune::ALU3dGrid< dim, dimworld, elType >::ALU3dGrid | ( | const std::string | macroTriangFilename, | |
int | myrank = -1 | |||
) | [inline, protected] |
Constructor which reads an ALU3dGrid Macro Triang file or given GridFile
Member Function Documentation
bool Dune::ALU3dGrid< dim, dimworld, elType >::loadBalance | ( | DataHandle & | data | ) | [inline] |
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> 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 ();
Reimplemented from Dune::GridDefaultImplementation< dim, dimworld, alu3d_ctype, ALU3dGridFamily< dim, dimworld, elType > >.
bool Dune::ALU3dGrid< dim, dimworld, elType >::adapt | ( | DofManagerType & | dm, | |
RestrictProlongOperatorType & | rp, | |||
bool | verbose = false | |||
) | [inline] |
Refine all positive marked leaf entities, coarsen all negative marked entities if possible.
- Returns:
- true if a least one entity was refined
- 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:
-
dm DofManager for dune-fem package for using callback during adaptation rp handler for restriction and prolongation operations which is a Model of the dune-fem RestrictProlongInterface class.
bool Dune::Grid< dim, dimworld, ct, GridFamily >::mark | ( | int | refCount, | |
const typename Codim< 0 >::EntityPointer & | e | |||
) | [inline, inherited] |
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 EntityPointer to Entity that should be refined
- Returns:
- true if Entity was marked, false otherwise.
int Dune::Grid< dim, dimworld, ct, GridFamily >::getMark | ( | const typename Codim< 0 >::EntityPointer & | e | ) | const [inline, inherited] |
returns adaptation mark for given entity pointer
- Parameters:
-
[in] e EntityPointer for which adaptation mark should be determined
- Returns:
- int adaptation mark currently set for given EntityPointer e
void Dune::GridDefaultImplementation< dim, dimworld, alu3d_ctype , ALU3dGridFamily< dim, dimworld, elType > >::communicate | ( | CommDataHandleIF< DataHandleImp, DataTypeImp > & | data, | |
InterfaceType | iftype, | |||
CommunicationDirection | dir, | |||
int | level | |||
) | const [inline, inherited] |
dummy communicate, doing nothing
Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.
Reimplemented in Dune::ALU3dGrid< 3, 3, Dune::hexa >, and Dune::ALU3dGrid< 3, 3, Dune::tetra >.
void Dune::GridDefaultImplementation< dim, dimworld, alu3d_ctype , ALU3dGridFamily< dim, dimworld, elType > >::communicate | ( | CommDataHandleIF< DataHandleImp, DataTypeImp > & | data, | |
InterfaceType | iftype, | |||
CommunicationDirection | dir | |||
) | const [inline, inherited] |
dummy communicate, doing nothing
Reimplemented from Dune::Grid< dim, dimworld, ct, GridFamily >.
Reimplemented in Dune::ALU3dGrid< 3, 3, Dune::hexa >, and Dune::ALU3dGrid< 3, 3, Dune::tetra >.
The documentation for this class was generated from the following files:
- alugrid/3d/grid.hh
- 3d/grid_imp.cc