data::AquiferData: add serializer support
This commit is contained in:
parent
f6fa3e9fa5
commit
64aee42bf1
@ -235,6 +235,12 @@ namespace Opm { namespace data {
|
||||
}
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.variant(options_);
|
||||
}
|
||||
|
||||
private:
|
||||
using Types = std::variant<std::monostate,
|
||||
CarterTracyData,
|
||||
@ -332,6 +338,54 @@ namespace Opm { namespace data {
|
||||
template <class MessageBufferType>
|
||||
void read(MessageBufferType& buffer);
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(aquiferID);
|
||||
serializer(pressure);
|
||||
serializer(fluxRate);
|
||||
serializer(volume);
|
||||
serializer(initPressure);
|
||||
serializer(datumDepth);
|
||||
typeData.serializeOp(serializer);
|
||||
}
|
||||
|
||||
static AquiferData serializeObjectF()
|
||||
{
|
||||
auto aquifer = AquiferData {1, 123.456, 56.78, 9.0e10, 290.0, 2515.5};
|
||||
auto* aquFet = aquifer.typeData.create<AquiferType::Fetkovich>();
|
||||
aquFet->initVolume = 1.23;
|
||||
aquFet->prodIndex = 45.67;
|
||||
aquFet->timeConstant = 890.123;
|
||||
|
||||
return aquifer;
|
||||
}
|
||||
|
||||
static AquiferData serializeObjectC()
|
||||
{
|
||||
auto aquifer = AquiferData {2, 123.456, 56.78, 9.0e10, 290.0, 2515.5};
|
||||
auto* aquCT = aquifer.typeData.create<AquiferType::CarterTracy>();
|
||||
|
||||
aquCT->timeConstant = 987.65;
|
||||
aquCT->influxConstant = 43.21;
|
||||
aquCT->waterDensity = 1014.5;
|
||||
aquCT->waterViscosity = 0.00318;
|
||||
aquCT->dimensionless_time = 42.0;
|
||||
aquCT->dimensionless_pressure = 2.34;
|
||||
|
||||
return aquifer;
|
||||
}
|
||||
|
||||
static AquiferData serializeObjectN()
|
||||
{
|
||||
auto aquifer = AquiferData {3, 123.456, 56.78, 9.0e10, 290.0, 2515.5};
|
||||
auto* aquNum = aquifer.typeData.create<AquiferType::Numerical>();
|
||||
|
||||
aquNum->initPressure = {1.234, 2.345, 3.4, 9.876};
|
||||
|
||||
return aquifer;
|
||||
}
|
||||
|
||||
private:
|
||||
using GetSummaryValue = double (AquiferData::*)() const;
|
||||
using SummaryValueDispatchTable = std::unordered_map<std::string, GetSummaryValue>;
|
||||
|
Loading…
Reference in New Issue
Block a user