Merge pull request #3402 from akva2/gpmaint_state_comp_op
GPMaint::State: add comparison operator
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#ifndef GPMAINT_HPP
|
||||
#define GPMAINT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
@@ -44,15 +45,9 @@ public:
|
||||
double error_integral;
|
||||
double initial_rate;
|
||||
|
||||
static State serializationTestObject()
|
||||
{
|
||||
State result;
|
||||
result.report_step = 1;
|
||||
result.error_integral = 2.0;
|
||||
result.initial_rate = 3.0;
|
||||
static State serializationTestObject();
|
||||
|
||||
return result;
|
||||
}
|
||||
bool operator==(const State& rhs) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
|
||||
@@ -17,12 +17,25 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <opm/input/eclipse/Schedule/Group/GPMaint.hpp>
|
||||
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/G.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
GPMaint::State GPMaint::State::serializationTestObject()
|
||||
{
|
||||
return State{1, 2.0, 3.0};
|
||||
}
|
||||
|
||||
bool GPMaint::State::operator==(const GPMaint::State& rhs) const
|
||||
{
|
||||
return this->report_step == rhs.report_step &&
|
||||
this->error_integral == rhs.error_integral &&
|
||||
this->initial_rate == rhs.initial_rate;
|
||||
}
|
||||
|
||||
GPMaint::GPMaint(std::size_t report_step, const DeckRecord& record)
|
||||
{
|
||||
using GP = ParserKeywords::GPMAINT;
|
||||
|
||||
Reference in New Issue
Block a user