From df4ca9a480eafc69887a7476d3c2edab962264cd Mon Sep 17 00:00:00 2001
From: Simon Praetorius <simon.praetorius@tu-dresden.de>
Date: Sat, 30 Jul 2011 15:48:32 +0000
Subject: [PATCH] some methods are set to const

---
 AMDiS/src/BoundaryManager.h       | 2 +-
 AMDiS/src/ElInfo.h                | 2 +-
 AMDiS/src/ElInfo1d.cc             | 2 +-
 AMDiS/src/ElInfo1d.h              | 2 +-
 AMDiS/src/ElInfo2d.cc             | 4 ++--
 AMDiS/src/ElInfo2d.h              | 2 +-
 AMDiS/src/ElInfo3d.cc             | 2 +-
 AMDiS/src/ElInfo3d.h              | 2 +-
 AMDiS/src/Initfile.cc             | 2 +-
 AMDiS/src/reinit/HL_SignedDist.cc | 9 ++++++---
 10 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/AMDiS/src/BoundaryManager.h b/AMDiS/src/BoundaryManager.h
index 85fffc2a..a9231436 100644
--- a/AMDiS/src/BoundaryManager.h
+++ b/AMDiS/src/BoundaryManager.h
@@ -57,7 +57,7 @@ namespace AMDiS {
 
       BoundaryType type = localBC->getBoundaryType();
       TEST_EXIT(localBCs[type] == NULL)
-	("There is already a condition for this type.\n");
+	("There is already a condition for this type %d.\n",type);
       localBCs[type] = localBC;
 
       std::vector<BoundaryCondition*>& boundMap = globalBoundaryMap[type];
diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h
index f2a44cbe..26fd4657 100644
--- a/AMDiS/src/ElInfo.h
+++ b/AMDiS/src/ElInfo.h
@@ -417,7 +417,7 @@ namespace AMDiS {
      * transformation to the reference element.
      * pure virtual => must be overriden in sub-class.
      */
-    virtual double getNormal(int side, WorldVector<double> &normal) = 0;
+    virtual double getNormal(int side, WorldVector<double> &normal) const = 0;
 
 
     /** \brief
diff --git a/AMDiS/src/ElInfo1d.cc b/AMDiS/src/ElInfo1d.cc
index a7cb7d9c..c174e487 100644
--- a/AMDiS/src/ElInfo1d.cc
+++ b/AMDiS/src/ElInfo1d.cc
@@ -186,7 +186,7 @@ namespace AMDiS {
   /*  coord; return the absulute value of the determinant from the           */
   /*  transformation to the reference element                                 */
   /****************************************************************************/
-  double ElInfo1d::getNormal(int side, WorldVector<double> &normal)
+  double ElInfo1d::getNormal(int side, WorldVector<double> &normal) const
   {
     normal = coord[side] - coord[(side + 1) % 2];
     double det = norm(&normal);
diff --git a/AMDiS/src/ElInfo1d.h b/AMDiS/src/ElInfo1d.h
index 7bfefb6e..dc2ba3e5 100644
--- a/AMDiS/src/ElInfo1d.h
+++ b/AMDiS/src/ElInfo1d.h
@@ -53,7 +53,7 @@ namespace AMDiS {
     double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
 
     /// 1-dimensional realisation of ElInfo's getNormal method.
-    double getNormal(int side, WorldVector<double> &normal);
+    double getNormal(int side, WorldVector<double> &normal) const;
 
     /// 1-dimensional realisation of ElInfo's getElementNormal method.
     double getElementNormal( WorldVector<double> &normal) const;
diff --git a/AMDiS/src/ElInfo2d.cc b/AMDiS/src/ElInfo2d.cc
index 1988a540..56dcc741 100644
--- a/AMDiS/src/ElInfo2d.cc
+++ b/AMDiS/src/ElInfo2d.cc
@@ -711,7 +711,7 @@ namespace AMDiS {
   }
 
 
-  double ElInfo2d::getNormal(int side, WorldVector<double> &normal)
+  double ElInfo2d::getNormal(int side, WorldVector<double> &normal) const
   {
     FUNCNAME("ElInfo::getNormal()");
 
@@ -722,7 +722,7 @@ namespace AMDiS {
       normal[0] = coord[i1][1] - coord[i0][1];
       normal[1] = coord[i0][0] - coord[i1][0];
     } else { // dow == 3
-      WorldVector<double> e0, elementNormal;
+      WorldVector<double> e0, e1, e2, elementNormal;
 
       e0 = coord[i1]; 
       e0 -= coord[i0];
diff --git a/AMDiS/src/ElInfo2d.h b/AMDiS/src/ElInfo2d.h
index 2187e6d0..8a373875 100644
--- a/AMDiS/src/ElInfo2d.h
+++ b/AMDiS/src/ElInfo2d.h
@@ -54,7 +54,7 @@ namespace AMDiS {
     double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
 
     /// 2-dimensional realisation of ElInfo's getNormal method.
-    double getNormal(int side, WorldVector<double> &normal);
+    double getNormal(int side, WorldVector<double> &normal) const;
 
     /// 2-dimensional realisation of ElInfo's getElementNormal method.
     double getElementNormal(WorldVector<double> &normal) const;
diff --git a/AMDiS/src/ElInfo3d.cc b/AMDiS/src/ElInfo3d.cc
index 954ce92c..4be60559 100644
--- a/AMDiS/src/ElInfo3d.cc
+++ b/AMDiS/src/ElInfo3d.cc
@@ -451,7 +451,7 @@ namespace AMDiS {
   }
 
 
-  double ElInfo3d::getNormal(int face, WorldVector<double> &normal)
+  double ElInfo3d::getNormal(int face, WorldVector<double> &normal) const
   {
     FUNCNAME("ElInfo3d::getNormal()");
 
diff --git a/AMDiS/src/ElInfo3d.h b/AMDiS/src/ElInfo3d.h
index 1e061d88..38327ca1 100644
--- a/AMDiS/src/ElInfo3d.h
+++ b/AMDiS/src/ElInfo3d.h
@@ -66,7 +66,7 @@ namespace AMDiS {
     double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
 
     /// 3-dimensional realisation of ElInfo's getNormal method.
-    double getNormal(int side, WorldVector<double> &normal);
+    double getNormal(int side, WorldVector<double> &normal) const;
 
     /// update ElInfo after refinement (of some neighbours). Only in 3d!
     void update();
diff --git a/AMDiS/src/Initfile.cc b/AMDiS/src/Initfile.cc
index f36c36d6..ef3e4a81 100644
--- a/AMDiS/src/Initfile.cc
+++ b/AMDiS/src/Initfile.cc
@@ -57,7 +57,7 @@ namespace AMDiS {
       std::ifstream inputFile;
       inputFile.open(fn.c_str(), std::ios::in);
       if (!inputFile.is_open())
-	      throw runtime_error("init-file cannot be opened for reading");
+	      throw runtime_error("init-file '" + fn + "' cannot be opened for reading");
 
       fn_include_list.insert(fn);
       read(inputFile);
diff --git a/AMDiS/src/reinit/HL_SignedDist.cc b/AMDiS/src/reinit/HL_SignedDist.cc
index ce032b5c..01574eb1 100644
--- a/AMDiS/src/reinit/HL_SignedDist.cc
+++ b/AMDiS/src/reinit/HL_SignedDist.cc
@@ -120,8 +120,9 @@ void HL_SignedDist::calcVelocityExt(AdaptInfo *adaptInfo_,
   TEST_EXIT(velExt)("velExt not defined !\n");
   TEST_EXIT(vel_DOF_)("velocity vector vel_DOF_ not defined !\n");
 
-  if (calcSDFct)
+  if (calcSDFct) {
     TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n");
+  }
 
   DOFVector<double> *newVel_DOF_ = 
     new DOFVector<double>(vel_DOF_->getFeSpace(), "vel_DOF_");
@@ -194,8 +195,9 @@ void HL_SignedDist::calcVelocityExt(AdaptInfo *adaptInfo_,
 
   int nVelDOFs = vel_DOF_.size();
 
-  if (calcSDFct)
+  if (calcSDFct) {
     TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n");
+  }
 
   std::vector<DOFVector<double> *> newVel_DOF_(nVelDOFs);
   for (int nV = 0; nV < nVelDOFs; ++nV) {    
@@ -275,8 +277,9 @@ void HL_SignedDist::calcVelocityExtFromVelocityField(AdaptInfo *adaptInfo_,
   TEST_EXIT(velExt)("velExt not defined !\n");
   TEST_EXIT(elFct == NULL)("not implemented yet for elFct != NULL !\n");
 
-  if (calcSDFct)
+  if (calcSDFct) {
     TEST_EXIT(lS_DOF_)("illegal level set function lS_DOF_ !\n");
+  }
 
   ((VelocityExtFromVelocityField *)(velExt))->setVelocityField(velField_, lS_DOF_, vel_DOF_);
 
-- 
GitLab