1 #ifndef DUNE_ALU3DGRID_ALUGRID_HH
2 #define DUNE_ALU3DGRID_ALUGRID_HH
24 template<
int dim,
int dimworld >
27 template<
int dim,
int dimworld >
32 #if ALU3DGRID_PARALLEL
45 class ALUCubeGrid< 3, 3 >
52 enum { dimworld = 3 };
73 ALUCubeGrid(
const std::string macroName,
74 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
77 const bool verb =
true ) :
80 const bool verbose = verb && this->comm().rank() == 0;
84 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
97 ALUCubeGrid(
const MPICommunicatorType mpiComm,
100 const std::string macroName,
101 const bool verb =
true ) :
104 const bool verbose = verb && this->comm().rank() == 0;
108 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
113 ALUCubeGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator() ) :
119 if(this->comm().rank() == 0)
121 std::cout <<
"\nCreated empty ALUCubeGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
125 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
142 template< PartitionIteratorType pitype >
154 template< PartitionIteratorType pitype >
159 return LevelGridView( LevelGridViewImp( *
this, level ) );
162 template< PartitionIteratorType pitype >
167 return LeafGridView( LeafGridViewImp( *
this ) );
184 friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> ,
HasObjectStream > ;
192 ALUCubeGrid(
const ALUCubeGrid & g ) ;
195 ALUCubeGrid<dim,dimworld>&
196 operator = (
const ALUCubeGrid& g);
207 class ALUSimplexGrid< 3, 3 >
214 enum { dimworld = 3 };
235 ALUSimplexGrid(
const std::string macroName,
236 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
239 const bool verb =
true ) :
242 const bool verbose = verb && this->comm().rank() == 0;
246 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
259 ALUSimplexGrid(
const MPICommunicatorType mpiComm,
262 const std::string macroName,
263 const bool verb =
true ) :
266 const bool verbose = verb && this->comm().rank() == 0;
270 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
275 ALUSimplexGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
281 if(this->comm().rank() == 0)
283 std::cout <<
"\nCreated empty ALUSimplexGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
287 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
304 template< PartitionIteratorType pitype >
316 template< PartitionIteratorType pitype >
321 return LevelGridView( LevelGridViewImp( *
this, level ) );
324 template< PartitionIteratorType pitype >
329 return LeafGridView( LeafGridViewImp( *
this ) );
345 friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
346 friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
354 ALUSimplexGrid(
const ALUSimplexGrid & g );
357 ALUSimplexGrid<dim,dimworld>&
358 operator = (
const ALUSimplexGrid& g);
380 template< ALUGr
idElementType elType, ALUGr
idRefinementType refineType,
class Comm >
381 class ALUGrid< 3, 3, elType, refineType, Comm >
382 :
public ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid
385 typedef typename ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid BaseType;
388 enum { dimworld = 3 };
390 typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
409 ALUGrid(
const std::string macroName,
410 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
413 const bool verb =
true ) :
414 BaseType(macroName, mpiComm, bndProject, bndVector, refineType )
416 const bool verbose = verb && this->comm().rank() == 0;
420 <<
" from macro grid file '" << macroName <<
"'. \n\n";
424 static std::string
name () {
return std::string(
"ALUGrid"); }
426 static std::string nameSuffix()
428 std::string elt ( elType ==
cube ?
"cube," :
"simplex," );
429 std::string ref ( refineType ==
nonconforming ?
"nonconforming>" :
"conforming>" );
430 std::stringstream suffix;
431 suffix <<
"<"<<dim<<
","<<dimworld<<
"," << elt << ref;
445 ALUGrid(
const MPICommunicatorType mpiComm,
448 const std::string macroName,
449 const bool verb =
true ) :
450 BaseType(
"", mpiComm, bndProject, bndVector, refineType )
452 const bool verbose = verb && this->comm().rank() == 0;
456 <<
" from macro grid file '" << macroName <<
"'. \n\n";
461 ALUGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
462 BaseType(
"", mpiComm,
467 if(this->comm().rank() == 0)
469 std::cout <<
"\nCreated empty " <<
ALUGridParallelSerial() <<
" " << name() << nameSuffix() <<
"." << std::endl << std::endl;
473 enum { dimension=BaseType::dimension, dimensionworld=BaseType::dimensionworld};
474 typedef typename BaseType::ctype
ctype;
476 typedef typename GridFamily::Traits
Traits;
484 typedef typename Traits:: template Codim<0>::LeafIterator
LeafIterator;
490 template< PartitionIteratorType pitype >
502 template< PartitionIteratorType pitype >
507 return LevelGridView( LevelGridViewImp( *
this, level ) );
510 template< PartitionIteratorType pitype >
515 return LeafGridView( LeafGridViewImp( *
this ) );
540 ALUGrid(
const ALUGrid & g );
543 This& operator = (
const ALUGrid& g);
548 #endif // #ifdef ENABLE_ALUGRID