From 9e8456ed7a077f2bac98784b53f6683ef83f3204 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Kl=C3=B6fkorn?=
 <robertk@mathematik.uni-stuttgart.de>
Date: Tue, 20 Jul 2010 11:00:40 +0000
Subject: [PATCH] almost compiles.

git-svn-id: https://dune.mathematik.uni-freiburg.de/svn/alugrid/trunk@1314 0d966ed9-3843-0410-af09-ebfb50bd7c74
---
 src/parallel/gitter_pll_impl.cc | 284 +++++++++++++++-----------------
 src/parallel/gitter_pll_impl.h  | 253 ++++++++++------------------
 src/serial/elementif.h          | 136 ++++++++++-----
 3 files changed, 322 insertions(+), 351 deletions(-)

diff --git a/src/parallel/gitter_pll_impl.cc b/src/parallel/gitter_pll_impl.cc
index a815ca782..b73614530 100644
--- a/src/parallel/gitter_pll_impl.cc
+++ b/src/parallel/gitter_pll_impl.cc
@@ -436,6 +436,7 @@ template class FacePllBaseXMacro < GitterBasisPll :: ObjectsPll :: hface4_IMPL >
 // #        #       #       #    #  #       #   ##     #
 // #######  ######  ######  #    #  ######  #    #     #
 
+/*
 pair < ElementPllXIF_t *, int > ElementPllBaseX :: accessOuterPllX (const pair < ElementPllXIF_t *, int > & x, int) {
   return x ;
 }
@@ -529,6 +530,7 @@ bool ElementPllBaseX :: lockAndTry () {
 bool ElementPllBaseX :: unlockAndResume (bool) {
   return (abort (), false) ;
 }
+*/
 
 //////////////////////////////////////////////////////////////////////
 //
@@ -698,13 +700,15 @@ template class BndsegPllBaseXMacroClosure< GitterBasis :: Objects :: Hbnd3Defaul
 //    #     #          #    #####   ######
 //    #     #          #    #   #   #    #
 //    #     ######     #    #    #  #    #
-void TetraPllXBase :: writeDynamicState (ObjectStream & os, GatherScatterType & gs) const 
+template < class A >
+void TetraPllXBase< A > :: writeDynamicState (ObjectStream & os, GatherScatterType & gs) const 
 {
   gs.sendData( os , mytetra () );
   return ;
 }
 
-void TetraPllXBase :: writeDynamicState (ObjectStream & os, int face) const 
+template < class A >
+void TetraPllXBase< A > :: writeDynamicState (ObjectStream & os, int face) const 
 {
   // write level to know the level of ghost on the other side
   os.writeObject( mytetra().level() );
@@ -712,40 +716,30 @@ void TetraPllXBase :: writeDynamicState (ObjectStream & os, int face) const
   return ;
 }
 
-void TetraPllXBase :: 
+template < class A >
+void TetraPllXBase< A > :: 
 VertexData2os(ObjectStream & os, GatherScatterType & gs, int borderFace) 
 {
   mytetra().VertexData2os(os,gs,borderFace);
 }
 
-void TetraPllXBase :: EdgeData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
+template < class A >
+void TetraPllXBase< A > :: EdgeData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
 {
   mytetra().EdgeData2os(os,gs,borderFace);
 }
 
-void TetraPllXBase :: FaceData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
+template < class A >
+void TetraPllXBase< A > :: FaceData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
 {
   mytetra().FaceData2os(os,gs,borderFace);
 } 
 
-void HexaPllBaseX :: VertexData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
-{
-  myhexa().VertexData2os(os,gs,borderFace);
-}
-
-void HexaPllBaseX :: EdgeData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
-{
-  myhexa().EdgeData2os(os,gs,borderFace);
-}
-
-void HexaPllBaseX :: FaceData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
-{
-  myhexa().FaceData2os(os,gs,borderFace);
-}
-
-TetraPllXBaseMacro :: TetraPllXBaseMacro (mytetra_t & t) 
-  : TetraPllXBase (t)
-  , _tetra(t)
+template < class A >
+TetraPllXBaseMacro< A > :: 
+TetraPllXBaseMacro (int l, myhface3_t *f0, int s0, myhface3_t *f1, int s1,
+                           myhface3_t *f2, int s2, myhface3_t *f3, int s3) 
+  : A(l, f0, s0, f1, s1, f2, s2, f3, s3 )
   , _moveTo ()
   , _ldbVertexIndex (-1)
   , _erasable (false) 
@@ -759,7 +753,8 @@ TetraPllXBaseMacro :: TetraPllXBaseMacro (mytetra_t & t)
   return ;
 }
 
