Skip to content

Commit 2a8e597

Browse files
Add a multirealized property in example
1 parent 6bd379a commit 2a8e597

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

example/example.cpp

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ under the License.
2626
// ************************
2727
#endif
2828

29+
#include <array>
2930
#include <fstream>
3031
#include <iostream>
3132
#include <sstream>
@@ -1268,14 +1269,29 @@ void serializeGrid(COMMON_NS::DataObjectRepository * repo, EML2_NS::AbstractHdfP
12681269
gsoap_resqml2_0_1::resqml20__CellShape::prism);
12691270

12701271
if (repo->getDefaultResqmlVersion() == COMMON_NS::DataObjectRepository::EnergisticsStandard::RESQML2_0_1) {
1272+
RESQML2_NS::ContinuousProperty* unstructuredGridPropReal0 = repo->createContinuousProperty(unstructuredGrid, "7444c6cb-dd53-4100-b252-2eacbbd9500c", "Multi Realizations Prop", 1,
1273+
gsoap_eml2_3::eml23__IndexableElement::cells, gsoap_resqml2_0_1::resqml20__ResqmlUom::m, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length);
1274+
std::array<double, 2> propValues = { 12.3, 45.6 };
1275+
unstructuredGridPropReal0->pushBackArray1dOfValues(propValues.data(), propValues.size());
1276+
unstructuredGridPropReal0->setRealizationIndices(0, 1);
12711277

1272-
// Create the property
1273-
RESQML2_NS::ContinuousProperty* unstructuredGridProp = repo->createContinuousProperty(unstructuredGrid, "7444c6cb-dd53-4100-b252-2eacbbd9500c", "My polyhedra property", 1,
1278+
RESQML2_NS::ContinuousProperty* unstructuredGridPropReal1 = repo->createContinuousProperty(unstructuredGrid, "", "Multi Realizations Prop", 1,
12741279
gsoap_eml2_3::eml23__IndexableElement::cells, gsoap_resqml2_0_1::resqml20__ResqmlUom::m, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length);
1280+
propValues = { 15.3, 46.6 };
1281+
unstructuredGridPropReal1->pushBackArray1dOfValues(propValues.data(), propValues.size());
1282+
unstructuredGridPropReal1->setRealizationIndices(1, 1);
12751283

1276-
// Fill the property
1277-
double propValues[2] = { 12.3, 45.6 };
1278-
unstructuredGridProp->pushBackArray1dOfValues(propValues, 2);
1284+
RESQML2_NS::ContinuousProperty* unstructuredGridPropReal2 = repo->createContinuousProperty(unstructuredGrid, "", "Multi Realizations Prop", 1,
1285+
gsoap_eml2_3::eml23__IndexableElement::cells, gsoap_resqml2_0_1::resqml20__ResqmlUom::m, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length);
1286+
propValues = { 13.3, 49.6 };
1287+
unstructuredGridPropReal2->pushBackArray1dOfValues(propValues.data(), propValues.size());
1288+
unstructuredGridPropReal2->setRealizationIndices(2, 1);
1289+
1290+
RESQML2_NS::ContinuousProperty* unstructuredGridPropReal3 = repo->createContinuousProperty(unstructuredGrid, "", "Multi Realizations Prop", 1,
1291+
gsoap_eml2_3::eml23__IndexableElement::cells, gsoap_resqml2_0_1::resqml20__ResqmlUom::m, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length);
1292+
propValues = { 5.3, 60.6 };
1293+
unstructuredGridPropReal3->pushBackArray1dOfValues(propValues.data(), propValues.size());
1294+
unstructuredGridPropReal3->setRealizationIndices(3, 1);
12791295
}
12801296
#if WITH_RESQML2_2
12811297
else {

0 commit comments

Comments
 (0)