34 Opm::Group::ProductionCMode currentProdConstraint;
35 Opm::Group::InjectionCMode currentGasInjectionConstraint;
36 Opm::Group::InjectionCMode currentWaterInjectionConstraint;
38 template <
class MessageBufferType>
39 void write(MessageBufferType& buffer)
const;
41 template <
class MessageBufferType>
42 void read(MessageBufferType& buffer);
46 return this->currentProdConstraint == other.currentProdConstraint &&
47 this->currentGasInjectionConstraint == other.currentGasInjectionConstraint &&
48 this->currentWaterInjectionConstraint == other.currentWaterInjectionConstraint;
52 Opm::Group::InjectionCMode cgic,
53 Opm::Group::InjectionCMode cwic);
55 template<
class Serializer>
58 serializer(currentProdConstraint);
59 serializer(currentGasInjectionConstraint);
60 serializer(currentWaterInjectionConstraint);
66 Group::InjectionCMode::RATE,
67 Group::InjectionCMode::RESV};
75 template <
class MessageBufferType>
76 void write(MessageBufferType& buffer)
const
78 this->production.write(buffer);
79 this->injection .write(buffer);
82 template <
class MessageBufferType>
83 void read(MessageBufferType& buffer)
85 this->production.read(buffer);
86 this->injection .read(buffer);
91 return this->production == other.production
92 && this->injection == other.injection;
95 template<
class Serializer>
98 serializer(production);
99 serializer(injection);
105 GuideRateValue::serializationTestObject()};
113 template <
class MessageBufferType>
114 void write(MessageBufferType& buffer)
const
116 this->currentControl.write(buffer);
117 this->guideRates .write(buffer);
120 template <
class MessageBufferType>
121 void read(MessageBufferType& buffer)
123 this->currentControl.read(buffer);
124 this->guideRates .read(buffer);
127 bool operator==(
const GroupData& other)
const
129 return this->currentControl == other.currentControl
130 && this->guideRates == other.guideRates;
133 template<
class Serializer>
136 serializer(currentControl);
137 serializer(guideRates);
140 static GroupData serializationTestObject()
142 return GroupData{GroupConstraints::serializationTestObject(),
143 GroupGuideRates::serializationTestObject()};
148 double pressure { 0.0 };
149 double converged_pressure { 0.0 };
151 template <
class MessageBufferType>
152 void write(MessageBufferType& buffer)
const
154 buffer.write(this->pressure);
155 buffer.write(this->converged_pressure);
158 template <
class MessageBufferType>
159 void read(MessageBufferType& buffer)
161 buffer.read(this->pressure);
162 buffer.read(this->converged_pressure);
165 bool operator==(
const NodeData& other)
const
167 return this->pressure == other.pressure && this->converged_pressure == other.converged_pressure;
170 template<
class Serializer>
173 serializer(pressure);
174 serializer(converged_pressure);
177 static NodeData serializationTestObject()
185 std::map<std::string, GroupData> groupData {};
186 std::map<std::string, NodeData> nodeData {};
188 template <
class MessageBufferType>
189 void write(MessageBufferType& buffer)
const
191 this->writeMap(this->groupData, buffer);
192 this->writeMap(this->nodeData, buffer);
195 template <
class MessageBufferType>
196 void read(MessageBufferType& buffer)
198 this->readMap(buffer, this->groupData);
199 this->readMap(buffer, this->nodeData);
204 return (this->groupData == other.groupData)
205 && (this->nodeData == other.nodeData);
210 this->groupData.clear();
211 this->nodeData.clear();
214 template<
class Serializer>
217 serializer(groupData);
218 serializer(nodeData);
224 {{
"test_data", GroupData::serializationTestObject()}},
225 {{
"test_node", NodeData::serializationTestObject()}}
230 template <
class MessageBufferType,
class ValueType>
231 void writeMap(
const std::map<std::string, ValueType>& map,
232 MessageBufferType& buffer)
const
234 const unsigned int size = map.size();
237 for (
const auto& [name, elm] : map) {
243 template <
class MessageBufferType,
class ValueType>
244 void readMap(MessageBufferType& buffer,
245 std::map<std::string, ValueType>& map)
250 for (std::size_t i = 0; i < size; ++i) {
254 auto elm = ValueType{};
257 map.emplace(name, std::move(elm));
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30