-TetraPllXBaseMacro :: ~TetraPllXBaseMacro () {
+template < class A >
+TetraPllXBaseMacro< A > :: ~TetraPllXBaseMacro () {
   vector < int > v ;
   {
     // reserve memory 
@@ -775,15 +770,18 @@ TetraPllXBaseMacro :: ~TetraPllXBaseMacro () {
   return ;
 }
 
-int TetraPllXBaseMacro :: ldbVertexIndex () const {
+template < class A >
+int TetraPllXBaseMacro< A > :: ldbVertexIndex () const {
   return _ldbVertexIndex ;
 }
 
-int & TetraPllXBaseMacro :: ldbVertexIndex () {
+template < class A >
+int & TetraPllXBaseMacro< A > :: ldbVertexIndex () {
   return _ldbVertexIndex ;
 }
 
-bool TetraPllXBaseMacro :: ldbUpdateGraphVertex (LoadBalancer :: DataBase & db) {
+template < class A >
+bool TetraPllXBaseMacro< A > :: ldbUpdateGraphVertex (LoadBalancer :: DataBase & db) {
   // parameter are: 
   // - macro vertex index
   // - number of elementes below macro element 
@@ -793,12 +791,14 @@ bool TetraPllXBaseMacro :: ldbUpdateGraphVertex (LoadBalancer :: DataBase & db)
   return true ;
 }
 
-void TetraPllXBaseMacro :: writeStaticState (ObjectStream & os, int) const {
+template < class A >
+void TetraPllXBaseMacro< A > :: writeStaticState (ObjectStream & os, int) const {
   os.writeObject (ldbVertexIndex ()) ;
   return ;
 }
 
-void TetraPllXBaseMacro :: unattach2 (int i) {
+template < class A >
+void TetraPllXBaseMacro< A > :: unattach2 (int i) {
   assert (_moveTo.find (i) != _moveTo.end ()) ;
   if ( -- _moveTo [i] == 0) _moveTo.erase (i) ;
   mytetra ().myhface3 (0)->accessPllX ().unattach2 (i) ;
@@ -808,7 +808,8 @@ void TetraPllXBaseMacro :: unattach2 (int i) {
   return ;
 }
 
-void TetraPllXBaseMacro :: attach2 (int i) {
+template < class A >
+void TetraPllXBaseMacro< A > :: attach2 (int i) {
   map < int, int, less < int > > :: iterator pos = _moveTo.find (i) ;
   if (pos == _moveTo.end ()) {
     _moveTo.insert (pair < const int, int > (i,1)) ;
@@ -825,7 +826,8 @@ void TetraPllXBaseMacro :: attach2 (int i) {
   return ;
 }
 
-bool TetraPllXBaseMacro :: packAll (vector < ObjectStream > & osv) {
+template < class A >
+bool TetraPllXBaseMacro< A > :: packAll (vector < ObjectStream > & osv) {
   for (map < int, int, less < int > > :: const_iterator i = _moveTo.begin () ; i != _moveTo.end () ; i ++) 
   {
     int j = (*i).first ;
@@ -855,7 +857,8 @@ bool TetraPllXBaseMacro :: packAll (vector < ObjectStream > & osv) {
   return false ;
 }
 
-bool TetraPllXBaseMacro :: dunePackAll (vector < ObjectStream > & osv,
+template < class A >
+bool TetraPllXBaseMacro< A > :: dunePackAll (vector < ObjectStream > & osv,
                                         GatherScatterType & gs) 
 {
   for (map < int, int, less < int > > :: const_iterator i = _moveTo.begin () ; i != _moveTo.end () ; i ++) 
@@ -891,7 +894,8 @@ bool TetraPllXBaseMacro :: dunePackAll (vector < ObjectStream > & osv,
   return false ;
 }
 
-void TetraPllXBaseMacro :: packAsBndNow (int fce, ObjectStream & os) const 
+template < class A >
+void TetraPllXBaseMacro< A > :: packAsBndNow (int fce, ObjectStream & os) const 
 {
   os.writeObject (HBND3INT) ;
   os.writeObject (Gitter :: hbndseg :: closure) ;
@@ -929,7 +933,8 @@ void TetraPllXBaseMacro :: packAsBndNow (int fce, ObjectStream & os) const
 }
 
 // packs macro element as internal bnd for other proc 
-void TetraPllXBaseMacro :: packAsBnd (int fce, int who, ObjectStream & os) const {
+template < class A >
+void TetraPllXBaseMacro< A > :: packAsBnd (int fce, int who, ObjectStream & os) const {
   bool hit = _moveTo.size () == 0 ? true : false ;
   for (map < int, int, less < int > > :: const_iterator i = _moveTo.begin () ; 
        i != _moveTo.end () ; i ++ )
@@ -946,12 +951,14 @@ void TetraPllXBaseMacro :: packAsBnd (int fce, int who, ObjectStream & os) const
 }
 
 // packs macro element as internal bnd for other proc 
-void TetraPllXBaseMacro :: packAsGhost(ObjectStream & os, int fce) const 
+template < class A >
+void TetraPllXBaseMacro< A > :: packAsGhost(ObjectStream & os, int fce) const 
 {
   packAsBndNow(fce,os);
 }
 
-void TetraPllXBaseMacro :: unpackSelf (ObjectStream & os, bool i) 
+template < class A >
+void TetraPllXBaseMacro< A > :: unpackSelf (ObjectStream & os, bool i) 
 {
   assert (i) ;
   /*
@@ -989,7 +996,8 @@ void TetraPllXBaseMacro :: unpackSelf (ObjectStream & os, bool i)
   return ;
 }
 
-void TetraPllXBaseMacro :: duneUnpackSelf (ObjectStream & os, 
+template < class A >
+void TetraPllXBaseMacro< A > :: duneUnpackSelf (ObjectStream & os, 
     GatherScatterType & gs , bool i) 
 {
   assert (i) ;
@@ -1019,10 +1027,15 @@ void TetraPllXBaseMacro :: duneUnpackSelf (ObjectStream & os,
   return ;
 }
 
-bool TetraPllXBaseMacro :: erasable () const {
+template < class A >
+bool TetraPllXBaseMacro< A > :: erasable () const {
   return _erasable ;
 }
 
+// template instatiation 
+template class TetraPllXBase< GitterBasisPll :: ObjectsPll :: TetraEmpty > ;
+template class TetraPllXBaseMacro< GitterBasisPll :: ObjectsPll :: tetra_IMPL > ;
+
 // ######                                                           #####
 // #     #  ######  #####      #     ####   #####      #     ####  #     #
 // #     #  #       #    #     #    #    #  #    #     #    #    #       #
@@ -1046,7 +1059,12 @@ void Periodic3PllXBase :: writeDynamicState (ObjectStream & os, int) const {
   return ;
 }
 
-Periodic3PllXBaseMacro :: Periodic3PllXBaseMacro (myperiodic3_t & p) : Periodic3PllXBase (p), _ldbVertexIndex (-1), _moveTo (), _erasable (false) {
+Periodic3PllXBaseMacro :: Periodic3PllXBaseMacro (myperiodic3_t & p) 
+  : Periodic3PllXBase (p)
+  , _moveTo ()
+  , _ldbVertexIndex (-1)
+  , _erasable (false) 
+{
   static const double x = 1./3. ;
   LinearSurfaceMapping (myperiodic3 ().myvertex (0,0)->Point (), myperiodic3 ().myvertex (0,1)->Point (),
          myperiodic3 ().myvertex (0,2)->Point ()).map2world (x,x,x,_center) ;
@@ -1205,7 +1223,12 @@ void Periodic4PllXBase :: writeDynamicState (ObjectStream & os, int) const {
   return ;
 }
 
-Periodic4PllXBaseMacro :: Periodic4PllXBaseMacro (myperiodic4_t & p) : Periodic4PllXBase (p), _ldbVertexIndex (-1), _moveTo (), _erasable (false) {
+Periodic4PllXBaseMacro :: Periodic4PllXBaseMacro (myperiodic4_t & p) 
+  : Periodic4PllXBase (p)
+  , _moveTo ()
+  , _ldbVertexIndex (-1)
+  , _erasable (false) 
+{
   static const double x = .0 ;
   BilinearSurfaceMapping (myperiodic4 ().myvertex (0,0)->Point (), myperiodic4 ().myvertex (0,1)->Point (),
          myperiodic4 ().myvertex (0,2)->Point (), myperiodic4 ().myvertex (0,3)->Point ()).map2world (x,x,_center) ;
@@ -1358,13 +1381,33 @@ bool Periodic4PllXBaseMacro :: erasable () const {
   // #     #  #        #  #   #    #
   // #     #  ######  #    #  #    #
 
-void HexaPllBaseX  :: writeDynamicState (ObjectStream & os, GatherScatterType & gs) const 
+template < class A >
+void HexaPllBaseX< A > :: VertexData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
+{
+  myhexa().VertexData2os(os,gs,borderFace);
+}
+
+template < class A >
+void HexaPllBaseX< A > :: EdgeData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
+{
+  myhexa().EdgeData2os(os,gs,borderFace);
+}
+
+template < class A >
+void HexaPllBaseX< A > :: FaceData2os(ObjectStream & os, GatherScatterType & gs, int borderFace ) 
+{
+  myhexa().FaceData2os(os,gs,borderFace);
+}
+
+template < class A >
+void HexaPllBaseX< A >  :: writeDynamicState (ObjectStream & os, GatherScatterType & gs) const 
 {
   gs.sendData( os , myhexa () );
   return ;
 }
 
-void HexaPllBaseX :: writeDynamicState (ObjectStream & os, int face) const 
+template < class A >
+void HexaPllBaseX< A > :: writeDynamicState (ObjectStream & os, int face) const 
 {
   // siehe writeDynamicState von Tetra 
 
@@ -1375,8 +1418,12 @@ void HexaPllBaseX :: writeDynamicState (ObjectStream & os, int face) const
   return ;
 }
 
-HexaPllBaseXMacro :: HexaPllBaseXMacro (myhexa_t & h) 
-: _hexa(h)
+template < class A >
+HexaPllBaseXMacro< A > :: 
+HexaPllBaseXMacro(int l, myhface4_t *f0, int s0, myhface4_t *f1, int s1,
+                         myhface4_t *f2, int s2, myhface4_t *f3, int s3,
+                         myhface4_t *f4, int s4, myhface4_t *f5, int s5)
+: A(l, f0, s0, f1, s1, f2, s2, f3, s3, f4, s4, f5, s5)
 , _moveTo ()
 , _ldbVertexIndex (-1)
 , _erasable (false) 
@@ -1395,7 +1442,8 @@ HexaPllBaseXMacro :: HexaPllBaseXMacro (myhexa_t & h)
   return ;
 }
 
-HexaPllBaseXMacro :: ~HexaPllBaseXMacro () {
+template < class A >
+HexaPllBaseXMacro< A > :: ~HexaPllBaseXMacro () {
   vector < int > v ;
   {
     // reserve memory 
@@ -1412,26 +1460,31 @@ HexaPllBaseXMacro :: ~HexaPllBaseXMacro () {
   return ;
 }
 
-int HexaPllBaseXMacro :: ldbVertexIndex () const {
+template < class A >
+int HexaPllBaseXMacro< A > :: ldbVertexIndex () const {
   return _ldbVertexIndex ;
 }
 
-int & HexaPllBaseXMacro :: ldbVertexIndex () {
+template < class A >
+int & HexaPllBaseXMacro< A > :: ldbVertexIndex () {
   return _ldbVertexIndex ;
 }
 
-bool HexaPllBaseXMacro :: ldbUpdateGraphVertex (LoadBalancer :: DataBase & db) {
+template < class A >
+bool HexaPllBaseXMacro< A > :: ldbUpdateGraphVertex (LoadBalancer :: DataBase & db) {
   db.vertexUpdate (LoadBalancer :: GraphVertex (ldbVertexIndex (), 
       TreeIterator < Gitter :: helement_STI, is_leaf < Gitter :: helement_STI > > (myhexa ()).size (), _center)) ;
   return true ;
 }
 
-void HexaPllBaseXMacro :: writeStaticState (ObjectStream & os, int) const {
+template < class A >
+void HexaPllBaseXMacro< A > :: writeStaticState (ObjectStream & os, int) const {
   os.writeObject (ldbVertexIndex ()) ;
   return ;
 }
 
-void HexaPllBaseXMacro :: unattach2 (int i) {
+template < class A >
+void HexaPllBaseXMacro< A > :: unattach2 (int i) {
   assert (_moveTo.find (i) != _moveTo.end ()) ;
   if ( -- _moveTo [i] == 0) _moveTo.erase (i) ;
   myhexa ().myhface4 (0)->accessPllX ().unattach2 (i) ;
@@ -1443,7 +1496,8 @@ void HexaPllBaseXMacro :: unattach2 (int i) {
   return ;
 }
 
-void HexaPllBaseXMacro :: attach2 (int i) {
+template < class A >
+void HexaPllBaseXMacro< A > :: attach2 (int i) {
   map < int, int, less < int > > :: iterator pos = _moveTo.find (i) ;
   if (pos == _moveTo.end ()) {
     _moveTo.insert (pair < const int, int > (i,1)) ;
@@ -1462,7 +1516,8 @@ void HexaPllBaseXMacro :: attach2 (int i) {
   return ;
 }
 
-bool HexaPllBaseXMacro :: packAll (vector < ObjectStream > & osv) {
+template < class A >
+bool HexaPllBaseXMacro< A > :: packAll (vector < ObjectStream > & osv) {
   for (map < int, int, less < int > > :: const_iterator i = _moveTo.begin () ; i != _moveTo.end () ; i ++) {
     int j = (*i).first ;
     assert ((osv.begin () + j) < osv.end ()) ;
@@ -1496,7 +1551,8 @@ bool HexaPllBaseXMacro :: packAll (vector < ObjectStream > & osv) {
 }
 
 // pack all function for dune 
-bool HexaPllBaseXMacro :: dunePackAll (vector < ObjectStream > & osv,
+template < class A >
+bool HexaPllBaseXMacro< A > :: dunePackAll (vector < ObjectStream > & osv,
                                        GatherScatterType & gs) 
 {
   for (map < int, int, less < int > > :: const_iterator i = _moveTo.begin () ; i != _moveTo.end () ; i ++) 
@@ -1537,7 +1593,8 @@ bool HexaPllBaseXMacro :: dunePackAll (vector < ObjectStream > & osv,
 }
 
 
-void HexaPllBaseXMacro :: packAsBndNow(int fce, ObjectStream & os) const 
+template < class A >
+void HexaPllBaseXMacro< A > :: packAsBndNow(int fce, ObjectStream & os) const 
 {
   os.writeObject (HBND4INT) ;
   os.writeObject (Gitter :: hbndseg :: closure) ;
@@ -1573,13 +1630,15 @@ void HexaPllBaseXMacro :: packAsBndNow(int fce, ObjectStream & os) const
   }
 }
 
-void HexaPllBaseXMacro :: packAsGhost(ObjectStream & os, int fce) const 
+template < class A >
+void HexaPllBaseXMacro< A > :: packAsGhost(ObjectStream & os, int fce) const 
 {
   packAsBndNow(fce, os);
 }
 
 // packs macro element as internal bnd for other proc 
-void HexaPllBaseXMacro :: packAsBnd (int fce, int who, ObjectStream & os) const 
+template < class A >
+void HexaPllBaseXMacro< A > :: packAsBnd (int fce, int who, ObjectStream & os) const 
 {
   bool hit = _moveTo.size () == 0 ? true : false ;
   for (map < int, int, less < int > > :: const_iterator i = _moveTo.begin () ; 
@@ -1595,7 +1654,8 @@ void HexaPllBaseXMacro :: packAsBnd (int fce, int who, ObjectStream & os) const
   return ;
 }
 
-void HexaPllBaseXMacro :: unpackSelf (ObjectStream & os, bool i) 
+template < class A >
+void HexaPllBaseXMacro< A > :: unpackSelf (ObjectStream & os, bool i) 
 {
   assert (i) ;
   if (i) 
@@ -1621,7 +1681,8 @@ void HexaPllBaseXMacro :: unpackSelf (ObjectStream & os, bool i)
   return ;
 }
 
-void HexaPllBaseXMacro :: duneUnpackSelf (ObjectStream & os, GatherScatterType & gs , bool i) 
+template < class A >
+void HexaPllBaseXMacro< A > :: duneUnpackSelf (ObjectStream & os, GatherScatterType & gs , bool i) 
 {
   assert (i) ;
   if (i) 
@@ -1650,10 +1711,21 @@ void HexaPllBaseXMacro :: duneUnpackSelf (ObjectStream & os, GatherScatterType &
   return ;
 }
 
-bool HexaPllBaseXMacro :: erasable () const {
+template < class A >
+bool HexaPllBaseXMacro< A > :: erasable () const {
   return _erasable ;
 }
 
+// template instatiation 
+template class HexaPllBaseX< GitterBasisPll :: ObjectsPll :: HexaEmpty > ;
+template class HexaPllBaseXMacro< GitterBasisPll :: ObjectsPll :: hexa_IMPL > ;
+
+///////////////////////////////////////////////////////////
+//
+//  --BndsegPllBaseX
+//
+///////////////////////////////////////////////////////////
+
 pair < ElementPllXIF_t *, int > BndsegPllBaseX :: accessOuterPllX (const pair < ElementPllXIF_t *, int > &, int f) {
   assert (!f) ;  
   return pair < ElementPllXIF_t *, int > (this,0) ;
@@ -1716,51 +1788,6 @@ Hface4EmptyPllMacro (myhedge1_t *e0, int s0, myhedge1_t *e1, int s1,
 {
 } 
 
-ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: TetraEmptyPll :: accessPllX () throw (Parallel :: AccessPllException) {
-  return *this;
-}
-
-const ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: TetraEmptyPll :: accessPllX () const throw (Parallel :: AccessPllException) {
-  //return _pllx ;
-  return *this;
-}
-
-void GitterBasisPll :: ObjectsPll :: TetraEmptyPll :: detachPllXFromMacro () throw (Parallel :: AccessPllException) {
-  abort () ;  // Auf dem feinen Element ist die Aktion nicht zul"assig.
-  return ;
-}
-  
-GitterBasisPll :: ObjectsPll :: TetraEmptyPllMacro :: 
-TetraEmptyPllMacro (myhface3_t * f0, int t0, myhface3_t * f1, int t1, myhface3_t * f2, int t2, 
-                    myhface3_t * f3, int t3)
-  : GitterBasisPll :: ObjectsPll :: tetra_IMPL (0,f0,t0,f1,t1,f2,t2,f3,t3),
-    _pllx (new mypllx_t (*this)) {
-  return ;
-}
-
-GitterBasisPll :: ObjectsPll :: TetraEmptyPllMacro :: ~TetraEmptyPllMacro () {
-  delete _pllx ;
-  _pllx = 0 ;
-  return ;
-}
-
-ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: TetraEmptyPllMacro :: accessPllX () throw (Parallel :: AccessPllException) {
-  assert (_pllx) ;
-  return * _pllx ;
-}
-
-const ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: TetraEmptyPllMacro :: accessPllX () const throw (Parallel :: AccessPllException) {
-  assert (_pllx) ;
-  return * _pllx ;
-}
-
-void GitterBasisPll :: ObjectsPll :: TetraEmptyPllMacro :: detachPllXFromMacro () throw (Parallel :: AccessPllException) {
-  delete _pllx ;
-  _pllx = 0 ;
-  return ;
-}
-
-
 // ######                                                           #####
 // #     #  ######  #####      #     ####   #####      #     ####  #     #
 // #     #  #       #    #     #    #    #  #    #     #    #    #       #
@@ -1858,52 +1885,9 @@ void GitterBasisPll :: ObjectsPll :: Periodic4EmptyPllMacro :: detachPllXFromMac
   return ;
 }
 
-
-ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: HexaEmptyPll :: accessPllX () throw (Parallel :: AccessPllException) {
-  //return _pllx ;
-  return *this;
-}
-
-const ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: HexaEmptyPll :: accessPllX () const throw (Parallel :: AccessPllException) {
-  //return _pllx ;
-  return *this;
-}
-
-void GitterBasisPll :: ObjectsPll :: HexaEmptyPll :: detachPllXFromMacro () throw (Parallel :: AccessPllException) {
-  abort () ;
-  return ;
-}
-
-GitterBasisPll :: ObjectsPll :: HexaEmptyPllMacro :: HexaEmptyPllMacro 
-  (myhface4_t * f0, int t0, myhface4_t * f1, int t1, myhface4_t * f2, int t2, 
-   myhface4_t * f3, int t3, myhface4_t * f4, int t4, myhface4_t * f5, int t5)
-  : GitterBasisPll :: ObjectsPll :: hexa_IMPL (0,f0,t0,f1,t1,f2,t2,f3,t3,f4,t4,f5,t5), 
-    _pllx (new mypllx_t (*this)) {
-  return ;
-}
-
-GitterBasisPll :: ObjectsPll :: HexaEmptyPllMacro :: ~HexaEmptyPllMacro () {
-  delete _pllx ;
-  _pllx = 0 ;
-  return ;
-}
-
-ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: HexaEmptyPllMacro :: accessPllX () throw (Parallel :: AccessPllException) {
-  assert (_pllx) ;
-  return * _pllx ;
-}
-
-const ElementPllXIF_t & GitterBasisPll :: ObjectsPll :: HexaEmptyPllMacro :: accessPllX () const throw (Parallel :: AccessPllException) {
-  assert (_pllx) ;
-  return * _pllx ;
-}
-
-void GitterBasisPll :: ObjectsPll :: HexaEmptyPllMacro :: detachPllXFromMacro () throw (Parallel :: AccessPllException) {
-  delete _pllx ;
-  _pllx = 0 ;
-  return ;
-}
-
+////////////////////////////////////////////////////////////////
+//  --MacroGitterBasisPll
+////////////////////////////////////////////////////////////////
 GitterBasisPll :: MacroGitterBasisPll :: MacroGitterBasisPll (Gitter * mygrid , istream & in) : GitterPll :: MacroGitterPll () , GitterBasis:: MacroGitterBasis (mygrid) 
 {
   macrogridBuilder (in ) ;
diff --git a/src/parallel/gitter_pll_impl.h b/src/parallel/gitter_pll_impl.h
index 7cc918d13..91c297bed 100644
--- a/src/parallel/gitter_pll_impl.h
+++ b/src/parallel/gitter_pll_impl.h
@@ -171,8 +171,9 @@ template < class A > class FacePllBaseXMacro : public A
     Refcount _ref ;
 } ;
 
-
-class ElementPllBaseX : public ElementPllXIF_t , public MyAlloc 
+/*
+template < class A >
+class ElementPllBaseX : public A 
 {
   // Alle Methoden in dieser Klasse sind Dummies und erzeugen
   // Laufzeitfehler. Sie m"ussen von abgeleiteten Klassen 
@@ -212,16 +213,21 @@ class ElementPllBaseX : public ElementPllXIF_t , public MyAlloc
     bool lockAndTry () ;
     bool unlockAndResume (bool) ;
 } ;
+*/
 
-class TetraPllXBase : public ElementPllBaseX {
+template < class A >
+class TetraPllXBase : public A {
   public :
-    typedef Gitter :: Geometric :: tetra_GEO mytetra_t ;
-    virtual mytetra_t & mytetra () = 0 ;
-    virtual const mytetra_t & mytetra () const = 0;
+    typedef A mytetra_t ;
+    typedef typename A :: myhface3_t myhface3_t;
   protected:  
-    inline TetraPllXBase () {}
+    inline TetraPllXBase(myhface3_t *f0, int s0, myhface3_t *f1, int s1, 
+                         myhface3_t *f2, int s2, myhface3_t *f3, int s3) 
+        : A(f0, s0, f1, s1, f2, s2, f3, s3 ) {}
+
+    inline mytetra_t& mytetra() { return *this; }
+    inline const mytetra_t& mytetra() const { return *this; }
   public :
-    inline TetraPllXBase (mytetra_t &) ;
     inline ~TetraPllXBase () {}
 
     // method to get internal tetra located behind this parallel interface 
@@ -235,13 +241,22 @@ class TetraPllXBase : public ElementPllBaseX {
     virtual void FaceData2os(ObjectStream &, GatherScatterType &, int) ; 
 } ;
 
-class TetraPllXBaseMacro : public TetraPllXBase {
+template < class A >
+class TetraPllXBaseMacro : public A 
+{
   public :
-    TetraPllXBaseMacro (mytetra_t &) ;
    ~TetraPllXBaseMacro () ;
-    virtual mytetra_t & mytetra () { return _tetra; }
-    virtual const mytetra_t & mytetra () const { return _tetra; }
   protected :
+    using A :: TETRA ;
+    using A :: HBND3INT ;
+    typedef A mytetra_t ;
+    inline mytetra_t& mytetra() { return *this; }
+    inline const mytetra_t& mytetra() const { return *this; }
+
+    typedef typename A :: myhface3_t myhface3_t;
+    TetraPllXBaseMacro(int l, myhface3_t *f0, int s0, myhface3_t *f1, int s1, 
+                       myhface3_t *f2, int s2, myhface3_t *f3, int s3);
+
     virtual void inlineData (ObjectStream &) throw (ObjectStream :: EOFException) {}
     virtual void xtractData (ObjectStream &) throw (ObjectStream :: EOFException) {}
   public :
@@ -262,12 +277,11 @@ class TetraPllXBaseMacro : public TetraPllXBase {
     virtual bool erasable () const ;
     
     // method to get internal tetra located behind this parallel interface 
-    virtual void getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p );
+    //virtual void getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p );
   protected:
     void packAsBndNow (int, ObjectStream &) const;
     
   private :
-    mytetra_t& _tetra;
     alucoord_t _center [3] ;
     map < int, int, less < int > > _moveTo ;
     int _ldbVertexIndex ;
@@ -282,7 +296,7 @@ class TetraPllXBaseMacro : public TetraPllXBase {
 // #        #       #   #      #    #    #  #    #     #    #    # #     #
 // #        ######  #    #     #     ####   #####      #     ####   #####
 
-class Periodic3PllXBase : public ElementPllBaseX {
+class Periodic3PllXBase : public ElementPllXIF_t {
   public :
     typedef Gitter :: Geometric :: periodic3_GEO myperiodic3_t ;
     inline myperiodic3_t & myperiodic3 () ;
@@ -318,10 +332,10 @@ class Periodic3PllXBaseMacro : public Periodic3PllXBase {
     virtual void unpackSelf (ObjectStream &, bool) ;
     virtual bool erasable () const ;
   private :
-    int _ldbVertexIndex ;
+    alucoord_t _center [3] ;
     map < int, int, less < int > > _moveTo ;
+    int _ldbVertexIndex ;
     bool _erasable ;
-    alucoord_t _center [3] ;
 } ;
 
 // ######                                                          #
@@ -332,7 +346,7 @@ class Periodic3PllXBaseMacro : public Periodic3PllXBase {
 // #        #       #   #      #    #    #  #    #     #    #    #      #
 // #        ######  #    #     #     ####   #####      #     ####       #
 
-class Periodic4PllXBase : public ElementPllBaseX {
+class Periodic4PllXBase : public ElementPllXIF_t {
   public :
     typedef Gitter :: Geometric :: periodic4_GEO myperiodic4_t ;
     inline myperiodic4_t & myperiodic4 () ;
@@ -341,9 +355,6 @@ class Periodic4PllXBase : public ElementPllBaseX {
     inline Periodic4PllXBase (myperiodic4_t &) ;
     inline ~Periodic4PllXBase () {}
   public :
-//    virtual void VertexData2os(ObjectStream &, GatherScatterType &) { std::cerr << "P4 wVD";}
-//    virtual void EdgeData2os(ObjectStream &, GatherScatterType &) { std::cerr << "P4 wED";}
-//    virtual void FaceData2os(ObjectStream &, GatherScatterType &) { std::cerr << "P4 wFD";} 
     void writeDynamicState (ObjectStream &, int) const ;
     void writeDynamicState (ObjectStream &, GatherScatterType &) const { assert(false); abort(); };
   private :
@@ -370,10 +381,10 @@ class Periodic4PllXBaseMacro : public Periodic4PllXBase {
     virtual void unpackSelf (ObjectStream &, bool) ;
     virtual bool erasable () const ;
   private :
-    int _ldbVertexIndex ;
+    alucoord_t _center [3] ;
     map < int, int, less < int > > _moveTo ;
+    int _ldbVertexIndex ;
     bool _erasable ;
-    alucoord_t _center [3] ;
 } ;
 
 // #     #
@@ -384,16 +395,20 @@ class Periodic4PllXBaseMacro : public Periodic4PllXBase {
 // #     #  #        #  #   #    #
 // #     #  ######  #    #  #    #
 
-class HexaPllBaseX : public ElementPllBaseX {
+template < class A > 
+class HexaPllBaseX : public A 
+{
   protected :
-    typedef Gitter :: Geometric :: hexa_GEO myhexa_t ;
-    virtual myhexa_t & myhexa () = 0 ;
-    virtual const myhexa_t & myhexa () const = 0 ;
-    inline HexaPllBaseX () {}
-
+    typedef typename A :: myhface4_t myhface4_t;
+    typedef A  myhexa_t ;
+    inline myhexa_t & myhexa () { return *this; }
+    inline const myhexa_t & myhexa () const { return *this; }
+
+    inline HexaPllBaseX(myhface4_t *f0, int s0, myhface4_t *f1, int s1,
+                        myhface4_t *f2, int s2, myhface4_t *f3, int s3,
+                        myhface4_t *f4, int s4, myhface4_t *f5, int s5)
+        : A(f0, s0, f1, s1, f2, s2, f3, s3, f4, s4, f5, s5) {}
   public :
-    inline HexaPllBaseX (myhexa_t &) ;
-    inline ~HexaPllBaseX () {}
     void writeDynamicState (ObjectStream &, int) const ;
     void writeDynamicState (ObjectStream &, GatherScatterType &) const ;
  
@@ -404,19 +419,27 @@ class HexaPllBaseX : public ElementPllBaseX {
     virtual void getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p);
 } ;
 
-class HexaPllBaseXMacro : public HexaPllBaseX {
+template < class A > 
+class HexaPllBaseXMacro : public A 
+{
+  protected:
+    using A :: HEXA ;
+    using A :: HBND4INT ;
+
+    typedef A  myhexa_t ;
+    inline myhexa_t & myhexa () { return *this; }
+    inline const myhexa_t & myhexa () const { return *this; }
+
+    typedef typename A :: myhface4_t myhface4_t;
+    HexaPllBaseXMacro(int l, myhface4_t *f0, int s0, myhface4_t *f1, int s1,
+                             myhface4_t *f2, int s2, myhface4_t *f3, int s3,
+                             myhface4_t *f4, int s4, myhface4_t *f5, int s5) ;
   public :
-    HexaPllBaseXMacro (myhexa_t &) ;
    ~HexaPllBaseXMacro () ;
     virtual void writeStaticState (ObjectStream &, int) const ;
-  public :
-    virtual myhexa_t & myhexa () { return _hexa; }
-    virtual const myhexa_t & myhexa () const { return _hexa; }
-
     virtual int ldbVertexIndex () const ;
     virtual int & ldbVertexIndex () ;
     virtual bool ldbUpdateGraphVertex (LoadBalancer :: DataBase &) ;
-  public :
     virtual void attach2 (int) ;
     virtual void unattach2 (int) ;
     
@@ -432,22 +455,21 @@ class HexaPllBaseXMacro : public HexaPllBaseX {
     virtual void duneUnpackSelf (ObjectStream &, GatherScatterType &, bool) ;
     
     // method to get internal hexa located behind this parallel interface 
-    virtual void getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p);
+    //virtual void getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p);
 
   protected :
     virtual void inlineData (ObjectStream &) throw (ObjectStream :: EOFException) {}
     virtual void xtractData (ObjectStream &) throw (ObjectStream :: EOFException) {}
 
     void packAsBndNow (int, ObjectStream &) const;
-  private :
-    myhexa_t & _hexa ;
+  protected:
     alucoord_t _center [3] ;
     map < int, int, less < int > > _moveTo ;
     int _ldbVertexIndex ;
     bool _erasable ;
 } ;
 
-class BndsegPllBaseX : public ElementPllBaseX {
+class BndsegPllBaseX : public ElementPllXIF_t {
   public :
     void writeDynamicState (ObjectStream &, int) const { abort () ; }
     void writeDynamicState (ObjectStream &, GatherScatterType &) const { assert(false); abort(); };
@@ -629,44 +651,28 @@ public :
     } ;
 
 public :
-  class TetraEmptyPll : public TetraEmpty 
-                      , public TetraPllXBase 
-  {
+    ///////////////////////////////////////////////////////////////
+    // --TetraImpl
+    ///////////////////////////////////////////////////////////////
+    class TetraEmptyPll : public TetraPllXBase< TetraEmpty >
+    {
     protected :
       typedef hedge1_IMPL inneredge_t ;
       typedef hface3_IMPL innerface_t ;
       typedef TetraEmpty :: balrule_t balrule_t;
     public :
-      typedef Gitter :: Geometric :: tetra_GEO mytetra_t ;
-      inline mytetra_t & mytetra () { return *this; }
-      inline const mytetra_t & mytetra () const { return *this ; }
-
-      typedef TetraPllXBase mypllx_t ;
-      inline TetraEmptyPll (myhface3_t *,int,myhface3_t *,int,myhface3_t *,int,myhface3_t *,int) ;
-      ~TetraEmptyPll () {}
-      virtual ElementPllXIF_t & accessPllX () throw (Parallel :: AccessPllException) ;
-      virtual const ElementPllXIF_t &accessPllX () const throw (Parallel :: AccessPllException) ;
-      virtual void detachPllXFromMacro () throw (Parallel :: AccessPllException) ;
-
-    private :
-      //mypllx_t _pllx ;
-      friend class TetraTop < TetraEmptyPll >;
+      inline TetraEmptyPll (myhface3_t *f0, int s0, myhface3_t *f1, int s1, 
+                            myhface3_t *f2, int s2, myhface3_t *f3, int s3) 
+        : TetraPllXBase< TetraEmpty >(f0, s0, f1, s1, f2, s2, f3, s3 ) {}
     } ;
     typedef TetraTop < TetraEmptyPll > tetra_IMPL ;
 
-    class TetraEmptyPllMacro : public tetra_IMPL 
+    class TetraEmptyPllMacro : public TetraPllXBaseMacro< tetra_IMPL >
     {
     public :
-      typedef TetraPllXBaseMacro mypllx_t ;
-      TetraEmptyPllMacro (myhface3_t *,int,myhface3_t *,int,myhface3_t *,int,
-                          myhface3_t *,int) ;
-     ~TetraEmptyPllMacro () ;
-      virtual ElementPllXIF_t & accessPllX () throw (Parallel :: AccessPllException) ;
-      virtual const ElementPllXIF_t & accessPllX () const throw (Parallel :: AccessPllException) ;
-      virtual void detachPllXFromMacro () throw (Parallel :: AccessPllException) ;
-    private :
-      mypllx_t * _pllx ;
-      friend class TetraPllXBaseMacro;
+      inline TetraEmptyPllMacro (myhface3_t *f0, int s0, myhface3_t *f1, int s1, 
+                                 myhface3_t *f2, int s2, myhface3_t *f3, int s3) 
+        : TetraPllXBaseMacro< tetra_IMPL >(0, f0, s0, f1, s1, f2, s2, f3, s3 ) {} // 0 == level 0
     } ;
 
    /////////////////////////////////
@@ -744,49 +750,27 @@ public :
       friend class Periodic4PllXBaseMacro;
     } ;
 
-    class HexaEmptyPll : public HexaEmpty
-                       , public HexaPllBaseX  
+    class HexaEmptyPll : public HexaPllBaseX< HexaEmpty >
     {
     protected :
       typedef hedge1_IMPL inneredge_t ;
       typedef hface4_IMPL innerface_t ;
       typedef HexaEmpty :: balrule_t balrule_t;
     public :
-      inline myhexa_t & myhexa () { return *this; }
-      inline const myhexa_t & myhexa () const { return *this; }
-
-      typedef HexaPllBaseX mypllx_t ;
-      inline HexaEmptyPll (myhface4_t *,int,myhface4_t *,int,
-                           myhface4_t *,int,myhface4_t *,int,
-                           myhface4_t *,int,myhface4_t *,int);
-      inline ~HexaEmptyPll () {}
-      virtual ElementPllXIF_t & accessPllX () throw (Parallel :: AccessPllException) ;
-      virtual const ElementPllXIF_t & accessPllX () const throw (Parallel :: AccessPllException) ;
-      virtual void detachPllXFromMacro () throw (Parallel :: AccessPllException) ;
-    //private :
-    //  mypllx_t _pllx ;
+      inline HexaEmptyPll (myhface4_t *f0, int s0, myhface4_t *f1, int s1,
+                           myhface4_t *f2, int s2, myhface4_t *f3, int s3,
+                           myhface4_t *f4, int s4, myhface4_t *f5, int s5)
+        : HexaPllBaseX< HexaEmpty >(f0, s0, f1, s1, f2, s2, f3, s3, f4, s4, f5, s5) {}
     } ;
     typedef HexaTop < HexaEmptyPll > hexa_IMPL ;
 
-    class HexaEmptyPllMacro : public hexa_IMPL
+    class HexaEmptyPllMacro : public HexaPllBaseXMacro< hexa_IMPL >
     {
     public :
-      typedef HexaPllBaseXMacro mypllx_t ;
-      HexaEmptyPllMacro (myhface4_t *,int,myhface4_t *,int,myhface4_t *,int,myhface4_t *,int,myhface4_t *,int,
-              myhface4_t *,int) ;
-     ~HexaEmptyPllMacro () ;
-      virtual ElementPllXIF_t & accessPllX () throw (Parallel :: AccessPllException) ;
-      virtual const ElementPllXIF_t & accessPllX () const throw (Parallel :: AccessPllException) ;
-      virtual void detachPllXFromMacro () throw (Parallel :: AccessPllException) ;
-  
-      // Hier, und auch beim Tetraeder besteht die M"oglichkeit das refine
-      // auf dem Grobgitterelement zu "uberschreiben, um gegebenenfalls noch
-      // andere Funktionen mit aufzuklemmen:  
-      // virtual int refine () ;
-    
-    private :
-      mypllx_t * _pllx ;
-      friend class HexaPllBaseXMacro;
+      inline HexaEmptyPllMacro(myhface4_t *f0, int s0, myhface4_t *f1, int s1,
+                               myhface4_t *f2, int s2, myhface4_t *f3, int s3,
+                               myhface4_t *f4, int s4, myhface4_t *f5, int s5)
+        : HexaPllBaseXMacro< hexa_IMPL >(0, f0, s0, f1, s1, f2, s2, f3, s3, f4, s4, f5, s5) {}
     } ;
   
     // Die Randelemente des verteilten Gitters werden aus Templates 
@@ -1103,27 +1087,8 @@ template < class A > void FacePllBaseX < A > :: unpackSelf (ObjectStream &, bool
 //
 ///////////////////////////////////////////////////////////////////
 
-inline TetraPllXBase :: TetraPllXBase (mytetra_t & t) 
-  //: _tetra (t) 
-{
-  return ;
-}
-
-//inline TetraPllXBase :: mytetra_t & TetraPllXBase :: mytetra () {
-//  return _tetra ;
-//}
-
-//inline const TetraPllXBase :: mytetra_t & TetraPllXBase :: mytetra () const {
-//  return _tetra ;
-//}
-
-inline void TetraPllXBase :: getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p )
-{
-  p.first  = & mytetra();
-  p.second = 0;
-}
-
-inline void TetraPllXBaseMacro :: getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p )
+template < class A >
+inline void TetraPllXBase< A > :: getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p )
 {
   p.first  = & mytetra();
   p.second = 0;
@@ -1169,26 +1134,8 @@ inline const Periodic4PllXBase :: myperiodic4_t & Periodic4PllXBase :: myperiodi
   return _periodic4 ;
 }
 
-inline HexaPllBaseX :: HexaPllBaseX (myhexa_t & h) // : _hexa (h) 
-{
-  return ;
-}
-
-//inline HexaPllBaseX :: myhexa_t & HexaPllBaseX :: myhexa () {
-//  return _hexa ;
-//}
-
-//inline const HexaPllBaseX :: myhexa_t & HexaPllBaseX :: myhexa () const {
-//  return _hexa ;
-//}
-
-inline void HexaPllBaseX :: getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p)
-{
-  p.first  = & myhexa();
-  p.second = 0;
-}
-
-inline void HexaPllBaseXMacro :: getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p)
+template < class A >
+inline void HexaPllBaseX< A > :: getAttachedElement ( pair < Gitter::helement_STI* , Gitter::hbndseg_STI * > & p)
 {
   p.first  = & myhexa();
   p.second = 0;
@@ -1303,16 +1250,6 @@ template < class A > inline int & BndsegPllBaseXMacroClosure < A > :: ldbVertexI
   return _extGraphVertexIndex ;
 }
 
-inline GitterBasisPll :: ObjectsPll :: TetraEmptyPll :: 
-TetraEmptyPll (myhface3_t * f0, int t0, 
-               myhface3_t * f1, int t1, 
-               myhface3_t * f2, int t2, 
-               myhface3_t * f3, int t3 ) 
-  : GitterBasis :: Objects :: TetraEmpty (f0,t0,f1,t1,f2,t2,f3,t3)
-{
-  return ;
-}
-
 inline GitterBasisPll :: ObjectsPll :: Periodic3EmptyPll :: 
 Periodic3EmptyPll (myhface3_t * f0, int t0, myhface3_t * f1, int t1) 
   : GitterBasis :: Objects :: Periodic3Empty (f0,t0,f1,t1), _pllx (*this) {
@@ -1333,16 +1270,6 @@ Periodic4EmptyPll (myhface4_t * f0, int t0, myhface4_t * f1, int t1)
   return ;
 }
 
-inline GitterBasisPll :: ObjectsPll :: HexaEmptyPll :: 
-HexaEmptyPll (myhface4_t * f0, int t0, myhface4_t * f1, int t1, 
-              myhface4_t * f2, int t2, myhface4_t * f3, int t3, 
-              myhface4_t * f4, int t4, myhface4_t * f5, int t5) :
-  GitterBasis::Objects::HexaEmpty(f0,t0,f1,t1,f2,t2,f3,t3,f4,t4,f5,t5)
-//  ,_pllx (*this) 
-{
-  return ;
-}
-
 inline int GitterBasisPll :: MacroGitterBasisPll :: iterators_attached () const {
   return GitterBasis :: MacroGitterBasis :: iterators_attached () + MacroGitterPll :: iterators_attached () ;
 }
diff --git a/src/serial/elementif.h b/src/serial/elementif.h
index 9176ec408..77087f70a 100644
--- a/src/serial/elementif.h
+++ b/src/serial/elementif.h
@@ -49,7 +49,8 @@ class EdgePllXDefault : public EdgePllXIF
 } ;
 
 
-// tpye of ElementPllXIF_t is ElementPllXIF, see parallel.h
+/*
+// type of ElementPllXIF_t is ElementPllXIF, see parallel.h
 class ElementPllXIF : public MacroGridMoverDefault 
 {
   protected :
@@ -60,6 +61,59 @@ class ElementPllXIF : public MacroGridMoverDefault
     virtual pair < const ElementPllXIF *, int > accessOuterPllX (const pair < const ElementPllXIF *, int > &, int) const = 0 ;
     virtual pair < ElementPllXIF *, int > accessInnerPllX (const pair < ElementPllXIF *, int > &, int) = 0 ;
     virtual pair < const ElementPllXIF *, int > accessInnerPllX (const pair < const ElementPllXIF *, int > &, int) const = 0 ;
+
+    virtual ghostpair_t getGhost () = 0 ;
+    virtual int ghostLevel () const = 0 ;
+    virtual bool ghostLeaf () const = 0 ;
+    virtual void getAttachedElement ( pair < helement* , hbndseg * > & p) = 0 ;
+
+    virtual void writeStaticState (ObjectStream &, int) const = 0 ;
+    virtual void readStaticState (ObjectStream &, int) = 0 ;
+    virtual void writeDynamicState (ObjectStream &, int) const = 0 ;
+    virtual void readDynamicState (ObjectStream &, int) = 0 ;
+
+    virtual void VertexData2os(ObjectStream &, GatherScatterType &, int) = 0;
+    virtual void EdgeData2os  (ObjectStream &, GatherScatterType &, int) = 0 ;
+    virtual void FaceData2os  (ObjectStream &, GatherScatterType &, int) = 0 ;
+    virtual void writeElementData (ObjectStream &, GatherScatterType &) = 0;
+    virtual void writeDynamicState(ObjectStream &, GatherScatterType &) const = 0 ;
+    virtual void readDynamicState (ObjectStream &, GatherScatterType &) = 0 ;
+
+    // pack as ghost, default does nothing but macro elements are pack as
+    // ghosts 
+    virtual void packAsGhost(ObjectStream &,int) const = 0 ;
+
+    // unpack as ghost data and insert ghost cell, default does nothing
+    virtual void insertGhostCell(ObjectStream &,int) = 0 ;
+    
+    virtual int ldbVertexIndex () const = 0 ;
+    virtual int & ldbVertexIndex () = 0 ;
+    virtual bool ldbUpdateGraphVertex (LoadBalancer :: DataBase &) = 0 ;
+    virtual void packAsBnd (int,int,ObjectStream &) const = 0 ;
+    virtual bool erasable () const = 0 ;
+    virtual void getRefinementRequest (ObjectStream &) = 0 ;
+    virtual bool setRefinementRequest (ObjectStream &) = 0 ;
+    virtual bool lockAndTry () = 0 ;
+    virtual bool unlockAndResume (bool) = 0 ;
+} ;
+*/
+
+// type of ElementPllXIF_t is ElementPllXIF, see parallel.h
+class ElementPllXIF : public MacroGridMoverDefault 
+  //public ElementPllXIF
+{
+  protected :
+    typedef pair<helement*, int> ghostpair_t ;
+    virtual ~ElementPllXIF () {}
+  public :
+    virtual pair < ElementPllXIF *, int > accessOuterPllX (const pair < ElementPllXIF *, int > &, int) 
+    { assert( false ); abort(); return pair< ElementPllXIF *, int > ( (ElementPllXIF *) 0, -1); }
+    virtual pair < const ElementPllXIF *, int > accessOuterPllX (const pair < const ElementPllXIF *, int > &, int) const
+    { assert( false ); abort(); return pair< ElementPllXIF *, int > ( (ElementPllXIF *) 0, -1); }
+    virtual pair < ElementPllXIF *, int > accessInnerPllX (const pair < ElementPllXIF *, int > &, int) 
+    { assert( false ); abort(); return pair< ElementPllXIF *, int > ( (ElementPllXIF *) 0, -1); }
+    virtual pair < const ElementPllXIF *, int > accessInnerPllX (const pair < const ElementPllXIF *, int > &, int) const
+    { assert( false ); abort(); return pair< ElementPllXIF *, int > ( (ElementPllXIF *) 0, -1); }
   public :
     virtual ghostpair_t getGhost () 
     { 
@@ -90,39 +144,57 @@ class ElementPllXIF : public MacroGridMoverDefault
       p.second = 0;
     }
 
-    virtual void writeStaticState (ObjectStream &, int) const = 0 ;
-    virtual void readStaticState (ObjectStream &, int) = 0 ;
-    virtual void writeDynamicState (ObjectStream &, int) const = 0 ;
-    virtual void readDynamicState (ObjectStream &, int) = 0 ;
+    virtual void writeStaticState (ObjectStream &, int) const 
+    { assert(false);abort(); }
+    virtual void readStaticState (ObjectStream &, int)
+    { assert(false);abort(); }
+    virtual void writeDynamicState (ObjectStream &, int) const
+    { assert(false);abort(); }
+    virtual void readDynamicState (ObjectStream &, int)
+    { assert(false);abort(); }
 
-    virtual void VertexData2os(ObjectStream &, GatherScatterType &, int) { cout << "ich bin die falsche...\n" << flush; }
-    virtual void EdgeData2os  (ObjectStream &, GatherScatterType &, int) { cout << "ich bin die falsche...1\n" << flush; }
-    virtual void FaceData2os  (ObjectStream &, GatherScatterType &, int) { cout << "ich bin die falsche...2\n" << flush; }
-    virtual void writeElementData (ObjectStream &, GatherScatterType &) { cout << "ich bin die falsche...3\n" << flush; }
-    virtual void writeDynamicState(ObjectStream &, GatherScatterType &) const = 0 ;
-    virtual void readDynamicState (ObjectStream &, GatherScatterType &) = 0 ;
+    virtual void VertexData2os(ObjectStream &, GatherScatterType &, int) 
+    { assert(false);abort(); }
+    virtual void EdgeData2os  (ObjectStream &, GatherScatterType &, int)
+    { assert(false);abort(); }
+    virtual void FaceData2os  (ObjectStream &, GatherScatterType &, int)
+    { assert(false);abort(); }
+    virtual void writeElementData (ObjectStream &, GatherScatterType &)
+    { assert(false);abort(); }
+    virtual void writeDynamicState(ObjectStream &, GatherScatterType &) const
+    { assert(false);abort(); }
+    virtual void readDynamicState (ObjectStream &, GatherScatterType &)
+    { assert(false);abort(); }
 
     // pack as ghost, default does nothing but macro elements are pack as
     // ghosts 
     virtual void packAsGhost(ObjectStream &,int) const {}
 
     // unpack as ghost data and insert ghost cell, default does nothing
-    virtual void insertGhostCell(ObjectStream &,int) {
-    }
+    virtual void insertGhostCell(ObjectStream &,int) {}
     
   public :
-    virtual int ldbVertexIndex () const = 0 ;
-    virtual int & ldbVertexIndex () = 0 ;
-    virtual bool ldbUpdateGraphVertex (LoadBalancer :: DataBase &) = 0 ;
+    virtual int ldbVertexIndex () const
+    { assert(false);abort(); return -1;  }
+    virtual int & ldbVertexIndex ()
+    { assert(false);abort(); return *(new int ());  }
+    virtual bool ldbUpdateGraphVertex (LoadBalancer :: DataBase &)
+    { assert(false);abort(); return false;  }
   public :
-    virtual void packAsBnd (int,int,ObjectStream &) const = 0 ;
-    virtual bool erasable () const = 0 ;
+    virtual void packAsBnd (int,int,ObjectStream &) const
+    { assert(false);abort(); }
+    virtual bool erasable () const
+    { assert(false);abort(); return false;  }
   public :
-    virtual void getRefinementRequest (ObjectStream &) = 0 ;
-    virtual bool setRefinementRequest (ObjectStream &) = 0 ;
+    virtual void getRefinementRequest (ObjectStream &)
+    { assert(false);abort(); }
+    virtual bool setRefinementRequest (ObjectStream &)
+    { assert(false);abort(); return false;  }
   public :
-    virtual bool lockAndTry () = 0 ;
-    virtual bool unlockAndResume (bool) = 0 ;
+    virtual bool lockAndTry ()
+    { assert(false);abort(); return false;  }
+    virtual bool unlockAndResume (bool)
+    { assert(false);abort(); return false;  }
 } ;
 
 class FacePllXIF : public LinkedObjectDefault //, public MacroGridMoverIF
@@ -245,24 +317,12 @@ class Parallel {
         inline const FacePllXIF & accessPllX () const { return *this; }
         inline void detachPllXFromMacro () {}
     } ;
-    class ElementIF {
+    class ElementIF : public ElementPllXIF {
       public :
         virtual ~ElementIF () {}
-        inline virtual ElementPllXIF & accessPllX () throw (AccessPllException) 
-        {
-          assert ((abort (), (cerr << "  FEHLER in " << __FILE__ << " " << __LINE__ << endl))) ;
-          throw AccessPllException () ;
-        }
-        inline virtual const ElementPllXIF & accessPllX () const throw (AccessPllException)
-        {
-          assert ((abort (), (cerr << "  FEHLER in " << __FILE__ << " " << __LINE__ << endl))) ;
-          throw AccessPllException () ;
-        }
-        inline virtual void detachPllXFromMacro () throw (AccessPllException) 
-        {
-          assert ((abort (), (cerr << "  FEHLER in " << __FILE__ << " " << __LINE__ << endl))) ;
-          throw AccessPllException () ;
-        }
+        inline ElementPllXIF & accessPllX () { return *this; }
+        inline const ElementPllXIF & accessPllX () const { return *this; }
+        inline virtual void detachPllXFromMacro () {}
     } ;
 } ;
 #endif
-- 
GitLab