mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-26 03:00:17 -06:00
BlackoilPrimaryVariables: add serialization support
This commit is contained in:
parent
b6db23f518
commit
9c17781de2
@ -175,6 +175,21 @@ public:
|
||||
*/
|
||||
BlackOilPrimaryVariables(const BlackOilPrimaryVariables& value) = default;
|
||||
|
||||
static BlackOilPrimaryVariables serializationTestObject()
|
||||
{
|
||||
BlackOilPrimaryVariables result;
|
||||
result.pvtRegionIdx_ = 1;
|
||||
result.primaryVarsMeaningBrine_ = BrineMeaning::Sp;
|
||||
result.primaryVarsMeaningGas_ = GasMeaning::Rv;
|
||||
result.primaryVarsMeaningPressure_ = PressureMeaning::Pg;
|
||||
result.primaryVarsMeaningWater_ = WaterMeaning::Rsw;
|
||||
for (size_t i = 0; i < result.size(); ++i) {
|
||||
result[i] = i+1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set the index of the region which should be used for PVT properties.
|
||||
*
|
||||
@ -863,6 +878,28 @@ public:
|
||||
#endif // NDEBUG
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
using FV = Dune::FieldVector<double,getPropValue<TypeTag, Properties::NumEq>()>;
|
||||
serializer(static_cast<FV&>(*this));
|
||||
serializer(primaryVarsMeaningWater_);
|
||||
serializer(primaryVarsMeaningPressure_);
|
||||
serializer(primaryVarsMeaningGas_);
|
||||
serializer(primaryVarsMeaningBrine_);
|
||||
serializer(pvtRegionIdx_);
|
||||
}
|
||||
|
||||
bool operator==(const BlackOilPrimaryVariables& rhs) const
|
||||
{
|
||||
return static_cast<const FvBasePrimaryVariables<TypeTag>&>(*this) == rhs &&
|
||||
this->primaryVarsMeaningWater_ == rhs.primaryVarsMeaningWater_ &&
|
||||
this->primaryVarsMeaningPressure_ == rhs.primaryVarsMeaningPressure_ &&
|
||||
this->primaryVarsMeaningGas_ == rhs.primaryVarsMeaningGas_ &&
|
||||
this->primaryVarsMeaningBrine_ == rhs.primaryVarsMeaningBrine_ &&
|
||||
this->pvtRegionIdx_ == rhs.pvtRegionIdx_;
|
||||
}
|
||||
|
||||
private:
|
||||
Implementation& asImp_()
|
||||
{ return *static_cast<Implementation*>(this); }
|
||||
|
Loading…
Reference in New Issue
Block a user