From 427f1f7ad14e51bfd4ee38e909504cd9c6befa97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Kl=C3=B6fkorn?= <robertk@dune-project.org>
Date: Fri, 18 Mar 2005 16:00:13 +0000
Subject: [PATCH] Added new functions for restiction and prolongation and dof
 compress process.

[[Imported from SVN: r1697]]
---
 fem/common/dofmapperinterface.hh | 44 +++++++++++++++++++++++++++++---
 1 file changed, 41 insertions(+), 3 deletions(-)

diff --git a/fem/common/dofmapperinterface.hh b/fem/common/dofmapperinterface.hh
index 7ef88eccc..5e0dc878b 100644
--- a/fem/common/dofmapperinterface.hh
+++ b/fem/common/dofmapperinterface.hh
@@ -34,6 +34,18 @@ namespace Dune {
     //! return max number of local dofs per entity
     virtual int numberOfDofs () const =0;
 
+    //! returns true if index is new ( for dof compress )
+    virtual bool indexNew (int num) const = 0;
+
+    //! return old index in dof array of given index ( for dof compress )
+    virtual int oldIndex (int num) const = 0;
+
+    //! return new index in dof array
+    virtual int newIndex (int num) const = 0;
+
+    /*! return estimate for size that is addtional needed
+        for restriction of data */
+    virtual int additionalSizeEstimate() const = 0;
   };
 
   //***********************************************************************
@@ -62,9 +74,7 @@ namespace Dune {
     //! default implementation if not overlaoded
     virtual int newSize() const
     {
-      // overload this method in derived class
-      assert(false);
-      return -1;
+      return asImp().size();
     }
 
     //! default implementation if not overlaoded
@@ -82,6 +92,34 @@ namespace Dune {
       return -1;
     }
 
+    //! returns true if index is new ( for dof compress )
+    virtual bool indexNew (int num) const
+    {
+      assert(false);
+      return false;
+    }
+
+    //! return old index in dof array of given index ( for dof compress )
+    virtual int oldIndex (int num) const
+    {
+      assert(false);
+      return -1;
+    }
+
+    // return new index in dof array
+    virtual int newIndex (int num) const
+    {
+      assert(false);
+      return -1;
+    }
+
+    // return estimate for size additional need for restriction of data
+    virtual int additionalSizeEstimate() const
+    {
+      assert(false);
+      return -1;
+    }
+
   private:
     //! Barton-Nackman trick
     DofMapperImp &asImp()  { return static_cast<DofMapperImp &>(*this); };
-- 
GitLab