1#ifndef DUNE_ALU3DGRID_ALUGRID_HH
2#define DUNE_ALU3DGRID_ALUGRID_HH
25 return ( std::is_same< Comm, ALUGridNoComm >::value ) ?
"serial" :
"parallel";
28 template<
int dim,
int dimworld, ALUGr
idElementType elType, ALUGr
idRefinementType refineType,
class Comm >
33 static_assert( elType ==
cube ? refineType ==
nonconforming :
true,
"cube only works with nonconforming refinement");
46 typedef typename BaseType::ctype
ctype;
48 typedef typename GridFamily::Traits
Traits;
56 typedef typename Traits:: template Codim<0>::LeafIterator
LeafIterator;
71 const bool verb =
true ) :
72 BaseType(macroName, mpiComm, bndPrj, refineType )
74 const bool verbose = verb && this->comm().rank() == 0;
77 std::cout <<
"\nCreated " << ALUGridParallelSerial< Comm >() <<
" " <<
name() <<
nameSuffix()
78 <<
" from macro grid file '" << macroName <<
"'. \n\n";
82 static std::string
name () {
return std::string(
"ALUGrid"); }
86 std::string elt ( elType ==
cube ?
"cube," :
"simplex," );
87 std::string ref ( refineType ==
nonconforming ?
"nonconforming>" :
"conforming>" );
88 std::stringstream suffix;
105 const std::string macroName,
106 const bool verb =
true ) :
107 BaseType(
"", mpiComm, bndPrj, refineType )
109 const bool verbose = verb && this->comm().rank() == 0;
112 std::cout <<
"\nCreated " << ALUGridParallelSerial< Comm >() <<
" " <<
name() <<
nameSuffix();
113 if( macroName.empty() )
114 std::cout <<
" from input stream. \n";
116 std::cout <<
" from macro grid file '" << macroName <<
"'. \n";
117 std::cout << std::endl;
125 if(this->comm().rank() == 0)
127 std::cout <<
"\nCreated empty " << ALUGridParallelSerial< Comm >() <<
" " <<
name() <<
nameSuffix() <<
"." << std::endl << std::endl;
135 template< PartitionIteratorType pitype >
138 typedef Dune::GridView< ALU3dLevelGridViewTraits< const This, pitype > >
LevelGridView;
139 typedef Dune::GridView< ALU3dLeafGridViewTraits< const This, pitype > >
LeafGridView;
146 template< PartitionIteratorType pitype >
149 template< PartitionIteratorType pitype >
157 template< PartitionIteratorType pitype >
161 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
165 template< PartitionIteratorType pitype >
169 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
175 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
181 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
Capabilities for ALUGrid.
Definition: alu3dinclude.hh:33
Definition: alu3dinclude.hh:63
static const char * ALUGridParallelSerial()
Definition: alugrid.hh:23
@ cube
use only cube elements (i.e., quadrilaterals or hexahedra)
Definition: declaration.hh:19
ALUGridRefinementType
available refinement types for ALUGrid
Definition: declaration.hh:24
@ nonconforming
use non-conforming (red) refinement
Definition: declaration.hh:26
unstructured parallel implementation of the DUNE grid interface
Definition: alugrid.hh:31
BaseType::ctype ctype
Definition: alugrid.hh:46
LeafGridView leafGridView() const
Definition: alugrid.hh:179
ALUGrid(const MPICommunicatorType mpiComm=BaseType::defaultCommunicator())
constructor creating empty grid, empty string creates empty grid
Definition: alugrid.hh:122
GridFamily::LeafIndexSetImp LeafIndexSetImp
Definition: alugrid.hh:53
BaseType::LocalIdSetImp LocalIdSetImp
Definition: alugrid.hh:49
Partition< pitype >::LeafGridView leafGridView() const
Definition: alugrid.hh:166
BaseType::HierarchicIteratorImp HierarchicIteratorImp
Definition: alugrid.hh:132
BaseType::GridFamily GridFamily
Definition: alugrid.hh:47
static std::string name()
Definition: alugrid.hh:82
Partition< pitype >::LevelGridView levelGridView(int level) const
Definition: alugrid.hh:158
static std::string nameSuffix()
Definition: alugrid.hh:84
GridFamily::LevelIndexSetImp LevelIndexSetImp
Definition: alugrid.hh:52
Partition< pitype >::LevelGridView levelView(int level) const
Definition: alugrid.hh:147
BaseType::ALUGridVertexProjectionPairType ALUGridVertexProjectionPairType
type of boundary projection
Definition: alugrid.hh:42
Traits::template Codim< 0 >::LeafIterator LeafIterator
Definition: alugrid.hh:56
Partition< All_Partition >::LevelGridView LevelGridView
Definition: alugrid.hh:142
ALUGrid(const MPICommunicatorType mpiComm, const ALUGridVertexProjectionPairType &bndPrj, const std::string macroName, const bool verb=true)
constructor called from ALUGridFactory for creating ALUConformGrid from given macro grid file
Definition: alugrid.hh:103
Traits::GlobalIdSet GlobalIdSet
Definition: alugrid.hh:50
ALUGrid(const std::string macroName, const MPICommunicatorType mpiComm=BaseType::defaultCommunicator(), const ALUGridVertexProjectionPairType &bndPrj=ALUGridVertexProjectionPairType(), const bool verb=true)
constructor for creating ALUGrid from given macro grid file
Definition: alugrid.hh:68
Traits::template Codim< 0 >::LeafIterator LeafIteratorType
Definition: alugrid.hh:55
LevelGridView levelView(int level) const
Definition: alugrid.hh:152
@ dimension
Definition: alugrid.hh:44
@ dimensionworld
Definition: alugrid.hh:44
Traits::LocalIdSet LocalIdSet
Definition: alugrid.hh:51
BaseType::ObjectStreamType ObjectStreamType
Definition: alugrid.hh:133
static const ALUGridRefinementType refinementType
Definition: alugrid.hh:45
Partition< pitype >::LeafGridView leafView() const
Definition: alugrid.hh:150
LeafGridView leafView() const
Definition: alugrid.hh:154
BaseType::MPICommunicatorType MPICommunicatorType
Definition: alugrid.hh:39
BaseType::LeafIteratorImp LeafIteratorImp
Definition: alugrid.hh:54
LevelGridView levelGridView(int level) const
Definition: alugrid.hh:173
GridFamily::Traits Traits
Definition: alugrid.hh:48
Partition< All_Partition >::LeafGridView LeafGridView
Definition: alugrid.hh:143
Definition: alugrid.hh:137
Dune::GridView< ALU3dLeafGridViewTraits< const This, pitype > > LeafGridView
Definition: alugrid.hh:139
Dune::GridView< ALU3dLevelGridViewTraits< const This, pitype > > LevelGridView
Definition: alugrid.hh:138
Factory class for ALUGrids.
Definition: gridfactory.hh:30
Definition: declaration.hh:82