3 #ifndef DUNE_ALU3DGRID_ALUGRID_HH
4 #define DUNE_ALU3DGRID_ALUGRID_HH
7 #if HAVE_ALUGRID || DOXYGEN
26 template<
int dim,
int dimworld >
29 template<
int dim,
int dimworld >
34 #if ALU3DGRID_PARALLEL
48 class ALUCubeGrid< 3, 3 >
55 enum { dimworld = 3 };
78 ALUCubeGrid(
const std::string macroName,
79 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
82 const bool verb =
true ) :
85 const bool verbose = verb && this->comm().rank() == 0;
89 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
104 ALUCubeGrid(
const MPICommunicatorType mpiComm,
107 const std::string macroName,
108 const bool verb =
true ) :
111 const bool verbose = verb && this->comm().rank() == 0;
115 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
122 ALUCubeGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator() ) :
128 if(this->comm().rank() == 0)
130 std::cout <<
"\nCreated empty ALUCubeGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
134 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
151 template< PartitionIteratorType pitype >
163 template< PartitionIteratorType pitype >
168 return LevelGridView( LevelGridViewImp( *
this, level ) );
171 template< PartitionIteratorType pitype >
176 return LeafGridView( LeafGridViewImp( *
this ) );
191 template< PartitionIteratorType pitype >
196 return LevelGridView( LevelGridViewImp( *
this, level ) );
199 template< PartitionIteratorType pitype >
204 return LeafGridView( LeafGridViewImp( *
this ) );
221 friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> ,
HasObjectStream > ;
226 template<
class >
friend class ALU3dGridFactory;
229 ALUCubeGrid(
const ALUCubeGrid & g ) ;
232 ALUCubeGrid<dim,dimworld>&
233 operator = (
const ALUCubeGrid& g);
245 class ALUSimplexGrid< 3, 3 >
252 enum { dimworld = 3 };
275 ALUSimplexGrid(
const std::string macroName,
276 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
279 const bool verb =
true ) :
282 const bool verbose = verb && this->comm().rank() == 0;
286 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
301 ALUSimplexGrid(
const MPICommunicatorType mpiComm,
304 const std::string macroName,
305 const bool verb =
true ) :
308 const bool verbose = verb && this->comm().rank() == 0;
312 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
319 ALUSimplexGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
325 if(this->comm().rank() == 0)
327 std::cout <<
"\nCreated empty ALUSimplexGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
331 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
348 template< PartitionIteratorType pitype >
360 template< PartitionIteratorType pitype >
365 return LevelGridView( LevelGridViewImp( *
this, level ) );
368 template< PartitionIteratorType pitype >
373 return LeafGridView( LeafGridViewImp( *
this ) );
388 template< PartitionIteratorType pitype >
393 return LevelGridView( LevelGridViewImp( *
this, level ) );
396 template< PartitionIteratorType pitype >
401 return LeafGridView( LeafGridViewImp( *
this ) );
417 friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
418 friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
423 template<
class >
friend class ALU3dGridFactory;
426 ALUSimplexGrid(
const ALUSimplexGrid & g );
429 ALUSimplexGrid<dim,dimworld>&
430 operator = (
const ALUSimplexGrid& g);
452 template< ALUGr
idElementType elType, ALUGr
idRefinementType refineType,
class Comm >
453 class ALUGrid< 3, 3, elType, refineType, Comm >
454 :
public ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid
457 typedef typename ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid BaseType;
460 enum { dimworld = 3 };
462 typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
481 ALUGrid(
const std::string macroName,
482 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
485 const bool verb =
true ) :
486 BaseType(macroName, mpiComm, bndProject, bndVector, refineType )
488 const bool verbose = verb && this->comm().rank() == 0;
492 <<
" from macro grid file '" << macroName <<
"'. \n\n";
496 static std::string
name () {
return std::string(
"ALUGrid"); }
498 static std::string nameSuffix()
500 std::string elt ( elType ==
cube ?
"cube," :
"simplex," );
501 std::string ref ( refineType ==
nonconforming ?
"nonconforming>" :
"conforming>" );
502 std::stringstream suffix;
503 suffix <<
"<"<<dim<<
","<<dimworld<<
"," << elt << ref;
517 ALUGrid(
const MPICommunicatorType mpiComm,
520 const std::string macroName,
521 const bool verb =
true ) :
522 BaseType(
"", mpiComm, bndProject, bndVector, refineType )
524 const bool verbose = verb && this->comm().rank() == 0;
528 <<
" from macro grid file '" << macroName <<
"'. \n\n";
533 ALUGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
534 BaseType(
"", mpiComm,
539 if(this->comm().rank() == 0)
541 std::cout <<
"\nCreated empty " <<
ALUGridParallelSerial() <<
" " << name() << nameSuffix() <<
"." << std::endl << std::endl;
545 enum { dimension=BaseType::dimension, dimensionworld=BaseType::dimensionworld};
546 typedef typename BaseType::ctype
ctype;
548 typedef typename GridFamily::Traits
Traits;
556 typedef typename Traits:: template Codim<0>::LeafIterator
LeafIterator;
562 template< PartitionIteratorType pitype >
574 template< PartitionIteratorType pitype >
579 return LevelGridView( LevelGridViewImp( *
this, level ) );
582 template< PartitionIteratorType pitype >
587 return LeafGridView( LeafGridViewImp( *
this ) );
602 template< PartitionIteratorType pitype >
607 return LevelGridView( LevelGridViewImp( *
this, level ) );
610 template< PartitionIteratorType pitype >
615 return LeafGridView( LeafGridViewImp( *
this ) );
637 template<
class >
friend class ALU3dGridFactory;
640 ALUGrid(
const ALUGrid & g );
643 This& operator = (
const ALUGrid& g);
648 #endif // #if HAVE_ALUGRID || DOXYGEN