3 #ifndef DUNE_ALU2D_ALUGRID_HH
4 #define DUNE_ALU2D_ALUGRID_HH
7 #if HAVE_ALUGRID || DOXYGEN
24 class ALUCubeGrid< 2, dimw >
31 enum { dimworld = dimw };
50 ALUCubeGrid(
const std::string macroName,
53 const bool verbose =
true )
54 :
BaseType(macroName,1, bndProject, bndVector)
58 std::cout <<
"\nCreated serial ALUCubeGrid<"<<dim<<
","<<dimworld;
59 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
74 ALUCubeGrid(
const std::string macroName,
75 std::istream& macroFile,
78 const bool verbose =
true )
79 :
BaseType(
"",1, bndProject, bndVector, ¯oFile)
83 std::cout <<
"\nCreated serial ALUCubeGrid<"<<dim<<
","<<dimworld;
85 std::cout <<
">. \n\n";
87 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
96 std::cout <<
"\nCreated empty ALUCubeGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
99 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
100 enum { refineStepsForHalf = 1 };
103 typedef typename GridFamily::Traits
Traits;
114 template< PartitionIteratorType pitype >
126 template< PartitionIteratorType pitype >
131 return LevelGridView( LevelGridViewImp( *
this, level ) );
134 template< PartitionIteratorType pitype >
139 return LeafGridView( LeafGridViewImp( *
this ) );
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 > ;
190 friend class ALU2dGridFactory;
193 ALUCubeGrid(
const ALUCubeGrid & g ) ;
196 ALUCubeGrid<dim,dimworld>&
197 operator = (
const ALUCubeGrid& g);
207 class ALUSimplexGrid< 2, dimw >
214 enum { dimworld = dimw };
233 ALUSimplexGrid(
const std::string macroName,
236 const bool verbose =
true )
237 :
BaseType(macroName,1, bndProject, bndVector)
241 std::cout <<
"\nCreated serial ALUSimplexGrid<"<<dim<<
","<<dimworld;
242 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
257 ALUSimplexGrid(
const std::string macroName,
258 std::istream& macroFile,
261 const bool verbose =
true )
262 :
BaseType(
"",1, bndProject, bndVector, ¯oFile)
266 std::cout <<
"\nCreated serial ALUSimplexGrid<"<<dim<<
","<<dimworld;
267 if( macroName ==
"" )
268 std::cout <<
">. \n\n";
270 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
279 std::cout <<
"\nCreated empty ALUSimplexGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
282 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
283 enum { refineStepsForHalf = 1 };
297 template< PartitionIteratorType pitype >
309 template< PartitionIteratorType pitype >
314 return LevelGridView( LevelGridViewImp( *
this, level ) );
317 template< PartitionIteratorType pitype >
322 return LeafGridView( LeafGridViewImp( *
this ) );
337 template< PartitionIteratorType pitype >
342 return LevelGridView( LevelGridViewImp( *
this, level ) );
345 template< PartitionIteratorType pitype >
350 return LeafGridView( LeafGridViewImp( *
this ) );
366 friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
367 friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
373 friend class ALU2dGridFactory;
376 ALUSimplexGrid(
const ALUSimplexGrid & g ) ;
379 ALUSimplexGrid<dim,dimworld>&
380 operator = (
const ALUSimplexGrid& g);
411 template <
int dim,
int dimworld>
413 dune_static_assert((AlwaysFalse<integral_constant<int,dim> >::value),
414 "The unspecialized version of ALUConformGrid is defined "
415 "for documentation purposes only, only the "
416 "specializations can actually be used.");
419 namespace Capabilities {
431 template<
int dim,
int dimw,
int cdim >
434 static const bool v =
true;
440 template<
int dim,
int dimw>
442 static const bool v =
false;
448 template<
int dim,
int dimw>
451 static const bool v =
false;
457 template<
int dim,
int dimw>
460 static const bool v =
true;
466 template<
int dim,
int dimw>
469 static const bool v =
true;
490 enum { dimworld = dimw };
511 const bool verbose =
true)
512 :
BaseType(macroName, 0, bndProject, bndVector)
516 std::cout <<
"\nCreated serial ALUConformGrid<"<<dim<<
","<<dimworld;
517 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
533 std::istream& macroFile,
536 const bool verbose =
true )
537 :
BaseType(
"", 0, bndProject, bndVector, ¯oFile)
541 std::cout <<
"\nCreated serial ALUConformGrid<"<<dim<<
","<<dimworld;
542 if( macroName ==
"" )
543 std::cout <<
">. \n\n";
545 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
554 std::cout <<
"\nCreated empty ALUConformGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
558 static inline std::string
name () {
return "ALUConformGrid"; }
560 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
561 enum { refineStepsForHalf = 2 };
564 typedef typename GridFamily::Traits
Traits;
575 template< PartitionIteratorType pitype >
587 template< PartitionIteratorType pitype >
592 return LevelGridView( LevelGridViewImp( *
this, level ) );
595 template< PartitionIteratorType pitype >
600 return LeafGridView( LeafGridViewImp( *
this ) );
615 template< PartitionIteratorType pitype >
620 return LevelGridView( LevelGridViewImp( *
this, level ) );
623 template< PartitionIteratorType pitype >
628 return LeafGridView( LeafGridViewImp( *
this ) );
651 friend class ALU2dGridFactory;
680 template<
int dimw, ALUGr
idElementType elType, ALUGr
idRefinementType refinementType,
class Comm >
681 class ALUGrid< 2, dimw, elType, refinementType, Comm >
682 :
public ALUGridBaseGrid < 2, dimw, elType, Comm > :: BaseGrid
685 typedef typename ALUGridBaseGrid < 2, dimw, elType, Comm > :: BaseGrid BaseType;
688 enum { dimworld = dimw };
705 ALUGrid(
const std::string macroName,
708 const bool verbose =
true )
709 : BaseType(macroName, hangingNodes(), bndProject, bndVector)
713 std::cout <<
"\nCreated serial " << name() << nameSuffix()
714 <<
" from macro grid file '" << macroName <<
"'." << std::endl << std::endl;
727 ALUGrid(
const std::string macroName,
728 std::istream& macroFile,
731 const bool verbose =
true )
732 : BaseType(
"", hangingNodes(), bndProject, bndVector, ¯oFile)
736 std::cout <<
"\nCreated serial " << name() << nameSuffix();
737 if( macroName !=
"" )
738 std::cout <<
" from macro grid file '" << macroName;
739 std::cout <<
"." << std::endl << std::endl;
743 static std::string
name () {
return std::string(
"ALUGrid"); }
746 ALUGrid( ) : BaseType( hangingNodes() )
748 std::cout <<
"\nCreated serial " << name() << nameSuffix() <<
"." << std::endl << std::endl;
751 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
752 enum { refineStepsForHalf = 1 };
753 typedef typename BaseType::ctype
ctype;
755 typedef typename GridFamily::Traits
Traits;
766 template< PartitionIteratorType pitype >
778 template< PartitionIteratorType pitype >
783 return LevelGridView( LevelGridViewImp( *
this, level ) );
786 template< PartitionIteratorType pitype >
791 return LeafGridView( LeafGridViewImp( *
this ) );
806 template< PartitionIteratorType pitype >
811 return LevelGridView( LevelGridViewImp( *
this, level ) );
814 template< PartitionIteratorType pitype >
819 return LeafGridView( LeafGridViewImp( *
this ) );
835 static std::string nameSuffix()
837 std::string elt ( elType ==
cube ?
"cube," :
"simplex," );
838 std::string ref ( refinementType ==
nonconforming ?
"nonconforming>" :
"conforming>" );
839 std::stringstream suffix;
840 suffix <<
"<"<<dim<<
","<<dimworld<<
"," << elt << ref;
845 int hangingNodes()
const
857 friend class ALU2dGridFactory;
860 ALUGrid(
const ALUGrid & g ) ;
863 This& operator = (
const ALUGrid& g);
869 #error "Trying to use <dune/grid/alugrid.hh> without ALUGRID_CPPFLAGS."
870 #endif // #if HAVE_ALUGRID || DOXYGEN