Commit e49569dd authored by Markus Wolff's avatar Markus Wolff
Browse files

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
parent 056f7ba8
......@@ -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++)
{
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment