1 #ifndef DUNE_ALU2D_ALUGRID_HH
2 #define DUNE_ALU2D_ALUGRID_HH
21 class ALUCubeGrid< 2, dimw >
28 enum { dimworld = dimw };
45 ALUCubeGrid(
const std::string macroName,
48 const bool verbose =
true )
49 :
BaseType(macroName,1, bndProject, bndVector)
53 std::cout <<
"\nCreated serial ALUCubeGrid<"<<dim<<
","<<dimworld;
54 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
67 ALUCubeGrid(
const std::string macroName,
68 std::istream& macroFile,
71 const bool verbose =
true )
72 :
BaseType(
"",1, bndProject, bndVector, ¯oFile)
76 std::cout <<
"\nCreated serial ALUCubeGrid<"<<dim<<
","<<dimworld;
78 std::cout <<
">. \n\n";
80 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
87 std::cout <<
"\nCreated empty ALUCubeGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
90 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
91 enum { refineStepsForHalf = 1 };
105 template< PartitionIteratorType pitype >
117 template< PartitionIteratorType pitype >
122 return LevelGridView( LevelGridViewImp( *
this, level ) );
125 template< PartitionIteratorType pitype >
130 return LeafGridView( LeafGridViewImp( *
this ) );
147 friend class Conversion< const ALUCubeGrid<dimension,dimensionworld> ,
HasObjectStream > ;
156 ALUCubeGrid(
const ALUCubeGrid & g ) ;
159 ALUCubeGrid<dim,dimworld>&
160 operator = (
const ALUCubeGrid& g);
169 class ALUSimplexGrid< 2, dimw >
176 enum { dimworld = dimw };
193 ALUSimplexGrid(
const std::string macroName,
196 const bool verbose =
true )
197 :
BaseType(macroName,1, bndProject, bndVector)
201 std::cout <<
"\nCreated serial ALUSimplexGrid<"<<dim<<
","<<dimworld;
202 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
215 ALUSimplexGrid(
const std::string macroName,
216 std::istream& macroFile,
219 const bool verbose =
true )
220 :
BaseType(
"",1, bndProject, bndVector, ¯oFile)
224 std::cout <<
"\nCreated serial ALUSimplexGrid<"<<dim<<
","<<dimworld;
225 if( macroName ==
"" )
226 std::cout <<
">. \n\n";
228 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
235 std::cout <<
"\nCreated empty ALUSimplexGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
238 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
239 enum { refineStepsForHalf = 1 };
253 template< PartitionIteratorType pitype >
265 template< PartitionIteratorType pitype >
270 return LevelGridView( LevelGridViewImp( *
this, level ) );
273 template< PartitionIteratorType pitype >
278 return LeafGridView( LeafGridViewImp( *
this ) );
294 friend class Conversion< ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
295 friend class Conversion< const ALUSimplexGrid<dimension,dimensionworld> ,
HasObjectStream > ;
304 ALUSimplexGrid(
const ALUSimplexGrid & g ) ;
307 ALUSimplexGrid<dim,dimworld>&
308 operator = (
const ALUSimplexGrid& g);
338 template <
int dim,
int dimworld>
340 dune_static_assert((AlwaysFalse<integral_constant<int,dim> >::value),
341 "The unspecialized version of ALUConformGrid is defined "
342 "for documentation purposes only, only the "
343 "specializations can actually be used.");
346 namespace Capabilities {
358 template<
int dim,
int dimw,
int cdim >
361 static const bool v =
true;
367 template<
int dim,
int dimw>
369 static const bool v =
false;
375 template<
int dim,
int dimw>
378 static const bool v =
false;
384 template<
int dim,
int dimw>
387 static const bool v =
true;
393 template<
int dim,
int dimw>
396 static const bool v =
true;
416 enum { dimworld = dimw };
435 const bool verbose =
true)
436 :
BaseType(macroName, 0, bndProject, bndVector)
440 std::cout <<
"\nCreated serial ALUConformGrid<"<<dim<<
","<<dimworld;
441 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
455 std::istream& macroFile,
458 const bool verbose =
true )
459 :
BaseType(
"", 0, bndProject, bndVector, ¯oFile)
463 std::cout <<
"\nCreated serial ALUConformGrid<"<<dim<<
","<<dimworld;
464 if( macroName ==
"" )
465 std::cout <<
">. \n\n";
467 std::cout <<
"> from macro grid file '" << macroName <<
"'. \n\n";
474 std::cout <<
"\nCreated empty ALUConformGrid<"<<dim<<
","<<dimworld <<
">. \n\n";
478 static inline std::string
name () {
return "ALUConformGrid"; }
480 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
481 enum { refineStepsForHalf = 2 };
484 typedef typename GridFamily::Traits
Traits;
495 template< PartitionIteratorType pitype >
507 template< PartitionIteratorType pitype >
512 return LevelGridView( LevelGridViewImp( *
this, level ) );
515 template< PartitionIteratorType pitype >
520 return LeafGridView( LeafGridViewImp( *
this ) );
572 template<
int dimw, ALUGr
idElementType elType, ALUGr
idRefinementType refinementType,
class Comm >
573 class ALUGrid< 2, dimw, elType, refinementType, Comm >
574 :
public ALUGridBaseGrid < 2, dimw, elType, Comm > :: BaseGrid
577 typedef typename ALUGridBaseGrid < 2, dimw, elType, Comm > :: BaseGrid BaseType;
580 enum { dimworld = dimw };
597 ALUGrid(
const std::string macroName,
600 const bool verbose =
true )
601 : BaseType(macroName, hangingNodes(), bndProject, bndVector)
605 std::cout <<
"\nCreated serial " << name() << nameSuffix()
606 <<
" from macro grid file '" << macroName <<
"'." << std::endl << std::endl;
619 ALUGrid(
const std::string macroName,
620 std::istream& macroFile,
623 const bool verbose =
true )
624 : BaseType(
"", hangingNodes(), bndProject, bndVector, ¯oFile)
628 std::cout <<
"\nCreated serial " << name() << nameSuffix();
629 if( macroName !=
"" )
630 std::cout <<
" from macro grid file '" << macroName;
631 std::cout <<
"." << std::endl << std::endl;
635 static std::string
name () {
return std::string(
"ALUGrid"); }
638 ALUGrid( ) : BaseType( hangingNodes() )
640 std::cout <<
"\nCreated serial " << name() << nameSuffix() <<
"." << std::endl << std::endl;
643 enum {dimension=BaseType::dimension,dimensionworld=BaseType::dimensionworld};
644 enum { refineStepsForHalf = 1 };
645 typedef typename BaseType::ctype
ctype;
647 typedef typename GridFamily::Traits
Traits;
658 template< PartitionIteratorType pitype >
670 template< PartitionIteratorType pitype >
675 return LevelGridView( LevelGridViewImp( *
this, level ) );
678 template< PartitionIteratorType pitype >
683 return LeafGridView( LeafGridViewImp( *
this ) );
699 static std::string nameSuffix()
701 std::string elt ( elType ==
cube ?
"cube," :
"simplex," );
702 std::string ref ( refinementType ==
nonconforming ?
"nonconforming>" :
"conforming>" );
703 std::stringstream suffix;
704 suffix <<
"<"<<dim<<
","<<dimworld<<
"," << elt << ref;
709 int hangingNodes()
const
724 ALUGrid(
const ALUGrid & g ) ;
727 This& operator = (
const ALUGrid& g);
733 #error "Trying to use <dune/grid/alugrid.hh> without ALUGRID_CPPFLAGS."
734 #endif // #ifdef ENABLE_ALUGRID