3#ifndef DUNE_ALU3DGRID_ALUGRID_HH
4#define DUNE_ALU3DGRID_ALUGRID_HH
7#if HAVE_ALUGRID || DOXYGEN
10#include <dune/grid/alugrid/common/capabilities.hh>
11#include <dune/grid/alugrid/3d/capabilities.hh>
12#include <dune/grid/alugrid/3d/indexsets.hh>
13#include <dune/grid/alugrid/3d/iterator.hh>
14#include <dune/grid/alugrid/3d/entity.hh>
15#include <dune/grid/alugrid/3d/geometry.hh>
16#include <dune/grid/alugrid/3d/grid.hh>
26 template<
int dim,
int dimworld >
29 template<
int dim,
int dimworld >
32 static inline const char* ALUGridParallelSerial()
55 enum { dimworld = 3 };
57 typedef BaseType::MPICommunicatorType MPICommunicatorType;
79 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
82 const bool verb =
true ) :
83 BaseType(macroName,mpiComm,bndProject, bndVector, nonconforming )
85 const bool verbose = verb && this->comm().rank() == 0;
88 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" ALUCubeGrid<"<<dim<<
","<<dimworld;
89 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
107 const std::string macroName,
108 const bool verb =
true ) :
109 BaseType(
"", mpiComm, bndProject, bndVector, nonconforming )
111 const bool verbose = verb && this->comm().rank() == 0;
114 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" ALUCubeGrid<"<<dim<<
","<<dimworld;
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};
135 typedef BaseType::ctype ctype;
136 typedef BaseType::GridFamily GridFamily;
137 typedef GridFamily::Traits Traits;
138 typedef BaseType::LocalIdSetImp LocalIdSetImp;
139 typedef Traits :: GlobalIdSet GlobalIdSet;
140 typedef Traits :: LocalIdSet LocalIdSet;
141 typedef GridFamily :: LevelIndexSetImp LevelIndexSetImp;
142 typedef GridFamily :: LeafIndexSetImp LeafIndexSetImp;
143 typedef BaseType::LeafIteratorImp LeafIteratorImp;
144 typedef Traits::Codim<0>::LeafIterator LeafIteratorType;
145 typedef Traits::Codim<0>::LeafIterator LeafIterator;
148 typedef BaseType::HierarchicIteratorImp HierarchicIteratorImp;
149 typedef BaseType::ObjectStreamType ObjectStreamType;
151 template< PartitionIteratorType pitype >
160 typedef Partition< All_Partition > :: LevelGridView LevelGridView;
161 typedef Partition< All_Partition > :: LeafGridView LeafGridView;
163 template< PartitionIteratorType pitype >
164 typename Partition< pitype >::LevelGridView levelView (
int level )
const
166 typedef typename Partition< pitype >::LevelGridView LevelGridView;
167 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
168 return LevelGridView( LevelGridViewImp( *
this, level ) );
171 template< PartitionIteratorType pitype >
172 typename Partition< pitype >::LeafGridView leafView ()
const
174 typedef typename Partition< pitype >::LeafGridView LeafGridView;
175 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
176 return LeafGridView( LeafGridViewImp( *
this ) );
179 LevelGridView levelView (
int level )
const
181 typedef LevelGridView::GridViewImp LevelGridViewImp;
182 return LevelGridView( LevelGridViewImp( *
this, level ) );
185 LeafGridView leafView ()
const
187 typedef LeafGridView::GridViewImp LeafGridViewImp;
188 return LeafGridView( LeafGridViewImp( *
this ) );
191 template< PartitionIteratorType pitype >
192 typename Partition< pitype >::LevelGridView levelGridView (
int level )
const
194 typedef typename Partition< pitype >::LevelGridView LevelGridView;
195 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
196 return LevelGridView( LevelGridViewImp( *
this, level ) );
199 template< PartitionIteratorType pitype >
200 typename Partition< pitype >::LeafGridView leafGridView ()
const
202 typedef typename Partition< pitype >::LeafGridView LeafGridView;
203 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
204 return LeafGridView( LeafGridViewImp( *
this ) );
207 LevelGridView levelGridView (
int level )
const
209 typedef LevelGridView::GridViewImp LevelGridViewImp;
210 return LevelGridView( LevelGridViewImp( *
this, level ) );
213 LeafGridView leafGridView ()
const
215 typedef LeafGridView::GridViewImp LeafGridViewImp;
216 return LeafGridView( LeafGridViewImp( *
this ) );
220 friend class Conversion< ALUCubeGrid<dimension,dimensionworld> , HasObjectStream > ;
221 friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> , HasObjectStream > ;
223 friend class Conversion< ALUCubeGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
224 friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
226 template<
class >
friend class ALU3dGridFactory;
229 ALUCubeGrid(
const ALUCubeGrid & g ) ;
232 ALUCubeGrid<dim,dimworld>&
233 operator = (
const ALUCubeGrid& g);
252 enum { dimworld = 3 };
254 typedef BaseType::MPICommunicatorType MPICommunicatorType;
276 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
279 const bool verb =
true ) :
280 BaseType(macroName, mpiComm, bndProject, bndVector, nonconforming )
282 const bool verbose = verb && this->comm().rank() == 0;
285 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" ALUSimplexGrid<"<<dim<<
","<<dimworld;
286 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
304 const std::string macroName,
305 const bool verb =
true ) :
306 BaseType(
"", mpiComm, bndProject, bndVector, nonconforming )
308 const bool verbose = verb && this->comm().rank() == 0;
311 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" ALUSimplexGrid<"<<dim<<
","<<dimworld;
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};
332 typedef BaseType::ctype ctype;
333 typedef BaseType::GridFamily GridFamily;
334 typedef GridFamily::Traits Traits;
335 typedef BaseType::LocalIdSetImp LocalIdSetImp;
336 typedef Traits :: GlobalIdSet GlobalIdSet;
337 typedef Traits :: LocalIdSet LocalIdSet;
338 typedef GridFamily :: LevelIndexSetImp LevelIndexSetImp;
339 typedef GridFamily :: LeafIndexSetImp LeafIndexSetImp;
340 typedef BaseType::LeafIteratorImp LeafIteratorImp;
341 typedef Traits::Codim<0>::LeafIterator LeafIteratorType;
342 typedef Traits::Codim<0>::LeafIterator LeafIterator;
345 typedef BaseType::HierarchicIteratorImp HierarchicIteratorImp;
346 typedef BaseType::ObjectStreamType ObjectStreamType;
348 template< PartitionIteratorType pitype >
357 typedef Partition< All_Partition > :: LevelGridView LevelGridView;
358 typedef Partition< All_Partition > :: LeafGridView LeafGridView;
360 template< PartitionIteratorType pitype >
361 typename Partition< pitype >::LevelGridView levelView (
int level )
const
363 typedef typename Partition< pitype >::LevelGridView LevelGridView;
364 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
365 return LevelGridView( LevelGridViewImp( *
this, level ) );
368 template< PartitionIteratorType pitype >
369 typename Partition< pitype >::LeafGridView leafView ()
const
371 typedef typename Partition< pitype >::LeafGridView LeafGridView;
372 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
373 return LeafGridView( LeafGridViewImp( *
this ) );
376 LevelGridView levelView (
int level )
const
378 typedef LevelGridView::GridViewImp LevelGridViewImp;
379 return LevelGridView( LevelGridViewImp( *
this, level ) );
382 LeafGridView leafView ()
const
384 typedef LeafGridView::GridViewImp LeafGridViewImp;
385 return LeafGridView( LeafGridViewImp( *
this ) );
388 template< PartitionIteratorType pitype >
389 typename Partition< pitype >::LevelGridView levelGridView (
int level )
const
391 typedef typename Partition< pitype >::LevelGridView LevelGridView;
392 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
393 return LevelGridView( LevelGridViewImp( *
this, level ) );
396 template< PartitionIteratorType pitype >
397 typename Partition< pitype >::LeafGridView leafGridView ()
const
399 typedef typename Partition< pitype >::LeafGridView LeafGridView;
400 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
401 return LeafGridView( LeafGridViewImp( *
this ) );
404 LevelGridView levelGridView (
int level )
const
406 typedef LevelGridView::GridViewImp LevelGridViewImp;
407 return LevelGridView( LevelGridViewImp( *
this, level ) );
410 LeafGridView leafGridView ()
const
412 typedef LeafGridView::GridViewImp LeafGridViewImp;
413 return LeafGridView( LeafGridViewImp( *
this ) );
417 friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> , HasObjectStream > ;
418 friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> , HasObjectStream > ;
420 friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
421 friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> , HasHierarchicIndexSet > ;
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
456 typedef ALUGrid< 3, 3, elType, refineType, Comm > This;
457 typedef typename ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid BaseType;
460 enum { dimworld = 3 };
462 typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
466 typedef typename BaseType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
469 typedef typename BaseType :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
481 ALUGrid(
const std::string macroName,
482 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
483 const DuneBoundaryProjectionType* bndProject = 0,
484 const DuneBoundaryProjectionVector* bndVector = 0,
485 const bool verb =
true ) :
486 BaseType(macroName, mpiComm, bndProject, bndVector, refineType )
488 const bool verbose = verb && this->comm().rank() == 0;
491 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" " << name() << nameSuffix()
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,
518 const DuneBoundaryProjectionType* bndProject ,
519 const DuneBoundaryProjectionVector* bndVector,
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;
527 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" " << name() << nameSuffix()
528 <<
" from macro grid file '" << macroName <<
"'. \n\n";
533 ALUGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
534 BaseType(
"", mpiComm,
535 (const DuneBoundaryProjectionType *) 0,
536 (const DuneBoundaryProjectionVector* ) 0,
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;
547 typedef typename BaseType::GridFamily GridFamily;
548 typedef typename GridFamily::Traits Traits;
549 typedef typename BaseType::LocalIdSetImp LocalIdSetImp;
550 typedef typename Traits :: GlobalIdSet GlobalIdSet;
551 typedef typename Traits :: LocalIdSet LocalIdSet;
552 typedef typename GridFamily :: LevelIndexSetImp LevelIndexSetImp;
553 typedef typename GridFamily :: LeafIndexSetImp LeafIndexSetImp;
554 typedef typename BaseType::LeafIteratorImp LeafIteratorImp;
555 typedef typename Traits:: template Codim<0>::LeafIterator LeafIteratorType;
556 typedef typename Traits:: template Codim<0>::LeafIterator LeafIterator;
559 typedef typename BaseType::HierarchicIteratorImp HierarchicIteratorImp;
560 typedef typename BaseType::ObjectStreamType ObjectStreamType;
562 template< PartitionIteratorType pitype >
571 typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
572 typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
574 template< PartitionIteratorType pitype >
575 typename Partition< pitype >::LevelGridView levelView (
int level )
const
577 typedef typename Partition< pitype >::LevelGridView LevelGridView;
578 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
579 return LevelGridView( LevelGridViewImp( *
this, level ) );
582 template< PartitionIteratorType pitype >
583 typename Partition< pitype >::LeafGridView leafView ()
const
585 typedef typename Partition< pitype >::LeafGridView LeafGridView;
586 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
587 return LeafGridView( LeafGridViewImp( *
this ) );
590 LevelGridView levelView (
int level )
const
592 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
593 return LevelGridView( LevelGridViewImp( *
this, level ) );
596 LeafGridView leafView ()
const
598 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
599 return LeafGridView( LeafGridViewImp( *
this ) );
602 template< PartitionIteratorType pitype >
603 typename Partition< pitype >::LevelGridView levelGridView (
int level )
const
605 typedef typename Partition< pitype >::LevelGridView LevelGridView;
606 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
607 return LevelGridView( LevelGridViewImp( *
this, level ) );
610 template< PartitionIteratorType pitype >
611 typename Partition< pitype >::LeafGridView leafGridView ()
const
613 typedef typename Partition< pitype >::LeafGridView LeafGridView;
614 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
615 return LeafGridView( LeafGridViewImp( *
this ) );
618 LevelGridView levelGridView (
int level )
const
620 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
621 return LevelGridView( LevelGridViewImp( *
this, level ) );
624 LeafGridView leafGridView ()
const
626 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
627 return LeafGridView( LeafGridViewImp( *
this ) );
631 friend class Conversion< This , HasObjectStream > ;
632 friend class Conversion< const This, HasObjectStream > ;
634 friend class Conversion< This, HasHierarchicIndexSet > ;
635 friend class Conversion< const This, HasHierarchicIndexSet > ;
637 template<
class >
friend class ALU3dGridFactory;
640 ALUGrid(
const ALUGrid & g );
643 This& operator = (
const ALUGrid& g);
[ provides Dune::Grid ]
Definition: grid.hh:406
constructor for creating ALUCubeGrid from given macro grid file
Definition: alugrid.hh:50
DUNE_DEPRECATED ALUCubeGrid(const std::string macroName, const MPICommunicatorType mpiComm=BaseType::defaultCommunicator(), const DuneBoundaryProjectionType *bndProject=0, const DuneBoundaryProjectionVector *bndVector=0, const bool verb=true)
constructor for creating ALUCubeGrid from given macro grid file
Definition: alugrid.hh:78
DUNE_DEPRECATED ALUCubeGrid(const MPICommunicatorType mpiComm, const DuneBoundaryProjectionType *bndProject, const DuneBoundaryProjectionVector *bndVector, const std::string macroName, const bool verb=true)
constructor called from ALUGridFactory for creating ALUCubeGrid from given macro grid file
Definition: alugrid.hh:104
DUNE_DEPRECATED ALUCubeGrid(const MPICommunicatorType mpiComm=BaseType::defaultCommunicator())
constructor creating empty grid
Definition: alugrid.hh:122
BaseType::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
type of boundary projection
Definition: alugrid.hh:64
BaseType::DuneBoundaryProjectionType DuneBoundaryProjectionType
type of boundary projection
Definition: alugrid.hh:61
[ provides Dune::Grid ]
Definition: alugrid.hh:53
constructor for creating ALUSimplexGrid from given macro grid file
Definition: alugrid.hh:247
DUNE_DEPRECATED ALUSimplexGrid(const MPICommunicatorType mpiComm=BaseType::defaultCommunicator())
Definition: alugrid.hh:319
BaseType::DuneBoundaryProjectionType DuneBoundaryProjectionType
type of boundary projection
Definition: alugrid.hh:258
BaseType::DuneBoundaryProjectionVector DuneBoundaryProjectionVector
type of boundary projection
Definition: alugrid.hh:261
DUNE_DEPRECATED ALUSimplexGrid(const MPICommunicatorType mpiComm, const DuneBoundaryProjectionType *bndProject, const DuneBoundaryProjectionVector *bndVector, const std::string macroName, const bool verb=true)
constructor called from ALUGridFactory for creating ALUSimplexGrid from given macro grid file
Definition: alugrid.hh:301
DUNE_DEPRECATED ALUSimplexGrid(const std::string macroName, const MPICommunicatorType mpiComm=BaseType::defaultCommunicator(), const DuneBoundaryProjectionType *bndProject=0, const DuneBoundaryProjectionVector *bndVector=0, const bool verb=true)
constructor for creating ALUSimplexGrid from given macro grid file
Definition: alugrid.hh:275
[ provides Dune::Grid ]
Definition: alugrid.hh:85
Grid view abstract base class.
Definition: gridview.hh:57
#define DUNE_DEPRECATED
Mark some entity as deprecated.
Definition: deprecated.hh:84
Dune namespace.
Definition: alignment.hh:14
Interface class for vertex projection at the boundary.
Definition: boundaryprojection.hh:24