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/indexsets.hh>
12#include <dune/grid/alugrid/3d/iterator.hh>
13#include <dune/grid/alugrid/3d/entity.hh>
14#include <dune/grid/alugrid/3d/geometry.hh>
15#include <dune/grid/alugrid/3d/grid.hh>
25 static inline const char* ALUGridParallelSerial()
53 template< ALUGr
idElementType elType, ALUGr
idRefinementType refineType,
class Comm >
54 class ALUGrid< 3, 3, elType, refineType, Comm >
55 :
public ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid
57 typedef ALUGrid< 3, 3, elType, refineType, Comm > This;
58 typedef typename ALUGridBaseGrid< 3, 3, elType, Comm > :: BaseGrid BaseType;
61 enum { dimworld = 3 };
63 typedef typename BaseType::MPICommunicatorType MPICommunicatorType;
67 typedef typename BaseType :: DuneBoundaryProjectionType DuneBoundaryProjectionType;
70 typedef typename BaseType :: DuneBoundaryProjectionVector DuneBoundaryProjectionVector;
82 ALUGrid(
const std::string macroName,
83 const MPICommunicatorType mpiComm = BaseType::defaultCommunicator(),
84 const DuneBoundaryProjectionType* bndProject = 0,
85 const DuneBoundaryProjectionVector* bndVector = 0,
86 const bool verb =
true ) :
87 BaseType(macroName, mpiComm, bndProject, bndVector, refineType )
89 const bool verbose = verb && this->comm().rank() == 0;
92 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" " << name() << nameSuffix()
93 <<
" from macro grid file '" << macroName <<
"'. \n\n";
97 static std::string name () {
return std::string(
"ALUGrid"); }
99 static std::string nameSuffix()
101 std::string elt ( elType == cube ?
"cube," :
"simplex," );
102 std::string ref ( refineType == nonconforming ?
"nonconforming>" :
"conforming>" );
103 std::stringstream suffix;
104 suffix <<
"<"<<dim<<
","<<dimworld<<
"," << elt << ref;
118 ALUGrid(
const MPICommunicatorType mpiComm,
119 const DuneBoundaryProjectionType* bndProject ,
120 const DuneBoundaryProjectionVector* bndVector,
121 const std::string macroName,
122 const bool verb =
true ) :
123 BaseType(
"", mpiComm, bndProject, bndVector, refineType )
125 const bool verbose = verb && this->comm().rank() == 0;
128 std::cout <<
"\nCreated " << ALUGridParallelSerial() <<
" " << name() << nameSuffix()
129 <<
" from macro grid file '" << macroName <<
"'. \n\n";
134 ALUGrid(
const MPICommunicatorType mpiComm = BaseType::defaultCommunicator()) :
135 BaseType(
"", mpiComm,
136 (const DuneBoundaryProjectionType *) 0,
137 (const DuneBoundaryProjectionVector* ) 0,
140 if(this->comm().rank() == 0)
142 std::cout <<
"\nCreated empty " << ALUGridParallelSerial() <<
" " << name() << nameSuffix() <<
"." << std::endl << std::endl;
146 enum { dimension=BaseType::dimension, dimensionworld=BaseType::dimensionworld};
147 typedef typename BaseType::ctype ctype;
148 typedef typename BaseType::GridFamily GridFamily;
149 typedef typename GridFamily::Traits Traits;
150 typedef typename BaseType::LocalIdSetImp LocalIdSetImp;
151 typedef typename Traits :: GlobalIdSet GlobalIdSet;
152 typedef typename Traits :: LocalIdSet LocalIdSet;
153 typedef typename GridFamily :: LevelIndexSetImp LevelIndexSetImp;
154 typedef typename GridFamily :: LeafIndexSetImp LeafIndexSetImp;
155 typedef typename BaseType::LeafIteratorImp LeafIteratorImp;
156 typedef typename Traits:: template Codim<0>::LeafIterator LeafIteratorType;
157 typedef typename Traits:: template Codim<0>::LeafIterator LeafIterator;
160 typedef typename BaseType::HierarchicIteratorImp HierarchicIteratorImp;
161 typedef typename BaseType::ObjectStreamType ObjectStreamType;
163 template< PartitionIteratorType pitype >
172 typedef typename Partition< All_Partition > :: LevelGridView LevelGridView;
173 typedef typename Partition< All_Partition > :: LeafGridView LeafGridView;
175 template< PartitionIteratorType pitype >
176 typename Partition< pitype >::LevelGridView levelView (
int level )
const
178 typedef typename Partition< pitype >::LevelGridView LevelGridView;
179 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
180 return LevelGridView( LevelGridViewImp( *
this, level ) );
183 template< PartitionIteratorType pitype >
184 typename Partition< pitype >::LeafGridView leafView ()
const
186 typedef typename Partition< pitype >::LeafGridView LeafGridView;
187 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
188 return LeafGridView( LeafGridViewImp( *
this ) );
191 LevelGridView levelView (
int level )
const
193 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
194 return LevelGridView( LevelGridViewImp( *
this, level ) );
197 LeafGridView leafView ()
const
199 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
200 return LeafGridView( LeafGridViewImp( *
this ) );
203 template< PartitionIteratorType pitype >
204 typename Partition< pitype >::LevelGridView levelGridView (
int level )
const
206 typedef typename Partition< pitype >::LevelGridView LevelGridView;
207 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
208 return LevelGridView( LevelGridViewImp( *
this, level ) );
211 template< PartitionIteratorType pitype >
212 typename Partition< pitype >::LeafGridView leafGridView ()
const
214 typedef typename Partition< pitype >::LeafGridView LeafGridView;
215 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
216 return LeafGridView( LeafGridViewImp( *
this ) );
219 LevelGridView levelGridView (
int level )
const
221 typedef typename LevelGridView::GridViewImp LevelGridViewImp;
222 return LevelGridView( LevelGridViewImp( *
this, level ) );
225 LeafGridView leafGridView ()
const
227 typedef typename LeafGridView::GridViewImp LeafGridViewImp;
228 return LeafGridView( LeafGridViewImp( *
this ) );
232 friend class Conversion< This , HasObjectStream > ;
233 friend class Conversion< const This, HasObjectStream > ;
235 friend class Conversion< This, HasHierarchicIndexSet > ;
236 friend class Conversion< const This, HasHierarchicIndexSet > ;
238 template<
class >
friend class ALU3dGridFactory;
241 ALUGrid(
const ALUGrid & g );
244 This& operator = (
const ALUGrid& g);
Grid view abstract base class.
Definition: gridview.hh:59
Dune namespace.
Definition: alignment.hh:10