Skip to content
Snippets Groups Projects
Commit 7b941b79 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add operator>> and operator!= to lduMatrix::solverPerformance

- needed for reading a List<lduMatrix::solverPerformance>
parent ed3c0abe
No related merge requests found
......@@ -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&);
};
......
......@@ -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,
......
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