diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H index 53708f58e2721366f2f836955e0685b7d193c71a..9f3ef88a9ae7f58b8c8e06fe9031ecfd568f5b0e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H @@ -223,6 +223,10 @@ public: //- Print summary of solver performance void print() const; + // Member Operators + + bool operator!=(const solverPerformance&) const; + // Friend functions @@ -236,6 +240,7 @@ public: // Ostream Operator + friend Istream& operator>>(Istream&, solverPerformance&); friend Ostream& operator<<(Ostream&, const solverPerformance&); }; diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C index 6ec7861bc815d4bfadb2318b7d17b11b5dbef4be..09d8258ba586910f8ae9daf2d2ad0c2a5ad3b281 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTests.C @@ -32,15 +32,7 @@ Description Foam::lduMatrix::solverPerformance::solverPerformance(Istream& is) { - is.readBeginList("lduMatrix::solverPerformance"); - is >> solverName_ - >> fieldName_ - >> initialResidual_ - >> finalResidual_ - >> noIterations_ - >> converged_ - >> singular_; - is.readEndList("lduMatrix::solverPerformance"); + is >> *this; } @@ -118,6 +110,24 @@ void Foam::lduMatrix::solverPerformance::print() const } +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, @@ -137,6 +147,26 @@ Foam::lduMatrix::solverPerformance Foam::max } +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,