From b08b29bd3c7ad7b907def7755e52ee591962f491 Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Mon, 30 Apr 2012 18:15:26 +0100 Subject: [PATCH] LduMatrix: Further integration with lduMatrix Replaced lduMatrix::solverPerformance with SolverPerformance<scalar> --- src/OpenFOAM/Make/files | 2 +- .../matrices/LduMatrix/LduMatrix/LduMatrix.C | 1 - .../matrices/LduMatrix/LduMatrix/LduMatrix.H | 19 -- .../LduMatrix/LduMatrix/LduMatrixSolver.C | 2 +- .../LduMatrix/LduMatrix/SolverPerformance.C | 10 +- .../LduMatrix/LduMatrix/SolverPerformance.H | 40 +++- .../LduMatrix/LduMatrix/solverPerformance.C | 39 ++++ .../LduMatrix/LduMatrix/solverPerformance.H | 51 +++++ .../LduMatrix/Solvers/PBiCCCG/PBiCCCG.C | 4 +- .../LduMatrix/Solvers/PBiCICG/PBiCICG.C | 10 +- .../matrices/LduMatrix/Solvers/PCICG/PCICG.C | 10 +- .../Solvers/SmoothSolver/SmoothSolver.C | 4 +- .../matrices/lduMatrix/lduMatrix/lduMatrix.C | 3 - .../matrices/lduMatrix/lduMatrix/lduMatrix.H | 167 +-------------- .../lduMatrix/lduMatrix/lduMatrixSolver.C | 6 +- .../lduMatrix/lduMatrix/lduMatrixTests.C | 190 ------------------ .../lduMatrix/solvers/GAMG/GAMGSolver.H | 2 +- .../lduMatrix/solvers/GAMG/GAMGSolverSolve.C | 10 +- .../matrices/lduMatrix/solvers/PBiCG/PBiCG.C | 6 +- .../matrices/lduMatrix/solvers/PBiCG/PBiCG.H | 2 +- .../matrices/lduMatrix/solvers/PCG/PCG.C | 6 +- .../matrices/lduMatrix/solvers/PCG/PCG.H | 2 +- .../solvers/diagonalSolver/diagonalSolver.C | 4 +- .../solvers/diagonalSolver/diagonalSolver.H | 2 +- .../solvers/smoothSolver/smoothSolver.C | 4 +- .../solvers/smoothSolver/smoothSolver.H | 2 +- src/OpenFOAM/meshes/data/data.C | 8 +- src/OpenFOAM/meshes/data/data.H | 6 +- .../pimpleControl/pimpleControl.C | 2 +- .../simpleControl/simpleControl.C | 2 +- .../fvMatrices/fvMatrix/fvMatrix.C | 12 +- .../fvMatrices/fvMatrix/fvMatrix.H | 20 +- .../fvMatrices/fvMatrix/fvMatrixSolve.C | 20 +- .../fvScalarMatrix/fvScalarMatrix.C | 12 +- .../fvScalarMatrix/fvScalarMatrix.H | 4 +- 35 files changed, 216 insertions(+), 468 deletions(-) create mode 100644 src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.C create mode 100644 src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.H delete mode 100644 src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 3c054e2bfda..614a7cdae59 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -240,7 +240,6 @@ lduMatrix = matrices/lduMatrix $(lduMatrix)/lduMatrix/lduMatrix.C $(lduMatrix)/lduMatrix/lduMatrixOperations.C $(lduMatrix)/lduMatrix/lduMatrixATmul.C -$(lduMatrix)/lduMatrix/lduMatrixTests.C $(lduMatrix)/lduMatrix/lduMatrixUpdateMatrixInterfaces.C $(lduMatrix)/lduMatrix/lduMatrixSolver.C $(lduMatrix)/lduMatrix/lduMatrixSmoother.C @@ -316,6 +315,7 @@ meshes/lduMesh/lduMesh.C LduMatrix = matrices/LduMatrix $(LduMatrix)/LduMatrix/lduMatrices.C +$(LduMatrix)/LduMatrix/solverPerformance.C $(LduMatrix)/LduMatrix/LduInterfaceField/LduInterfaceFields.C $(LduMatrix)/Smoothers/lduSmoothers.C $(LduMatrix)/Preconditioners/lduPreconditioners.C diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C index 00782ac75b1..fb131308b37 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C @@ -382,7 +382,6 @@ Foam::Ostream& Foam::operator<< #include "LduMatrixOperations.C" #include "LduMatrixATmul.C" #include "LduMatrixUpdateMatrixInterfaces.C" -#include "SolverPerformance.C" #include "LduMatrixPreconditioner.C" #include "LduMatrixSmoother.C" #include "LduMatrixSolver.C" diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H index 507fd40e94f..c2414b0f8bc 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.H @@ -460,15 +460,6 @@ public: // Declare name of the class and its debug switch ClassName("LduMatrix"); - //- Large Type for the use in solvers - static const scalar great_; - - //- Small Type for the use in solvers - static const scalar small_; - - //- Very small Type for the use in solvers - static const scalar vsmall_; - // Constructors @@ -682,16 +673,6 @@ typedef Foam::LduMatrix<Type, DType, LUType> \ defineNamedTemplateTypeNameAndDebug(ldu##Type##DType##LUType##Matrix, 0); \ \ \ -template<> \ -const scalar ldu##Type##DType##LUType##Matrix::great_(1e15); \ - \ -template<> \ -const scalar ldu##Type##DType##LUType##Matrix::small_(1e-15); \ - \ -template<> \ -const scalar ldu##Type##DType##LUType##Matrix::vsmall_(VSMALL); \ - \ - \ typedef LduMatrix<Type, DType, LUType>::smoother \ ldu##Type##DType##LUType##Smoother; \ \ diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C index c31af469f14..50831a0ec94 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixSolver.C @@ -179,7 +179,7 @@ Type Foam::LduMatrix<Type, DType, LUType>::solver::normFactor return stabilise ( gSum(cmptMag(Apsi - tmpField) + cmptMag(matrix_.source() - tmpField)), - matrix_.small_ + SolverPerformance<Type>::small_ ); // At convergence this simpler method is equivalent to the above diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C index a50a6e537ff..62ce85abb7f 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "LduMatrix.H" +#include "SolverPerformance.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -36,7 +36,7 @@ bool Foam::SolverPerformance<Type>::checkSingularity for(direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++) { singular_[cmpt] = - component(wApA, cmpt) < LduMatrix<scalar, scalar, scalar>::vsmall_; + component(wApA, cmpt) < vsmall_; } return singular(); @@ -56,13 +56,13 @@ bool Foam::SolverPerformance<Type>::singular() const template<class Type> -bool Foam::SolverPerformance<Type>::converged +bool Foam::SolverPerformance<Type>::checkConvergence ( const Type& Tolerance, const Type& RelTolerance ) { - if (LduMatrix<scalar, scalar, scalar>::debug >= 2) + if (debug >= 2) { Info<< solverName_ << ": Iteration " << noIterations_ @@ -75,7 +75,7 @@ bool Foam::SolverPerformance<Type>::converged finalResidual_ < Tolerance || ( RelTolerance - > LduMatrix<scalar, scalar, scalar>::small_*pTraits<Type>::one + > small_*pTraits<Type>::one && finalResidual_ < cmptMultiply(RelTolerance, initialResidual_) ) ) diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H index fdfd269e17f..d39ecb10a80 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,6 +93,21 @@ class SolverPerformance public: + // Static data + + // Declare name of the class and its debug switch + ClassName("SolverPerformance"); + + //- Large Type for the use in solvers + static const scalar great_; + + //- Small Type for the use in solvers + static const scalar small_; + + //- Very small Type for the use in solvers + static const scalar vsmall_; + + // Constructors SolverPerformance() @@ -197,7 +212,7 @@ public: bool singular() const; //- Check, store and return convergence - bool converged + bool checkConvergence ( const Type& tolerance, const Type& relTolerance @@ -245,10 +260,29 @@ public: } // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSolverPerformance(Type) \ + \ +typedef Foam::SolverPerformance<Type> \ + solverPerformance##Type; \ + \ +defineNamedTemplateTypeNameAndDebug(solverPerformance##Type, 0); \ + \ +template<> \ +const scalar solverPerformance##Type::great_(1e20); \ + \ +template<> \ +const scalar solverPerformance##Type::small_(1e-20); \ + \ +template<> \ +const scalar solverPerformance##Type::vsmall_(VSMALL); \ + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -//# include "SolverPerformance.C" +# include "SolverPerformance.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.C new file mode 100644 index 00000000000..5bac12c784c --- /dev/null +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.C @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "solverPerformance.H" +#include "fieldTypes.H" + +namespace Foam +{ + makeSolverPerformance(scalar); + makeSolverPerformance(vector); + makeSolverPerformance(sphericalTensor); + makeSolverPerformance(symmTensor); + makeSolverPerformance(tensor); +}; + + +// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.H new file mode 100644 index 00000000000..139ab128b1c --- /dev/null +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/solverPerformance.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Typedef + Foam::solverPerformance + +Description + SolverPerformance instantiated for a scalar + +SourceFiles + solverPerformance.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solverPerformance_H +#define solverPerformance_H + +#include "SolverPerformance.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef SolverPerformance<scalar> solverPerformance; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCCCG/PBiCCCG.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCCCG/PBiCCCG.C index ab0c1f4fc95..7ee6da05dcf 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCCCG/PBiCCCG.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCCCG/PBiCCCG.C @@ -104,7 +104,7 @@ Foam::PBiCCCG<Type, DType, LUType>::solve solverPerf.finalResidual() = solverPerf.initialResidual(); // --- Check convergence, solve if not converged - if (!solverPerf.converged(this->tolerance_, this->relTol_)) + if (!solverPerf.checkConvergence(this->tolerance_, this->relTol_)) { // --- Select and construct the preconditioner autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> @@ -183,7 +183,7 @@ Foam::PBiCCCG<Type, DType, LUType>::solve } while ( solverPerf.nIterations()++ < this->maxIter_ - && !(solverPerf.converged(this->tolerance_, this->relTol_)) + && !(solverPerf.checkConvergence(this->tolerance_, this->relTol_)) ); } diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCICG/PBiCICG.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCICG/PBiCICG.C index c92499c9fc2..260daedbf0e 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCICG/PBiCICG.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/PBiCICG/PBiCICG.C @@ -75,7 +75,7 @@ Foam::PBiCICG<Type, DType, LUType>::solve(Field<Type>& psi) const Field<Type> wT(nCells); Type* __restrict__ wTPtr = wT.begin(); - Type wArT = this->matrix_.great_*pTraits<Type>::one; + Type wArT = solverPerf.great_*pTraits<Type>::one; Type wArTold = wArT; // --- Calculate A.psi and T.psi @@ -101,7 +101,7 @@ Foam::PBiCICG<Type, DType, LUType>::solve(Field<Type>& psi) const solverPerf.finalResidual() = solverPerf.initialResidual(); // --- Check convergence, solve if not converged - if (!solverPerf.converged(this->tolerance_, this->relTol_)) + if (!solverPerf.checkConvergence(this->tolerance_, this->relTol_)) { // --- Select and construct the preconditioner autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> @@ -137,7 +137,7 @@ Foam::PBiCICG<Type, DType, LUType>::solve(Field<Type>& psi) const Type beta = cmptDivide ( wArT, - stabilise(wArTold, this->matrix_.vsmall_) + stabilise(wArTold, solverPerf.vsmall_) ); for (register label cell=0; cell<nCells; cell++) @@ -172,7 +172,7 @@ Foam::PBiCICG<Type, DType, LUType>::solve(Field<Type>& psi) const Type alpha = cmptDivide ( wArT, - stabilise(wApT, this->matrix_.vsmall_) + stabilise(wApT, solverPerf.vsmall_) ); for (register label cell=0; cell<nCells; cell++) @@ -188,7 +188,7 @@ Foam::PBiCICG<Type, DType, LUType>::solve(Field<Type>& psi) const } while ( solverPerf.nIterations()++ < this->maxIter_ - && !(solverPerf.converged(this->tolerance_, this->relTol_)) + && !(solverPerf.checkConvergence(this->tolerance_, this->relTol_)) ); } diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/PCICG/PCICG.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/PCICG/PCICG.C index 83abd1f2499..cc8f1d1c72b 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/PCICG/PCICG.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/PCICG/PCICG.C @@ -69,7 +69,7 @@ Foam::PCICG<Type, DType, LUType>::solve(Field<Type>& psi) const Field<Type> wA(nCells); Type* __restrict__ wAPtr = wA.begin(); - Type wArA = this->matrix_.great_*pTraits<Type>::one; + Type wArA = solverPerf.great_*pTraits<Type>::one; Type wArAold = wArA; // --- Calculate A.psi @@ -92,7 +92,7 @@ Foam::PCICG<Type, DType, LUType>::solve(Field<Type>& psi) const solverPerf.finalResidual() = solverPerf.initialResidual(); // --- Check convergence, solve if not converged - if (!solverPerf.converged(this->tolerance_, this->relTol_)) + if (!solverPerf.checkConvergence(this->tolerance_, this->relTol_)) { // --- Select and construct the preconditioner autoPtr<typename LduMatrix<Type, DType, LUType>::preconditioner> @@ -126,7 +126,7 @@ Foam::PCICG<Type, DType, LUType>::solve(Field<Type>& psi) const Type beta = cmptDivide ( wArA, - stabilise(wArAold, this->matrix_.vsmall_) + stabilise(wArAold, solverPerf.vsmall_) ); for (register label cell=0; cell<nCells; cell++) @@ -160,7 +160,7 @@ Foam::PCICG<Type, DType, LUType>::solve(Field<Type>& psi) const Type alpha = cmptDivide ( wArA, - stabilise(wApA, this->matrix_.vsmall_) + stabilise(wApA, solverPerf.vsmall_) ); for (register label cell=0; cell<nCells; cell++) @@ -175,7 +175,7 @@ Foam::PCICG<Type, DType, LUType>::solve(Field<Type>& psi) const } while ( solverPerf.nIterations()++ < this->maxIter_ - && !(solverPerf.converged(this->tolerance_, this->relTol_)) + && !(solverPerf.checkConvergence(this->tolerance_, this->relTol_)) ); } diff --git a/src/OpenFOAM/matrices/LduMatrix/Solvers/SmoothSolver/SmoothSolver.C b/src/OpenFOAM/matrices/LduMatrix/Solvers/SmoothSolver/SmoothSolver.C index 9cfff0d1a32..9cf5c81223b 100644 --- a/src/OpenFOAM/matrices/LduMatrix/Solvers/SmoothSolver/SmoothSolver.C +++ b/src/OpenFOAM/matrices/LduMatrix/Solvers/SmoothSolver/SmoothSolver.C @@ -113,7 +113,7 @@ Foam::SmoothSolver<Type, DType, LUType>::solve(Field<Type>& psi) const // Check convergence, solve if not converged - if (!solverPerf.converged(this->tolerance_, this->relTol_)) + if (!solverPerf.checkConvergence(this->tolerance_, this->relTol_)) { autoPtr<typename LduMatrix<Type, DType, LUType>::smoother> smootherPtr = LduMatrix<Type, DType, LUType>::smoother::New @@ -141,7 +141,7 @@ Foam::SmoothSolver<Type, DType, LUType>::solve(Field<Type>& psi) const } while ( (solverPerf.nIterations() += nSweeps_) < this->maxIter_ - && !(solverPerf.converged(this->tolerance_, this->relTol_)) + && !(solverPerf.checkConvergence(this->tolerance_, this->relTol_)) ); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C index 6fb1b68d0ac..70c0c9c5d75 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C @@ -30,9 +30,6 @@ License defineTypeNameAndDebug(Foam::lduMatrix, 1); -const Foam::scalar Foam::lduMatrix::great_ = 1.0e+20; -const Foam::scalar Foam::lduMatrix::small_ = 1.0e-20; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H index ae7438b937b..ec5d7a89d5d 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H @@ -57,6 +57,7 @@ SourceFiles #include "typeInfo.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" +#include "solverPerformance.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -86,166 +87,6 @@ class lduMatrix public: - //- Class returned by the solver, containing performance statistics - class solverPerformance - { - word solverName_; - word fieldName_; - scalar initialResidual_; - scalar finalResidual_; - label noIterations_; - bool converged_; - bool singular_; - - - public: - - // Constructors - - //- Construct null - solverPerformance() - : - initialResidual_(0), - finalResidual_(0), - noIterations_(0), - converged_(false), - singular_(false) - {} - - //- Construct from components - solverPerformance - ( - const word& solverName, - const word& fieldName, - const scalar iRes = 0, - const scalar fRes = 0, - const label nIter = 0, - const bool converged = false, - const bool singular = false - ) - : - solverName_(solverName), - fieldName_(fieldName), - initialResidual_(iRes), - finalResidual_(fRes), - noIterations_(nIter), - converged_(converged), - singular_(singular) - {} - - //- Construct from Istream - solverPerformance(Istream&); - - - // Member functions - - //- Return solver name - const word& solverName() const - { - return solverName_; - } - - //- Return solver name - word& solverName() - { - return solverName_; - } - - - //- Return field name - const word& fieldName() const - { - return fieldName_; - } - - - //- Return initial residual - scalar initialResidual() const - { - return initialResidual_; - } - - //- Return initial residual - scalar& initialResidual() - { - return initialResidual_; - } - - - //- Return final residual - scalar finalResidual() const - { - return finalResidual_; - } - - //- Return final residual - scalar& finalResidual() - { - return finalResidual_; - } - - - //- Return number of iterations - label nIterations() const - { - return noIterations_; - } - - //- Return number of iterations - label& nIterations() - { - return noIterations_; - } - - - //- Has the solver converged? - bool converged() const - { - return converged_; - } - - //- Is the matrix singular? - bool singular() const - { - return singular_; - } - - //- Check, store and return convergence - bool checkConvergence - ( - const scalar tolerance, - const scalar relTolerance - ); - - //- Singularity test - bool checkSingularity(const scalar residual); - - //- Print summary of solver performance - void print() const; - - - // Member Operators - - bool operator!=(const solverPerformance&) const; - - - // Friend functions - - //- Return the element-wise maximum of two solverPerformances - friend solverPerformance max - ( - const solverPerformance&, - const solverPerformance& - ); - - - // Ostream Operator - - friend Istream& operator>>(Istream&, solverPerformance&); - friend Ostream& operator<<(Ostream&, const solverPerformance&); - }; - - //- Abstract base-class for lduMatrix solvers class solver { @@ -670,12 +511,6 @@ public: // Declare name of the class and its debug switch ClassName("lduMatrix"); - //- Large scalar for the use in solvers - static const scalar great_; - - //- Small scalar for the use in solvers - static const scalar small_; - // Constructors diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C index 0381db1b89f..b7b4b4e1bba 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C @@ -188,10 +188,12 @@ Foam::scalar Foam::lduMatrix::solver::normFactor matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_); tmpField *= gAverage(psi); - return gSum(mag(Apsi - tmpField) + mag(source - tmpField)) + matrix_.small_; + return + gSum(mag(Apsi - tmpField) + mag(source - tmpField)) + + solverPerformance::small_; // At convergence this simpler method is equivalent to the above - // return 2*gSumMag(source) + matrix_.small_; + // return 2*gSumMag(source) + solverPerformance::small_; } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C deleted file mode 100644 index e9294d6a227..00000000000 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C +++ /dev/null @@ -1,190 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Description - Convergence and singularity tests for solvers. - -\*---------------------------------------------------------------------------*/ - -#include "lduMatrix.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::lduMatrix::solverPerformance::solverPerformance(Istream& is) -{ - is >> *this; -} - - -bool Foam::lduMatrix::solverPerformance::checkConvergence -( - const scalar Tolerance, - const scalar RelTolerance -) -{ - if (debug >= 2) - { - Info<< solverName_ - << ": Iteration " << noIterations_ - << " residual = " << finalResidual_ - << endl; - } - - if - ( - finalResidual_ < Tolerance - || ( - RelTolerance > SMALL - && finalResidual_ <= RelTolerance*initialResidual_ - ) - // || (solverName == "symSolve" && iter == 0) - ) - { - converged_ = true; - } - else - { - converged_ = false; - } - - return converged_; -} - - -bool Foam::lduMatrix::solverPerformance::checkSingularity -( - const scalar residual -) -{ - if (residual > VSMALL) - { - singular_ = false; - } - else - { - singular_ = true; - } - - return singular_; -} - - -void Foam::lduMatrix::solverPerformance::print() const -{ - if (debug) - { - Info<< solverName_ << ": Solving for " << fieldName_; - - if (singular()) - { - Info<< ": solution singularity" << endl; - } - else - { - Info<< ", Initial residual = " << initialResidual_ - << ", Final residual = " << finalResidual_ - << ", No Iterations " << noIterations_ - << endl; - } - } -} - - -bool Foam::lduMatrix::solverPerformance::operator!= -( - const lduMatrix::solverPerformance& sp -) const -{ - return - ( - solverName() != sp.solverName() - || fieldName() != sp.fieldName() - || initialResidual() != sp.initialResidual() - || finalResidual() != sp.finalResidual() - || nIterations() != sp.nIterations() - || converged() != sp.converged() - || singular() != sp.singular() - ); -} - - -Foam::lduMatrix::solverPerformance Foam::max -( - const lduMatrix::solverPerformance& sp1, - const lduMatrix::solverPerformance& sp2 -) -{ - return lduMatrix::solverPerformance - ( - sp1.solverName(), - sp1.fieldName_, - max(sp1.initialResidual(), sp2.initialResidual()), - max(sp1.finalResidual(), sp2.finalResidual()), - max(sp1.nIterations(), sp2.nIterations()), - sp1.converged() && sp2.converged(), - sp1.singular() || sp2.singular() - ); -} - - -Foam::Istream& Foam::operator>> -( - Istream& is, - Foam::lduMatrix::solverPerformance& sp -) -{ - is.readBeginList("lduMatrix::solverPerformance"); - is >> sp.solverName_ - >> sp.fieldName_ - >> sp.initialResidual_ - >> sp.finalResidual_ - >> sp.noIterations_ - >> sp.converged_ - >> sp.singular_; - is.readEndList("lduMatrix::solverPerformance"); - - return is; -} - - -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const Foam::lduMatrix::solverPerformance& sp -) -{ - os << token::BEGIN_LIST - << sp.solverName_ << token::SPACE - << sp.fieldName_ << token::SPACE - << sp.initialResidual_ << token::SPACE - << sp.finalResidual_ << token::SPACE - << sp.noIterations_ << token::SPACE - << sp.converged_ << token::SPACE - << sp.singular_ << token::SPACE - << token::END_LIST; - - return os; -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.H index 27094885e6f..78278a6db20 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.H @@ -229,7 +229,7 @@ public: // Member Functions //- Solve - virtual lduMatrix::solverPerformance solve + virtual solverPerformance solve ( scalarField& psi, const scalarField& source, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C index e0574e58953..a8dd83f3ca3 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C @@ -30,7 +30,7 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::lduMatrix::solverPerformance Foam::GAMGSolver::solve +Foam::solverPerformance Foam::GAMGSolver::solve ( scalarField& psi, const scalarField& source, @@ -38,7 +38,7 @@ Foam::lduMatrix::solverPerformance Foam::GAMGSolver::solve ) const { // Setup class containing solver performance data - lduMatrix::solverPerformance solverPerf(typeName, fieldName_); + solverPerformance solverPerf(typeName, fieldName_); // Calculate A.psi used to calculate the initial residual scalarField Apsi(psi.size()); @@ -103,7 +103,7 @@ Foam::lduMatrix::solverPerformance Foam::GAMGSolver::solve if (debug >= 2) { - solverPerf.print(); + solverPerf.print(Info); } } while ( @@ -429,7 +429,7 @@ void Foam::GAMGSolver::solveCoarsestLevel { const label coarsestLevel = matrixLevels_.size() - 1; coarsestCorrField = 0; - lduMatrix::solverPerformance coarseSolverPerf; + solverPerformance coarseSolverPerf; if (matrixLevels_[coarsestLevel].asymmetric()) { @@ -468,7 +468,7 @@ void Foam::GAMGSolver::solveCoarsestLevel if (debug >= 2) { - coarseSolverPerf.print(); + coarseSolverPerf.print(Info); } } } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C index d47b606c242..8f224f85e74 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C @@ -62,7 +62,7 @@ Foam::PBiCG::PBiCG // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::lduMatrix::solverPerformance Foam::PBiCG::solve +Foam::solverPerformance Foam::PBiCG::solve ( scalarField& psi, const scalarField& source, @@ -70,7 +70,7 @@ Foam::lduMatrix::solverPerformance Foam::PBiCG::solve ) const { // --- Setup class containing solver performance data - lduMatrix::solverPerformance solverPerf + solverPerformance solverPerf ( lduMatrix::preconditioner::getName(controlDict_) + typeName, fieldName_ @@ -92,7 +92,7 @@ Foam::lduMatrix::solverPerformance Foam::PBiCG::solve scalarField wT(nCells); scalar* __restrict__ wTPtr = wT.begin(); - scalar wArT = matrix_.great_; + scalar wArT = solverPerf.great_; scalar wArTold = wArT; // --- Calculate A.psi and T.psi diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.H b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.H index 7479f75cc55..ff6e56dd6e8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.H @@ -88,7 +88,7 @@ public: // Member Functions //- Solve the matrix with this solver - virtual lduMatrix::solverPerformance solve + virtual solverPerformance solve ( scalarField& psi, const scalarField& source, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C index 37233afb719..9522848b5f5 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C @@ -62,7 +62,7 @@ Foam::PCG::PCG // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::lduMatrix::solverPerformance Foam::PCG::solve +Foam::solverPerformance Foam::PCG::solve ( scalarField& psi, const scalarField& source, @@ -70,7 +70,7 @@ Foam::lduMatrix::solverPerformance Foam::PCG::solve ) const { // --- Setup class containing solver performance data - lduMatrix::solverPerformance solverPerf + solverPerformance solverPerf ( lduMatrix::preconditioner::getName(controlDict_) + typeName, fieldName_ @@ -86,7 +86,7 @@ Foam::lduMatrix::solverPerformance Foam::PCG::solve scalarField wA(nCells); scalar* __restrict__ wAPtr = wA.begin(); - scalar wArA = matrix_.great_; + scalar wArA = solverPerf.great_; scalar wArAold = wArA; // --- Calculate A.psi diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H b/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H index 7aca6131848..da0a4326451 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H @@ -88,7 +88,7 @@ public: // Member Functions //- Solve the matrix with this solver - virtual lduMatrix::solverPerformance solve + virtual solverPerformance solve ( scalarField& psi, const scalarField& source, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.C b/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.C index fd03af39e7a..61036975374 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.C @@ -56,7 +56,7 @@ Foam::diagonalSolver::diagonalSolver // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::lduMatrix::solverPerformance Foam::diagonalSolver::solve +Foam::solverPerformance Foam::diagonalSolver::solve ( scalarField& psi, const scalarField& source, @@ -65,7 +65,7 @@ Foam::lduMatrix::solverPerformance Foam::diagonalSolver::solve { psi = source/matrix_.diag(); - return lduMatrix::solverPerformance + return solverPerformance ( typeName, fieldName_, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.H b/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.H index 1d67155e8cb..e532eef010f 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/diagonalSolver/diagonalSolver.H @@ -86,7 +86,7 @@ public: {} //- Solve the matrix with this solver - lduMatrix::solverPerformance solve + solverPerformance solve ( scalarField& psi, const scalarField& source, diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.C b/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.C index 05597a3b66b..56d244c2306 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.C @@ -74,7 +74,7 @@ void Foam::smoothSolver::readControls() } -Foam::lduMatrix::solverPerformance Foam::smoothSolver::solve +Foam::solverPerformance Foam::smoothSolver::solve ( scalarField& psi, const scalarField& source, @@ -82,7 +82,7 @@ Foam::lduMatrix::solverPerformance Foam::smoothSolver::solve ) const { // Setup class containing solver performance data - lduMatrix::solverPerformance solverPerf(typeName, fieldName_); + solverPerformance solverPerf(typeName, fieldName_); // If the nSweeps_ is negative do a fixed number of sweeps if (nSweeps_ < 0) diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.H b/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.H index ec62305803c..57e58f4d286 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/smoothSolver/smoothSolver.H @@ -92,7 +92,7 @@ public: // Member Functions //- Solve the matrix with this solver - virtual lduMatrix::solverPerformance solve + virtual solverPerformance solve ( scalarField& psi, const scalarField& source, diff --git a/src/OpenFOAM/meshes/data/data.C b/src/OpenFOAM/meshes/data/data.C index 7540482cfe1..e92406bf718 100644 --- a/src/OpenFOAM/meshes/data/data.C +++ b/src/OpenFOAM/meshes/data/data.C @@ -25,7 +25,7 @@ License #include "data.H" #include "Time.H" -#include "lduMatrix.H" +#include "solverPerformance.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -63,12 +63,12 @@ const Foam::dictionary& Foam::data::solverPerformanceDict() const void Foam::data::setSolverPerformance ( const word& name, - const lduMatrix::solverPerformance& sp + const solverPerformance& sp ) const { dictionary& dict = const_cast<dictionary&>(solverPerformanceDict()); - List<lduMatrix::solverPerformance> perfs; + List<solverPerformance> perfs; if (prevTimeIndex_ != this->time().timeIndex()) { @@ -90,7 +90,7 @@ void Foam::data::setSolverPerformance void Foam::data::setSolverPerformance ( - const lduMatrix::solverPerformance& sp + const solverPerformance& sp ) const { setSolverPerformance(sp.fieldName(), sp); diff --git a/src/OpenFOAM/meshes/data/data.H b/src/OpenFOAM/meshes/data/data.H index 31ce391acba..1b55206dd3c 100644 --- a/src/OpenFOAM/meshes/data/data.H +++ b/src/OpenFOAM/meshes/data/data.H @@ -39,7 +39,7 @@ SourceFiles #define data_H #include "IOdictionary.H" -#include "lduMatrix.H" +#include "solverPerformance.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -94,13 +94,13 @@ public: void setSolverPerformance ( const word& name, - const lduMatrix::solverPerformance& + const solverPerformance& ) const; //- Add/set the solverPerformance entry, using its fieldName void setSolverPerformance ( - const lduMatrix::solverPerformance& + const solverPerformance& ) const; }; diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C index 4cd984f0ccc..2c89cc4cae0 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C @@ -70,7 +70,7 @@ bool Foam::pimpleControl::criteriaSatisfied() const label fieldI = applyToField(variableName); if (fieldI != -1) { - const List<lduMatrix::solverPerformance> sp(iter().stream()); + const List<solverPerformance> sp(iter().stream()); const scalar residual = sp.last().initialResidual(); checked = true; diff --git a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C index b944f38b8f4..50d8c86a85d 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/simpleControl/simpleControl.C @@ -59,7 +59,7 @@ bool Foam::simpleControl::criteriaSatisfied() const label fieldI = applyToField(variableName); if (fieldI != -1) { - const List<lduMatrix::solverPerformance> sp(iter().stream()); + const List<solverPerformance> sp(iter().stream()); const scalar residual = sp.first().initialResidual(); checked = true; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index a69f7f5add6..3e65f5d1c23 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -1377,7 +1377,7 @@ void Foam::checkMethod template<class Type> -Foam::lduMatrix::solverPerformance Foam::solve +Foam::solverPerformance Foam::solve ( fvMatrix<Type>& fvm, const dictionary& solverControls @@ -1387,13 +1387,13 @@ Foam::lduMatrix::solverPerformance Foam::solve } template<class Type> -Foam::lduMatrix::solverPerformance Foam::solve +Foam::solverPerformance Foam::solve ( const tmp<fvMatrix<Type> >& tfvm, const dictionary& solverControls ) { - lduMatrix::solverPerformance solverPerf = + solverPerformance solverPerf = const_cast<fvMatrix<Type>&>(tfvm()).solve(solverControls); tfvm.clear(); @@ -1403,15 +1403,15 @@ Foam::lduMatrix::solverPerformance Foam::solve template<class Type> -Foam::lduMatrix::solverPerformance Foam::solve(fvMatrix<Type>& fvm) +Foam::solverPerformance Foam::solve(fvMatrix<Type>& fvm) { return fvm.solve(); } template<class Type> -Foam::lduMatrix::solverPerformance Foam::solve(const tmp<fvMatrix<Type> >& tfvm) +Foam::solverPerformance Foam::solve(const tmp<fvMatrix<Type> >& tfvm) { - lduMatrix::solverPerformance solverPerf = + solverPerformance solverPerf = const_cast<fvMatrix<Type>&>(tfvm()).solve(); tfvm.clear(); diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index 8b72617d046..ce214e60c80 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -239,11 +239,11 @@ public: //- Solve returning the solution statistics. // Use the given solver controls - lduMatrix::solverPerformance solve(const dictionary&); + solverPerformance solve(const dictionary&); //- Solve returning the solution statistics. // Solver controls read from fvSolution - lduMatrix::solverPerformance solve(); + solverPerformance solve(); }; @@ -389,19 +389,19 @@ public: //- Solve segregated or coupled returning the solution statistics. // Use the given solver controls - lduMatrix::solverPerformance solve(const dictionary&); + solverPerformance solve(const dictionary&); //- Solve segregated returning the solution statistics. // Use the given solver controls - lduMatrix::solverPerformance solveSegregated(const dictionary&); + solverPerformance solveSegregated(const dictionary&); //- Solve coupled returning the solution statistics. // Use the given solver controls - lduMatrix::solverPerformance solveCoupled(const dictionary&); + solverPerformance solveCoupled(const dictionary&); //- Solve returning the solution statistics. // Solver controls read from fvSolution - lduMatrix::solverPerformance solve(); + solverPerformance solve(); //- Return the matrix residual tmp<Field<Type> > residual() const; @@ -550,14 +550,14 @@ void checkMethod //- Solve returning the solution statistics given convergence tolerance // Use the given solver controls template<class Type> -lduMatrix::solverPerformance solve(fvMatrix<Type>&, const dictionary&); +solverPerformance solve(fvMatrix<Type>&, const dictionary&); //- Solve returning the solution statistics given convergence tolerance, // deleting temporary matrix after solution. // Use the given solver controls template<class Type> -lduMatrix::solverPerformance solve +solverPerformance solve ( const tmp<fvMatrix<Type> >&, const dictionary& @@ -567,14 +567,14 @@ lduMatrix::solverPerformance solve //- Solve returning the solution statistics given convergence tolerance // Solver controls read fvSolution template<class Type> -lduMatrix::solverPerformance solve(fvMatrix<Type>&); +solverPerformance solve(fvMatrix<Type>&); //- Solve returning the solution statistics given convergence tolerance, // deleting temporary matrix after solution. // Solver controls read fvSolution template<class Type> -lduMatrix::solverPerformance solve(const tmp<fvMatrix<Type> >&); +solverPerformance solve(const tmp<fvMatrix<Type> >&); //- Return the correction form of the given matrix diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index b37bfa2d5b7..0cd882fe546 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -53,7 +53,7 @@ void Foam::fvMatrix<Type>::setComponentReference template<class Type> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve +Foam::solverPerformance Foam::fvMatrix<Type>::solve ( const dictionary& solverControls ) @@ -85,13 +85,13 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve << "; currently supported solver types are segregated and coupled" << exit(FatalIOError); - return lduMatrix::solverPerformance(); + return solverPerformance(); } } template<class Type> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveSegregated +Foam::solverPerformance Foam::fvMatrix<Type>::solveSegregated ( const dictionary& solverControls ) @@ -107,7 +107,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveSegregated GeometricField<Type, fvPatchField, volMesh>& psi = const_cast<GeometricField<Type, fvPatchField, volMesh>&>(psi_); - lduMatrix::solverPerformance solverPerfVec + solverPerformance solverPerfVec ( "fvMatrix<Type>::solveSegregated", psi.name() @@ -176,7 +176,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveSegregated cmpt ); - lduMatrix::solverPerformance solverPerf; + solverPerformance solverPerf; // Solver call solverPerf = lduMatrix::solver::New @@ -189,7 +189,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveSegregated solverControls )->solve(psiCmpt, sourceCmpt, cmpt); - solverPerf.print(); + solverPerf.print(Info); solverPerfVec = max(solverPerfVec, solverPerf); solverPerfVec.solverName() = solverPerf.solverName(); @@ -207,7 +207,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveSegregated template<class Type> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveCoupled +Foam::solverPerformance Foam::fvMatrix<Type>::solveCoupled ( const dictionary& solverControls ) @@ -258,7 +258,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solveCoupled // psi.mesh().setSolverPerformance(psi.name(), solverPerf); - return lduMatrix::solverPerformance(); + return solverPerformance(); } @@ -281,7 +281,7 @@ Foam::fvMatrix<Type>::solver() template<class Type> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::fvSolver::solve() +Foam::solverPerformance Foam::fvMatrix<Type>::fvSolver::solve() { return solve ( @@ -298,7 +298,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::fvSolver::solve() template<class Type> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve() +Foam::solverPerformance Foam::fvMatrix<Type>::solve() { return solve ( diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index aed610cd4c2..bd75991ca9c 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -93,7 +93,7 @@ Foam::fvMatrix<Foam::scalar>::solver template<> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve +Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve ( const dictionary& solverControls ) @@ -111,13 +111,13 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve // assign new solver controls solver_->read(solverControls); - lduMatrix::solverPerformance solverPerf = solver_->solve + solverPerformance solverPerf = solver_->solve ( psi.internalField(), totalSource ); - solverPerf.print(); + solverPerf.print(Info); fvMat_.diag() = saveDiag; @@ -130,7 +130,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve template<> -Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated +Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated ( const dictionary& solverControls ) @@ -153,7 +153,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated addBoundarySource(totalSource, false); // Solver call - lduMatrix::solverPerformance solverPerf = lduMatrix::solver::New + solverPerformance solverPerf = lduMatrix::solver::New ( psi.name(), *this, @@ -163,7 +163,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated solverControls )->solve(psi.internalField(), totalSource); - solverPerf.print(); + solverPerf.print(Info); diag() = saveDiag; diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.H b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.H index 3a464de13b6..dc0d89db4d5 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.H +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.H @@ -62,13 +62,13 @@ autoPtr<fvMatrix<scalar>::fvSolver> fvMatrix<scalar>::solver ); template<> -lduMatrix::solverPerformance fvMatrix<scalar>::fvSolver::solve +solverPerformance fvMatrix<scalar>::fvSolver::solve ( const dictionary& ); template<> -lduMatrix::solverPerformance fvMatrix<scalar>::solveSegregated +solverPerformance fvMatrix<scalar>::solveSegregated ( const dictionary& ); -- GitLab