From e49569ddd2086205ce22f5c10b2c18a2baafbdf2 Mon Sep 17 00:00:00 2001
From: Markus Wolff <markus.wolff@twt-gmbh.de>
Date: Thu, 19 Sep 2013 09:04:06 +0000
Subject: [PATCH] Slight change in the iteration condition of the
 calculateEigenValues functions

   - The relative criterion for convergence of the iterative algorithm
     can no be given as function argumenti

   - approved by Bernd



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@11496 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/common/eigenvalues.hh      | 10 ++++++----
 dumux/decoupled/2p/celldata2p.hh |  8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/dumux/common/eigenvalues.hh b/dumux/common/eigenvalues.hh
index e3bcd75019..91733bf6ae 100644
--- a/dumux/common/eigenvalues.hh
+++ b/dumux/common/eigenvalues.hh
@@ -61,9 +61,10 @@ double calcOffDiagonalNorm(Matrix& matrix)
 /*
  * \param eigVel Vector for storing the eigenvalues
  * \param matrix n x n matrices for which eigenvalues have to be calculated
+ * \param relativeTolerance tolerance for the relative convergence criterion (default: 0.01)
  */
 template<int dim, class EVVectorType, class MatrixType>
-bool calculateEigenValues(EVVectorType &eigVel, MatrixType& matrix)
+bool calculateEigenValues(EVVectorType &eigVel, MatrixType& matrix, double relativeTolerance = 0.01)
 {
     if (dim == 2)
     {
@@ -92,7 +93,7 @@ bool calculateEigenValues(EVVectorType &eigVel, MatrixType& matrix)
         MatrixType rotationMatrix(0.0);
         MatrixType evMatrix(matrix);
 
-        while ((iter < maxIter && offDiagonalNorm > 0.01 * matrixNorm) || iter < 1)
+        while (iter < maxIter && offDiagonalNorm > relativeTolerance * matrixNorm)
         {
             for (int i = 0; i < dim - 1; i++)
             {
@@ -143,9 +144,10 @@ bool calculateEigenValues(EVVectorType &eigVel, MatrixType& matrix)
  * \param eigVel Vector for storing the eigenvalues
  * \param eigVec n x n for storing the eigenvectors
  * \param matrix n x n matrices for which eigenvalues have to be calculated
+ * \param relativeTolerance tolerance for the relative convergence criterion (default: 0.01)
  */
 template<int dim, class EVVectorType, class MatrixType>
-bool calculateEigenValues(EVVectorType &eigVel, MatrixType& eigVec, MatrixType& matrix)
+bool calculateEigenValues(EVVectorType &eigVel, MatrixType& eigVec, MatrixType& matrix, double relativeTolerance = 0.01)
 {
         int maxIter = 100;
         int iter = 0;
@@ -156,7 +158,7 @@ bool calculateEigenValues(EVVectorType &eigVel, MatrixType& eigVec, MatrixType&
         MatrixType evecMatrix(matrix);
         identityMatrix<dim>(evecMatrix);
 
-        while ((iter < maxIter && offDiagonalNorm > 0.01 * matrixNorm) || iter < 1)
+        while (iter < maxIter && offDiagonalNorm > relativeTolerance * matrixNorm)
         {
             for (int i = 0; i < dim - 1; i++)
             {
diff --git a/dumux/decoupled/2p/celldata2p.hh b/dumux/decoupled/2p/celldata2p.hh
index 969639d93d..0465e9a75b 100644
--- a/dumux/decoupled/2p/celldata2p.hh
+++ b/dumux/decoupled/2p/celldata2p.hh
@@ -209,7 +209,7 @@ public:
     /*!\brief Sets the cell phase potential
      *
      * \param phaseIdx Index of a fluid phase
-     * \param press Phase potential which is stored
+     * \param pot Phase potential which is stored
      */
     void setPotential(int phaseIdx, Scalar pot)
     {
@@ -502,11 +502,11 @@ public:
     /*!\brief Sets the cell phase potential
      *
      * \param phaseIdx Index of a fluid phase
-     * \param press Phase potential which is stored
+     * \param pot Phase potential which is stored
      */
-    void setPotential(int phaseIdx, Scalar press)
+    void setPotential(int phaseIdx, Scalar pot)
     {
-        potential_[phaseIdx] = press;
+        potential_[phaseIdx] = pot;
     }
 
     //! \cond \private
-- 
GitLab