diff --git a/src/Makefile.am b/src/Makefile.am index a17cc669ba78c8dcb9f7ab9f5e3bf0c928d0f65f..474a701e397c998fdf16fe25a1a4dac8d940dd09 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,7 @@ lib_LTLIBRARIES = libalugrid.la nobase_include_HEADERS = alugrid_serial.h alugrid_parallel.h alugrid_2d.h stlheaders.h indexstack.h projectvertex.h $(serialhdrs) $(parallelhdrs) $(duneinterfacehdrs) $(alu2dhdrs) # add all package flags -AM_CPPFLAGS = $(ALUGRID_CPPFLAGS) +AM_CPPFLAGS = -Wfatal-errors $(ALUGRID_CPPFLAGS) libalugrid_la_CPPFLAGS = $(ALUGRID_CPPFLAGS) $(ALL_PKG_CPPFLAGS) libalugrid_la_LIBADD = $(PARMETIS_LDFLAGS) $(PARMETIS_LIBS) $(METIS_LDFLAGS) $(METIS_LIBS) $(MPI_LDFLAGS) $(MPI_LIBS) diff --git a/src/alugrid_serial.h b/src/alugrid_serial.h index f1f5960d8d731985441026fddc30363d821cc00a..5ac0cdff66bb48587f609922e34f9014a6f3c0a5 100644 --- a/src/alugrid_serial.h +++ b/src/alugrid_serial.h @@ -8,9 +8,6 @@ // use withc care //#define DONT_USE_ALUGRID_ALLOC -// if DUNE_NOT_USES_ALUGRID is defined, then index management is deactivated -//#define _DUNE_NOT_USES_ALU3DGRID_ - // include all headers #include "stlheaders.h" diff --git a/src/parallel/gitter_pll_impl.cc b/src/parallel/gitter_pll_impl.cc index 1af5876f52abca5d1d93ca8b8065647efedb49ab..498e3efb148c6cf186ec4356cb10061fc2ac11d8 100644 --- a/src/parallel/gitter_pll_impl.cc +++ b/src/parallel/gitter_pll_impl.cc @@ -650,7 +650,6 @@ readDynamicState (ObjectStream & os, int) try { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // read the real level of ghost assert(myhbnd().leafRefCount()==0 || myhbnd().leafRefCount()==1); const bool wasLeaf = this->ghostLeaf() ; @@ -675,7 +674,6 @@ readDynamicState (ObjectStream & os, int) assert( myhbnd().leafRefCount()==0 || myhbnd().leafRefCount()==1 ); assert( (!nowLeaf) ? (! myhbnd().isLeafEntity()) : 1); assert( ( nowLeaf) ? ( myhbnd().isLeafEntity()) : 1); -#endif } catch (ObjectStream :: EOFException) @@ -759,11 +757,9 @@ void TetraPllXBase :: writeDynamicState (ObjectStream & os, GatherScatterType & void TetraPllXBase :: writeDynamicState (ObjectStream & os, int face) const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // write level to know the level of ghost on the other side os.writeObject( mytetra().level() ); os.writeObject( mytetra().leaf() ); -#endif return ; } @@ -1419,11 +1415,9 @@ void HexaPllBaseX :: writeDynamicState (ObjectStream & os, int face) const { // siehe writeDynamicState von Tetra -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // write level to know the level of ghost on the other side os.writeObject( myhexa().level() ); os.writeObject( myhexa().leaf() ); -#endif return ; } diff --git a/src/serial/gitter_hexa_top.cc b/src/serial/gitter_hexa_top.cc index 94f95a04c04ef51c5922938cb96f293912dd8a81..4d0126996754ee368e2860c7d11416a650c2e94a 100644 --- a/src/serial/gitter_hexa_top.cc +++ b/src/serial/gitter_hexa_top.cc @@ -76,7 +76,7 @@ template < class A > bool Hedge1Top < A > :: coarse () { // Vorsicht: Im parallelen Gitter bleiben auch Kanten ohne // Refcount stehen, um konsistente "Uberg"ange zu erhalten. - for (inneredge_t * f = this->down () ; f ; f = f->next ()) { + for (inneredge_t * f = dwnPtr() ; f ; f = f->next ()) { if (f->leaf ()) { x &= ! f->ref ; } else { @@ -226,7 +226,7 @@ template < class A > bool Hface4Top < A > :: refine (myrule_t r, int twist) { if (a) { if (getrule () == myrule_t :: nosplit) { refineImmediate (r) ; - {for (innerface_t * f = down () ; f ; f = f->next ()) f->nb = this->nb ; } + {for (innerface_t * f = dwnPtr() ; f ; f = f->next ()) f->nb = this->nb ; } } else { assert (getrule () == myrule_t :: iso4) ; } @@ -877,7 +877,7 @@ template < class A > bool HexaTop < A > :: coarse () { assert (_req == myrule_t :: nosplit) ; bool x = true ; { - for (innerhexa_t * h = down () ; h ; h = h->next ()) x &= h->coarse () ; + for (innerhexa_t * h = dwnPtr() ; h ; h = h->next ()) x &= h->coarse () ; } if (x) { @@ -916,12 +916,10 @@ template < class A > void HexaTop < A > :: backupCMode (ostream & os) const { } template < class A > void HexaTop < A > :: backupIndex (ostream & os) const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ os.write(((const char *) & this->_idx ), sizeof(int)); for (const innerhexa_t* c = down(); c; c = c->next()) { c->backupIndex(os); } -#endif return; } @@ -940,14 +938,13 @@ void HexaTop < A > :: doBackup (OutStream_t& os) const os.put ((char) getrule ()) ; {for (const inneredge_t * e = innerHedge () ; e ; e = e->next ()) e->backup (os) ; } {for (const innerface_t * f = innerHface () ; f ; f = f->next ()) f->backup (os) ; } - {for (const innerhexa_t * c = down () ; c ; c = c->next ()) c->backup (os) ; } + {for (const innerhexa_t * c = dwnPtr() ; c ; c = c->next ()) c->backup (os) ; } return ; } template < class A > void HexaTop < A > :: restoreIndex (istream & is, vector<bool> (&isHole) [4]) { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // free index from constructor // indexManager is cleared from outside is.read ( ((char *) &(this->_idx) ), sizeof(int) ); @@ -960,8 +957,7 @@ restoreIndex (istream & is, vector<bool> (&isHole) [4]) // set entry to false, because this is not a hole isHole[BuilderIF :: IM_Elements][this->getIndex()] = false; - {for (innerhexa_t * c = down () ; c ; c = c->next ()) c->restoreIndex (is, isHole ) ; } -#endif + {for (innerhexa_t * c = dwnPtr() ; c ; c = c->next ()) c->restoreIndex (is, isHole ) ; } return; } @@ -1006,7 +1002,7 @@ void HexaTop < A > :: doRestore (InStream_t & is) assert (getrule() == r) ; {for (inneredge_t * e = innerHedge () ; e ; e = e->next ()) e->restore (is) ; } {for (innerface_t * f = innerHface () ; f ; f = f->next ()) f->restore (is) ; } - {for (innerhexa_t * c = down () ; c ; c = c->next ()) c->restore (is) ; } + {for (innerhexa_t * c = dwnPtr () ; c ; c = c->next ()) c->restore (is) ; } } return ; } diff --git a/src/serial/gitter_sti.h b/src/serial/gitter_sti.h index a4faf75c53999616ef34b27231d42277e41fbc7b..65632e12515cc8ebffd96c43774a80a18dd87d2e 100644 --- a/src/serial/gitter_sti.h +++ b/src/serial/gitter_sti.h @@ -263,8 +263,7 @@ public : { public: enum { interior = 0 , border = 111 , ghost = 222 }; - // das wird hier ja langsam zur eierlegenden Wollmilchsau -#ifndef _DUNE_NOT_USES_ALU3DGRID_ + protected: // internal index of item int _idx; @@ -292,24 +291,19 @@ public : _leafref(0) , _isCopy(false) {} -#endif + public: // backupIndexErr message void backupIndexErr () const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ cerr << "DuneIndexProvider :: backupIndex : Implemenation should be in inherited class " << __FILE__ << " " << __LINE__ << "\n"; abort(); -#endif } // restoreIndexErr message void restoreIndexErr () const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ cerr << "DuneIndexProvider :: restoreIndex : Implemenation should be in inherited class " << __FILE__ << __LINE__ << "\n"; abort(); -#endif } -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // return index of item inline int getIndex () const { @@ -409,30 +403,11 @@ public : { return (bndId() == border); } -#else - // empty methods when not using with Dune - inline int getIndex () const { return -1; } - void setIndex ( const int index ) {} - inline void freeIndex ( IndexManagerType & im ) {} - inline void setIndex ( IndexManagerType & im, const int index ) {} - inline void addleaf() {} - inline void removeleaf() {} - inline bool isLeafEntity() const {return false;} - inline int leafRefCount() const { return 0; } - inline int bndId() const { return 0; } - inline void setBndId (const int id) {} - inline void setGhostBndId (const int id) {} - bool isGhost () const { return false; } - bool isBorder () const { return false; } - bool isInterior () const { return true; } -#endif }; public : class vertex : public stiExtender_t :: VertexIF -#ifndef _DUNE_NOT_USES_ALU3DGRID_ , public DuneIndexProvider -#endif { protected : vertex () {} @@ -529,16 +504,14 @@ public : // class with all extensions for helement class Dune_helement : public DuneIndexProvider { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ protected: // abuse ref to refined tag using DuneIndexProvider :: ref ; Dune_helement () { - // mark as new element + // mark as new element by increasing reference counter ++ ref ; } -#endif public: // reset the _refinedTag to false void resetRefinedTag(); @@ -1742,9 +1715,7 @@ public : virtual void backupCMode (const char*,const char *) const ; friend class MacroGridBuilder ; friend class MacroGhostBuilder; -#ifndef _DUNE_NOT_USES_ALU3DGRID_ friend class DuneParallelGridMover; -#endif } ; } ; private : @@ -2220,17 +2191,11 @@ inline int Gitter :: helement :: leaf () const { // Dune extensions inline void Gitter :: Dune_helement :: resetRefinedTag () { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ ref.reset (); -#endif } inline bool Gitter :: Dune_helement :: hasBeenRefined () const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ return ref.positive(); -#else - return false; -#endif } inline int Gitter :: hbndseg :: leaf () const { @@ -2306,14 +2271,11 @@ inline void Gitter :: Geometric :: VertexGeo :: project(const ProjectVertexPair } inline void Gitter :: Geometric :: VertexGeo :: backupIndex ( ostream & os ) const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ os.write( ((const char *) &_idx ), sizeof(int) ) ; -#endif } inline void Gitter :: Geometric :: VertexGeo :: restoreIndex ( istream & is, vector<bool>(&isHole)[4] ) { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ is.read ( ((char *) &_idx), sizeof(int) ); // mark vertex entry as not a hole @@ -2321,7 +2283,6 @@ inline void Gitter :: Geometric :: VertexGeo :: restoreIndex ( istream & is, vec // make sure sizes match assert( _idx < (int) isHole[BuilderIF :: IM_Vertices].size() ); isHole[BuilderIF :: IM_Vertices][_idx] = false; -#endif } // # # # ###### diff --git a/src/serial/gitter_tetra_top.cc b/src/serial/gitter_tetra_top.cc index 69a5cb3bcac3081f567c0185bcd24ed0d5d6409d..fc2aac80c132515ddd0231fd015a889846058444 100644 --- a/src/serial/gitter_tetra_top.cc +++ b/src/serial/gitter_tetra_top.cc @@ -123,7 +123,7 @@ template < class A > void Hface3Top < A > :: refineImmediate (myrule_t r) // set parent rule { myrule_t myRule = getrule(); - for (innerface_t * f = down () ; f ; f = f->next ()) + for (innerface_t * f = dwnPtr() ; f ; f = f->next ()) { f->nb._parRule = myRule; } @@ -153,7 +153,7 @@ template < class A > bool Hface3Top < A > :: refine (myrule_t r, int twist) if (getrule () == myrule_t :: nosplit) { refineImmediate (r) ; { - for (innerface_t * f = down () ; f ; f = f->next ()) f->nb = this->nb ; + for (innerface_t * f = dwnPtr() ; f ; f = f->next ()) f->nb = this->nb ; } } else @@ -182,7 +182,7 @@ template < class A > bool Hface3Top < A > :: refine (myrule_t r, int twist) template < class A > bool Hface3Top < A > :: coarse () { - innerface_t * f = down () ; + innerface_t * f = dwnPtr() ; if (!f) return false ; bool x = true ; do { @@ -231,7 +231,7 @@ void Hface3Top < A > :: doBackup (OutStream_t & os) const { os.put ((char) getrule ()) ; {for (const inneredge_t * e = innerHedge () ; e ; e = e->next ()) e->backup (os) ; } - {for (const innerface_t * c = down () ; c ; c = c->next ()) c->backup (os) ; } + {for (const innerface_t * c = dwnPtr() ; c ; c = c->next ()) c->backup (os) ; } return ; } @@ -250,7 +250,7 @@ void Hface3Top < A > :: doRestore (InStream_t & is) { refineImmediate (myrule_t ((char) is.get ())) ; {for (inneredge_t * e = innerHedge () ; e ; e = e->next ()) e->restore (is) ; } - {for (innerface_t * c = down () ; c ; c = c->next ()) c->restore (is) ; } + {for (innerface_t * c = dwnPtr() ; c ; c = c->next ()) c->restore (is) ; } return ; } @@ -1034,7 +1034,7 @@ template < class A > bool TetraTop < A > :: coarse () assert (_req == myrule_t :: nosplit) ; bool x = true ; { - for (innertetra_t * h = down () ; h ; h = h->next ()) x &= h->coarse () ; + for (innertetra_t * h = dwnPtr() ; h ; h = h->next ()) x &= h->coarse () ; } // if x is true, then all children are marked for coarsening and have @@ -1075,7 +1075,6 @@ template < class A > void TetraTop < A > :: backupCMode (ostream & os) const { // buckupTetra template < class A > void TetraTop < A > :: backupIndex (ostream & os) const { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // write my index os.write( ((const char *) & this->_idx ), sizeof(int) ) ; @@ -1099,9 +1098,8 @@ template < class A > void TetraTop < A > :: backupIndex (ostream & os) const // write children { - for (const innertetra_t * c = down () ; c ; c = c->next ()) c->backupIndex (os) ; + for (const innertetra_t * c = dwnPtr() ; c ; c = c->next ()) c->backupIndex (os) ; } -#endif return; } @@ -1121,7 +1119,7 @@ void TetraTop < A > :: doBackup (OutStream_t & os) const os.put ((char) getrule ()) ; {for (const inneredge_t * e = innerHedge () ; e ; e = e->next ()) e->backup (os) ; } {for (const innerface_t * f = innerHface () ; f ; f = f->next ()) f->backup (os) ; } - {for (const innertetra_t * c = down () ; c ; c = c->next ()) c->backup (os) ; } + {for (const innertetra_t * c = dwnPtr() ; c ; c = c->next ()) c->backup (os) ; } return ; } @@ -1130,7 +1128,6 @@ void TetraTop < A > :: doBackup (OutStream_t & os) const template < class A > void TetraTop < A > :: restoreIndex (istream & is, vector<bool> (& isHole) [4] ) { -#ifndef _DUNE_NOT_USES_ALU3DGRID_ // free index from constructor is.read ( ((char *) &(this->_idx) ), sizeof(int) ); @@ -1164,9 +1161,8 @@ restoreIndex (istream & is, vector<bool> (& isHole) [4] ) */ { - for (innertetra_t * c = down () ; c ; c = c->next ()) c->restoreIndex (is, isHole ) ; + for (innertetra_t * c = dwnPtr() ; c ; c = c->next ()) c->restoreIndex (is, isHole ) ; } -#endif return; } @@ -1242,7 +1238,7 @@ void TetraTop < A > :: doRestore (InStream_t & is) // call restore on children { - for (innertetra_t * c = down () ; c ; c = c->next ()) c->restore (is) ; + for (innertetra_t * c = dwnPtr() ; c ; c = c->next ()) c->restore (is) ; } }