mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 07:53:29 -06:00
SimulatorReport: add serialization support
This commit is contained in:
parent
f0ca3120ff
commit
a21d59977d
@ -202,6 +202,20 @@ namespace Opm
|
||||
os << std::endl;
|
||||
}
|
||||
|
||||
SimulatorReport SimulatorReport::serializationTestObject()
|
||||
{
|
||||
return SimulatorReport{SimulatorReportSingle::serializationTestObject(),
|
||||
SimulatorReportSingle::serializationTestObject(),
|
||||
{SimulatorReportSingle::serializationTestObject()}};
|
||||
}
|
||||
|
||||
bool SimulatorReport::operator==(const SimulatorReport& rhs) const
|
||||
{
|
||||
return this->success == rhs.success &&
|
||||
this->failure == rhs.failure &&
|
||||
this->stepreports == rhs.stepreports;
|
||||
}
|
||||
|
||||
void SimulatorReport::operator+=(const SimulatorReportSingle& sr)
|
||||
{
|
||||
if (sr.converged) {
|
||||
|
@ -102,10 +102,21 @@ namespace Opm
|
||||
SimulatorReportSingle failure;
|
||||
std::vector<SimulatorReportSingle> stepreports;
|
||||
|
||||
static SimulatorReport serializationTestObject();
|
||||
|
||||
bool operator==(const SimulatorReport&) const;
|
||||
void operator+=(const SimulatorReportSingle& sr);
|
||||
void operator+=(const SimulatorReport& sr);
|
||||
void reportFullyImplicit(std::ostream& os) const;
|
||||
void fullReports(std::ostream& os) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(success);
|
||||
serializer(failure);
|
||||
serializer(stepreports);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -87,6 +87,7 @@ TEST_FOR_TYPE(PIDAndIterationCountTimeStepControl)
|
||||
TEST_FOR_TYPE(PIDTimeStepControl)
|
||||
TEST_FOR_TYPE(SegmentState)
|
||||
TEST_FOR_TYPE(SimpleIterationCountTimeStepControl)
|
||||
TEST_FOR_TYPE(SimulatorReport)
|
||||
TEST_FOR_TYPE(SimulatorReportSingle)
|
||||
TEST_FOR_TYPE(SimulatorTimer)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user