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");
38 typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
48 typedef typename BaseType::ctype
ctype;
50 typedef typename GridFamily::Traits
Traits;
58 typedef typename Traits:: template Codim<0>::LeafIterator
LeafIterator;
71 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
74 const bool verb =
true ) :
75 BaseType(macroName, mpiComm, bndProject, bndVector, refineType )
77 const bool verbose = verb && this->comm().rank() == 0;
80 std::cout <<
"\nCreated " << ALUGridParallelSerial< Comm >() <<
" " <<
name() <<
nameSuffix()
81 <<
" from macro grid file '" << macroName <<
"'. \n\n";
85 static std::string
name () {
return std::string(
"ALUGrid"); }
89 std::string elt ( elType ==
cube ?
"cube," :
"simplex," );
90 std::string ref ( refineType ==
nonconforming ?
"nonconforming>" :
"conforming>" );
91 std::stringstream suffix;
109 const std::string macroName,
110 const bool verb =
true ) :
111 BaseType(
"", mpiComm, bndProject, bndVector, refineType )
113 const bool verbose = verb && this->comm().rank() == 0;
116 std::cout <<
"\nCreated " << ALUGridParallelSerial< Comm >() <<
" " <<
name() <<
nameSuffix();
117 if( macroName.empty() )
118 std::cout <<
" from input stream. \n";
120 std::cout <<
" from macro grid file '" << macroName <<
"'. \n";
121 std::cout << std::endl;
126 ALUGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
127 BaseType(
"", mpiComm,
132 if(this->comm().rank() == 0)
134 std::cout <<
"\nCreated empty " << ALUGridParallelSerial< Comm >() <<
" " <<
name() <<
nameSuffix() <<
"." << std::endl << std::endl;
142 template< PartitionIteratorType pitype >
145 typedef Dune::GridView< ALU3dLevelGridViewTraits< const This, pitype > >
LevelGridView;
146 typedef Dune::GridView< ALU3dLeafGridViewTraits< const This, pitype > >
LeafGridView;
153 template< PartitionIteratorType pitype >
156 template< PartitionIteratorType pitype >
164 template< PartitionIteratorType pitype >
168 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
172 template< PartitionIteratorType pitype >
176 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
182 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
188 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
199 This& operator = (
const ALUGrid& g);
Capabilities for ALUGrid.
Definition alu3dinclude.hh:50
Definition alu3dinclude.hh:80
static const char * ALUGridParallelSerial()
Definition alugrid.hh:23
@ cube
use only cube elements (i.e., quadrilaterals or hexahedra)
Definition declaration.hh:19
@ 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:48
LeafGridView leafGridView() const
Definition alugrid.hh:186
ALUGrid(const MPICommunicatorType mpiComm=BaseType::defaultCommunicator())
constructor creating empty grid, empty string creates empty grid
Definition alugrid.hh:126
GridFamily::LeafIndexSetImp LeafIndexSetImp
Definition alugrid.hh:55
BaseType::LocalIdSetImp LocalIdSetImp
Definition alugrid.hh:51
Partition< pitype >::LeafGridView leafGridView() const
Definition alugrid.hh:173
BaseType::HierarchicIteratorImp HierarchicIteratorImp
Definition alugrid.hh:139
BaseType::GridFamily GridFamily
Definition alugrid.hh:49
static std::string name()
Definition alugrid.hh:85
Partition< pitype >::LevelGridView levelGridView(int level) const
Definition alugrid.hh:165
static std::string nameSuffix()
Definition alugrid.hh:87
GridFamily::LevelIndexSetImp LevelIndexSetImp
Definition alugrid.hh:54
Partition< pitype >::LevelGridView levelView(int level) const
Definition alugrid.hh:154
BaseType::DuneBoundaryProjectionType DuneBoundaryProjectionType
type of boundary projection
Definition alugrid.hh:42
ALUGrid(const std::string macroName, const MPICommunicatorType mpiComm=BaseType::defaultCommunicator(), const DuneBoundaryProjectionType *bndProject=0, const DuneBoundaryProjectionVector *bndVector=0, const bool verb=true)
constructor for creating ALUGrid from given macro grid file
Definition alugrid.hh:70
Traits::template Codim< 0 >::LeafIterator LeafIterator
Definition alugrid.hh:58
Partition< All_Partition >::LevelGridView LevelGridView
Definition alugrid.hh:149
Traits::GlobalIdSet GlobalIdSet
Definition alugrid.hh:52
Traits::template Codim< 0 >::LeafIterator LeafIteratorType
Definition alugrid.hh:57
LevelGridView levelView(int level) const
Definition alugrid.hh:159
@ dimension
Definition alugrid.hh:47
@ dimensionworld
Definition alugrid.hh:47
Traits::LocalIdSet LocalIdSet
Definition alugrid.hh:53
BaseType::ObjectStreamType ObjectStreamType
Definition alugrid.hh:140
Partition< pitype >::LeafGridView leafView() const
Definition alugrid.hh:157
LeafGridView leafView() const
Definition alugrid.hh:161
BaseType::LeafIteratorImp LeafIteratorImp
Definition alugrid.hh:56
ALUGrid(const MPICommunicatorType mpiComm, const DuneBoundaryProjectionType *bndProject, const DuneBoundaryProjectionVector *bndVector, const std::string macroName, const bool verb=true)
constructor called from ALUGridFactory for creating ALUConformGrid from given macro grid file
Definition alugrid.hh:106
BaseType::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
type of boundary projection
Definition alugrid.hh:45
LevelGridView levelGridView(int level) const
Definition alugrid.hh:180
GridFamily::Traits Traits
Definition alugrid.hh:50
Partition< All_Partition >::LeafGridView LeafGridView
Definition alugrid.hh:150
Definition alugrid.hh:144
Dune::GridView< ALU3dLeafGridViewTraits< const This, pitype > > LeafGridView
Definition alugrid.hh:146
Dune::GridView< ALU3dLevelGridViewTraits< const This, pitype > > LevelGridView
Definition alugrid.hh:145
Factory class for ALUGrids.
Definition gridfactory.hh:28
Definition declaration.hh:78