diff --git a/grid/albertagrid.hh b/grid/albertagrid.hh index 8e91fdd2a138940496e0924ee9ec3c6af1eb433e..d74419e506c63fa963ec1c47990ee8cda8ded9c7 100644 --- a/grid/albertagrid.hh +++ b/grid/albertagrid.hh @@ -1274,9 +1274,9 @@ namespace Dune typedef typename Traits::template Codim<0>::LeafIterator LeafIterator; - typedef AlbertaGridHierarchicIndexSet<dim,dimworld> HierarchicIndexSetType; - typedef DefaultLevelIndexSet< AlbertaGrid<dim,dimworld> > LevelIndexSetType; - typedef AdaptiveLeafIndexSet< AlbertaGrid<dim,dimworld> > LeafIndexSetType; + typedef AlbertaGridHierarchicIndexSet<dim,dimworld> HierarchicIndexSet; + typedef DefaultLevelIndexSet< AlbertaGrid<dim,dimworld> > LevelIndexSet; + typedef AdaptiveLeafIndexSet< AlbertaGrid<dim,dimworld> > LeafIndexSet; typedef AlbertaGridGlobalIdSet<dim,dimworld> GlobalIdSetType; typedef AlbertaGridGlobalIdSet<dim,dimworld> LocalIdSetType; @@ -1454,16 +1454,16 @@ namespace Dune //! transform grid N = scalar * x + trans void setNewCoords(const FieldVector<albertCtype, dimworld> & trans, const albertCtype scalar); - const HierarchicIndexSetType & hierarchicIndexSet () const { return hIndexSet_; } + const HierarchicIndexSet & hierarchicIndexSet () const { return hIndexSet_; } - const LevelIndexSetType & levelIndexSet (int level = 0) const + const LevelIndexSet & levelIndexSet (int level= 0) const { - if(!levelIndexVec_[level]) levelIndexVec_[level] = new LevelIndexSetType (*this,level); + if(!levelIndexVec_[level]) levelIndexVec_[level] = new LevelIndexSet (*this,level); return *(levelIndexVec_[level]); } - const LeafIndexSetType & leafIndexSet () const { - if(!leafIndexSet_) leafIndexSet_ = new LeafIndexSetType (*this); + const LeafIndexSet & leafIndexSet () const { + if(!leafIndexSet_) leafIndexSet_ = new LeafIndexSet (*this); return *leafIndexSet_; } @@ -1698,11 +1698,11 @@ namespace Dune // the level index set, is generated from the HierarchicIndexSet // is generated, when accessed - mutable std::vector < LevelIndexSetType * > levelIndexVec_; + mutable std::vector < LevelIndexSet * > levelIndexVec_; // the leaf index set, is generated from the HierarchicIndexSet // is generated, when accessed - mutable LeafIndexSetType * leafIndexSet_; + mutable LeafIndexSet* leafIndexSet_; const std::vector < GeometryType > geomTypes_; diff --git a/grid/alu3dgrid/datahandle.hh b/grid/alu3dgrid/datahandle.hh index 8e3ad2b10a7afa0c7460eaa5745a88ab43fce1d9..a77bc0b860a88dbd20c108ace82911ff4db12ce0 100644 --- a/grid/alu3dgrid/datahandle.hh +++ b/grid/alu3dgrid/datahandle.hh @@ -137,7 +137,7 @@ namespace ALUGridSpace { { GridType & grid_; typedef typename GridType::template Codim<0>::Entity Entity; - typedef typename GridType::LeafIndexSetType LeafIndexSetType; + typedef typename GridType::LeafIndexSet LeafIndexSetType; Entity & reFather_; Entity & reSon_; diff --git a/grid/alu3dgrid/geometry.hh b/grid/alu3dgrid/geometry.hh index 95640dc15f7729318af97785fe3dc39da688df34..9dc3ea343178ac39294bf3e6e6deaf28ec527e0e 100644 --- a/grid/alu3dgrid/geometry.hh +++ b/grid/alu3dgrid/geometry.hh @@ -46,7 +46,7 @@ namespace Dune { class ALU3dGridMakeableGeometry : public Geometry<mydim, coorddim, GridImp, ALU3dGridGeometry> { - typedef Geometry<mydim, coorddim, GridImp, ALU3dGridGeometry> GeometryType; + typedef Geometry<mydim, coorddim, GridImp, ALU3dGridGeometry> InterfaceGeometryType; typedef typename ALU3dImplTraits<GridImp::elementType>::PLLBndFaceType PLLBndFaceType; friend class ALU3dGridIntersectionIterator<GridImp>; @@ -57,10 +57,10 @@ namespace Dune { 3> FaceCoordinatesType; ALU3dGridMakeableGeometry() : - GeometryType (ALU3dGridGeometry<mydim, coorddim,GridImp>()) {} + InterfaceGeometryType (ALU3dGridGeometry<mydim, coorddim,GridImp>()) {} ALU3dGridMakeableGeometry(GridImp & grid , int level ) : - GeometryType (ALU3dGridGeometry<mydim, coorddim,GridImp>()) {} + InterfaceGeometryType (ALU3dGridGeometry<mydim, coorddim,GridImp>()) {} //! build geometry out of different ALU3dGrid Geometrys //! ItemType are HElementType, HFaceType, HEdgeType and VertexType diff --git a/grid/alu3dgrid/geometry_imp.cc b/grid/alu3dgrid/geometry_imp.cc index a3b0a5c6f4487d7c155d46736e6e23321e3692e8..8530c7cb293b2b3755c4af63de1023e9f45db7f4 100644 --- a/grid/alu3dgrid/geometry_imp.cc +++ b/grid/alu3dgrid/geometry_imp.cc @@ -241,6 +241,7 @@ namespace Dune { return true; } + template <GeometryType eltype , int dim> struct ALU3dGridElType { static inline GeometryType type () { return unknown; } }; @@ -263,12 +264,40 @@ namespace Dune { static inline GeometryType type () { return quadrilateral; } }; + + /* Comment in for adaptation to new GeometryType + template <int mydim, int cdim> + inline GeometryType + ALU3dGridGeometry<mydim,cdim,const ALU3dGrid<3, 3, tetra> > ::type () const { + return simplex; + } + + template <int mydim, int cdim> + inline GeometryType + ALU3dGridGeometry<mydim,cdim,const ALU3dGrid<3, 3, hexa> > ::type () const { + return cube; + } + + template <> + inline GeometryType + ALU3dGridGeometry<0, 3, const ALU3dGrid<3, 3, tetra> > ::type () const { + return vertex; + } + + template <> + inline GeometryType + ALU3dGridGeometry<0, 3, const ALU3dGrid<3, 3, hexa> > ::type () const { + return vertex; + } + */ + template<int mydim, int cdim> inline GeometryType ALU3dGridGeometry<mydim,cdim,const ALU3dGrid<3, 3, tetra> > ::type () const { return ALU3dGridElType<tetrahedron,mydim>::type(); } + template<int mydim, int cdim> inline int ALU3dGridGeometry<mydim,cdim,const ALU3dGrid<3, 3, tetra> > ::corners () const { @@ -430,12 +459,14 @@ namespace Dune { delete biMap_; } + template<int mydim, int cdim> inline GeometryType ALU3dGridGeometry<mydim, cdim, const ALU3dGrid<3, 3, hexa> >::type() const { return ALU3dGridElType<hexahedron, mydim>::type(); } + template <int mydim, int cdim> inline int ALU3dGridGeometry<mydim, cdim, const ALU3dGrid<3, 3, hexa> >::corners() const { diff --git a/grid/alu3dgrid/grid.hh b/grid/alu3dgrid/grid.hh index 404c4956892230837136d5c6e05a5f51874a8ce8..040ca258515fb2ce407bb648f600b73cc949525a 100644 --- a/grid/alu3dgrid/grid.hh +++ b/grid/alu3dgrid/grid.hh @@ -124,18 +124,18 @@ namespace Dune { typedef ALU3DSPACE ObjectStream ObjectStreamType; //! Type of the hierarchic index set - typedef ALU3dGridHierarchicIndexSet<dim,dimworld,elType> HierarchicIndexSetType; + typedef ALU3dGridHierarchicIndexSet<dim,dimworld,elType> HierarchicIndexSet; //! Type of the global id set - typedef ALU3dGridGlobalIdSet<dim,dimworld,elType> GlobalIdSetType; + typedef ALU3dGridGlobalIdSet<dim,dimworld,elType> GlobalIdSet; //! Type of the local id set - typedef ALU3dGridLocalIdSet<dim,dimworld,elType> LocalIdSetType; + typedef ALU3dGridLocalIdSet<dim,dimworld,elType> LocalIdSet; //! Type of the level index set - typedef DefaultLevelIndexSet<MyType> LevelIndexSetType; + typedef DefaultLevelIndexSet<MyType> LevelIndexSet; //! Type of the leaf index set - typedef AdaptiveLeafIndexSet<MyType> LeafIndexSetType; + typedef AdaptiveLeafIndexSet<MyType> LeafIndexSet; //! maximal number of levels enum { MAXL = 64 }; diff --git a/grid/alu3dgrid/grid_imp.cc b/grid/alu3dgrid/grid_imp.cc index 79ee0a6d8129022a1c72290b8fae0a5c8e8e981c..5871f5641cbd3dce305f7646c21508227f51caf2 100644 --- a/grid/alu3dgrid/grid_imp.cc +++ b/grid/alu3dgrid/grid_imp.cc @@ -179,31 +179,31 @@ namespace Dune { } template <int dim, int dimworld, ALU3dGridElementType elType> - inline const typename ALU3dGrid<dim, dimworld, elType>::LeafIndexSetType & + inline const typename ALU3dGrid<dim, dimworld, elType>::LeafIndexSet & ALU3dGrid<dim, dimworld, elType>::leafIndexSet() const { - if(!leafIndexSet_) leafIndexSet_ = new LeafIndexSetType ( *this ); + if(!leafIndexSet_) leafIndexSet_ = new LeafIndexSet ( *this ); return *leafIndexSet_; } template <int dim, int dimworld, ALU3dGridElementType elType> - inline typename ALU3dGrid<dim, dimworld, elType>::LeafIndexSetType & + inline typename ALU3dGrid<dim, dimworld, elType>::LeafIndexSet & ALU3dGrid<dim, dimworld, elType>::leafIndexSet() { - if(!leafIndexSet_) leafIndexSet_ = new LeafIndexSetType ( *this ); + if(!leafIndexSet_) leafIndexSet_ = new LeafIndexSet ( *this ); return *leafIndexSet_; } template <int dim, int dimworld, ALU3dGridElementType elType> - inline const typename ALU3dGrid<dim, dimworld, elType>::LevelIndexSetType & + inline const typename ALU3dGrid<dim, dimworld, elType>::LevelIndexSet & ALU3dGrid<dim, dimworld, elType>::levelIndexSet( int level ) const { if( (level < 0) && (level >= MAXL) ) DUNE_THROW(GridError,"Only " << MAXL << "levels allowed for this grid!\n"); if( levelIndexVec_[level] == 0 ) - levelIndexVec_[level] = new LevelIndexSetType ( *this , level ); + levelIndexVec_[level] = new LevelIndexSet ( *this , level ); return *(levelIndexVec_[level]); } @@ -424,7 +424,7 @@ namespace Dune { EntityImp s ( *this, this->maxlevel() ); ALU3DSPACE AdaptRestrictProlongImpl<ALU3dGrid<dim, dimworld, elType>, - EntityImp, LeafIndexSetType, LeafIndexSetType > + EntityImp, LeafIndexSet, LeafIndexSet > rp(*this,f,s, *leafIndexSet_ ,*leafIndexSet_); ref = myGrid().duneAdapt(rp); // adapt grid diff --git a/grid/alu3dgrid/indexsets.hh b/grid/alu3dgrid/indexsets.hh index af6dabd2a9909a0e05114dacc0fe412c7ec9ddea..73a007c771845520c2abecc8bd95c3949806825d 100644 --- a/grid/alu3dgrid/indexsets.hh +++ b/grid/alu3dgrid/indexsets.hh @@ -75,7 +75,7 @@ namespace Dune { class ALU3dGridGlobalIdSet { typedef ALU3dGrid<dim,dimworld,elType> GridType; - typedef typename GridType :: HierarchicIndexSetType HierarchicIndexSetType; + typedef typename GridType :: HierarchicIndexSet HierarchicIndexSetType; // this means that only up to 300000000 entities are allowed enum { codimMultiplier = 300000000 }; @@ -125,7 +125,7 @@ namespace Dune { class ALU3dGridLocalIdSet { typedef ALU3dGrid<dim,dimworld,elType> GridType; - typedef typename GridType :: HierarchicIndexSetType HierarchicIndexSetType; + typedef typename GridType :: HierarchicIndexSet HierarchicIndexSetType; // this means that only up to 300000000 entities are allowed enum { codimMultiplier = 300000000 }; diff --git a/grid/common/defaultindexsets.hh b/grid/common/defaultindexsets.hh index 9424298cef2d6030b8e9227bd52fc10f46d03dbb..59503f0b904e431a72c4290a264bed48461bb6d2 100644 --- a/grid/common/defaultindexsets.hh +++ b/grid/common/defaultindexsets.hh @@ -351,7 +351,7 @@ namespace Dune { enum { dim = GridType :: dimension }; enum { numCodim = dim + 1 }; - typedef typename GridType :: HierarchicIndexSetType HierarchicIndexSetType; + typedef typename GridType :: HierarchicIndexSet HierarchicIndexSetType; typedef DefaultLevelIndexSet<GridType> MyType; diff --git a/grid/common/grid.hh b/grid/common/grid.hh index 4225f5b3631d133dccdcf6a5100059e6dcd7bfe8..7913c07f59abc829eda42663746e9523b6296955 100644 --- a/grid/common/grid.hh +++ b/grid/common/grid.hh @@ -110,7 +110,7 @@ namespace Dune { case GhostEntity : return "ghost"; default : - DUNE_THROW(NotImplemented, "name of unknown partition type requested"); + return "unknown"; } } @@ -118,29 +118,16 @@ namespace Dune { switch(type) { case vertex : return "vertex"; - case line : - return "line"; - case triangle : - return "triangle"; - case quadrilateral : - return "quadrilateral"; - case tetrahedron : - return "tetrahedron"; case pyramid : return "pyramid"; case prism : return "prism"; - case hexahedron : - return "hexahedron"; case simplex : return "simplex"; case cube : return "cube"; - case unknown : - return "unknown"; - default : - DUNE_THROW(NotImplemented, "name of unknown geometry requested"); + return "unknown"; } } diff --git a/grid/common/leafindexset.hh b/grid/common/leafindexset.hh index d4d0caf9441edc85464ef2301706acacd6f7b0c2..9fbca47878b654eb775a1444c5c28e0284dbf5e0 100644 --- a/grid/common/leafindexset.hh +++ b/grid/common/leafindexset.hh @@ -163,11 +163,12 @@ namespace Dune { const int factor_; - typedef typename GridType :: HierarchicIndexSetType HIndexSetType; + typedef typename GridType :: HierarchicIndexSet HIndexSetType; const HIndexSetType & hIndexSet_; public: enum { ncodim = GridType::dimension + 1 }; + //! Constructor AdaptiveLeafIndexSet (const GridType & grid) : DefaultGridIndexSetBase <GridType> (grid) , nextFreeIndex_ (0), actSize_(0), marked_(false), markAllU_ (false) , factor_(2) , hIndexSet_( grid.hierarchicIndexSet() ) @@ -180,10 +181,12 @@ namespace Dune { markAllU_ = false; } - int type () const { return myType; } + //! Destructor virtual ~AdaptiveLeafIndexSet () {}; + int type () const { return myType; } + template <class EntityType> void restrictLocal ( EntityType &father, EntityType &son, bool initialize ) { @@ -198,8 +201,7 @@ namespace Dune { removeOldIndex( father ); } - void insertNewIndex (const typename GridType::template Codim<0>::Entity & en ) - { + void insertNewIndex (const typename GridType::template Codim<0>::Entity & en ) { // here we have to add the support of higher codims resizeVectors(); @@ -210,6 +212,7 @@ namespace Dune { marked_ = false; } + //! Unregister entity which will be removed from the grid void removeOldIndex (const typename GridType::template Codim<0>::Entity & en ) { //std::cout << "remove old Entity = " << en.globalIndex() << "\n"; @@ -217,6 +220,7 @@ namespace Dune { state_[ hIndexSet_.index(en) ] = UNUSED; } + //! \TODO Please doc me // reallocate the vector for new size void resizeVectors() { @@ -628,7 +632,7 @@ namespace Dune { template <class GridType> class DefaultLeafIndexSet : public DefaultGridIndexSetBase <GridType> { - typedef typename GridType :: LeafIndexSetType LeafIndexSetType; + typedef typename GridType :: LeafIndexSet LeafIndexSetType; LeafIndexSetType & leafIndexSet_; public: diff --git a/grid/common/refinement/Makefile.am b/grid/common/refinement/Makefile.am index e6d9e38538ea2ff00f4333514364026be07c242e..5ddf4858d4b8bb3c9c76973427d5605133ce16ae 100644 --- a/grid/common/refinement/Makefile.am +++ b/grid/common/refinement/Makefile.am @@ -3,12 +3,13 @@ refinementdir = $(includedir)/dune/grid/common/refinement refinement_HEADERS = base.cc hcube.cc simplex.cc hcubetriangulation.cc -EXTRA_DIST = referencetokuhn0.svg referencetokuhn0.png \ - simplexvertexindex.svg simplexvertexindex.png +#EXTRA_DIST = referencetokuhn0.svg referencetokuhn0.png \ +# simplexvertexindex.svg simplexvertexindex.png # Update png's if possible -noinst_DATA = referencetokuhn0.png simplexvertexindex.png +#noinst_DATA = referencetokuhn0.png simplexvertexindex.png -include $(top_srcdir)/am/inkscape.am + +#include $(top_srcdir)/am/inkscape.am include $(top_srcdir)/am/global-rules diff --git a/grid/onedgrid/onedgridboundent.hh b/grid/onedgrid/onedgridboundent.hh index ae8f9ef2d4838ba222cc5b274c8caf32b44ddc8f..abe51559f72bc4e8b0e2bfa703d189140e145902 100644 --- a/grid/onedgrid/onedgridboundent.hh +++ b/grid/onedgrid/onedgridboundent.hh @@ -18,7 +18,7 @@ namespace Dune { { //friend class OneDGridIntersectionIterator<dim,dimworld>; public: - typedef typename GridImp::template codim<0>::Geometry Geometry; + typedef typename GridImp::template Codim<0>::Geometry Geometry; OneDGridBoundaryEntity () : _neigh(-1), geom_() {} diff --git a/grid/sgrid/sgrid.cc b/grid/sgrid/sgrid.cc index 7829e50b619cdeae7f877db8445ce7fefb95320e..43052793956050a18791608da3bd667fe6df12e7 100644 --- a/grid/sgrid/sgrid.cc +++ b/grid/sgrid/sgrid.cc @@ -754,7 +754,7 @@ namespace Dune { int c = count%2; // compute expanded coordinates of entity - FixedArray<int,dim> z1 = self.e->z; + FixedArray<int,dim> z1; // = self.e.z; if (c==1) z1[dir] += 1; // odd else @@ -804,9 +804,9 @@ namespace Dune { { // each i!=dir gives one direction vector z1[i] += 1; // direction i => even - p2 = ne.grid->pos(self->level(),z1); + p2 = ne.grid->pos(self.level(),z1); z1[i] -= 2; // direction i => even - p1 = ne.grid->pos(self->level(),z1); + p1 = ne.grid->pos(self.level(),z1); z1[i] += 1; // revert t to original state __As[t] = p2-p1; ++t; @@ -814,7 +814,7 @@ namespace Dune { for (int i=0; i<dim; i++) if (i!=dir) z1[i] -= 1; - __As[t] = ne.grid->pos(self->level(),z1); + __As[t] = ne.grid->pos(self.level(),z1); is_global.make(__As); // build geometry built_intersections = true;