mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add operator>> and operator!= to lduMatrix::solverPerformance
- needed for reading a List<lduMatrix::solverPerformance>
This commit is contained in:
@ -223,6 +223,10 @@ public:
|
|||||||
//- Print summary of solver performance
|
//- Print summary of solver performance
|
||||||
void print() const;
|
void print() const;
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
bool operator!=(const solverPerformance&) const;
|
||||||
|
|
||||||
|
|
||||||
// Friend functions
|
// Friend functions
|
||||||
|
|
||||||
@ -236,6 +240,7 @@ public:
|
|||||||
|
|
||||||
// Ostream Operator
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Istream& operator>>(Istream&, solverPerformance&);
|
||||||
friend Ostream& operator<<(Ostream&, const solverPerformance&);
|
friend Ostream& operator<<(Ostream&, const solverPerformance&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -32,15 +32,7 @@ Description
|
|||||||
|
|
||||||
Foam::lduMatrix::solverPerformance::solverPerformance(Istream& is)
|
Foam::lduMatrix::solverPerformance::solverPerformance(Istream& is)
|
||||||
{
|
{
|
||||||
is.readBeginList("lduMatrix::solverPerformance");
|
is >> *this;
|
||||||
is >> solverName_
|
|
||||||
>> fieldName_
|
|
||||||
>> initialResidual_
|
|
||||||
>> finalResidual_
|
|
||||||
>> noIterations_
|
|
||||||
>> converged_
|
|
||||||
>> singular_;
|
|
||||||
is.readEndList("lduMatrix::solverPerformance");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -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
|
Foam::lduMatrix::solverPerformance Foam::max
|
||||||
(
|
(
|
||||||
const lduMatrix::solverPerformance& sp1,
|
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<<
|
Foam::Ostream& Foam::operator<<
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
|
|||||||
Reference in New Issue
Block a user