@@ -102,7 +102,7 @@ void AbstractColumnLayerGridRepresentation::setIntervalAssociationWithStratigrap
102102 rep->IntervalStratigraphicUnits ->UnitIndices = gsoap_eml2_3::soap_new_eml23__JaggedArray (rep->soap );
103103 // element XML
104104 gsoap_eml2_3::eml23__IntegerXmlArray* elementDataset = gsoap_eml2_3::soap_new_eml23__IntegerXmlArray (rep->soap );
105- elementDataset->CountPerValue = nullValue;
105+ elementDataset->NullValue = nullValue;
106106 elementDataset->Values = std::to_string (stratiUnitIndices[0 ]);
107107 for (uint64_t i = 1 ; i < getKCellCount (); ++i) {
108108 elementDataset->Values += " " + std::to_string (stratiUnitIndices[i]);
@@ -111,7 +111,7 @@ void AbstractColumnLayerGridRepresentation::setIntervalAssociationWithStratigrap
111111
112112 // cumulative XML
113113 gsoap_eml2_3::eml23__IntegerXmlArray* cumulativeDataset = gsoap_eml2_3::soap_new_eml23__IntegerXmlArray (rep->soap );
114- cumulativeDataset->CountPerValue = 1 ;
114+ cumulativeDataset->NullValue = nullValue ;
115115 cumulativeDataset->Values = " 1" ;
116116 for (uint64_t i = 1 ; i < getKCellCount (); ++i) {
117117 cumulativeDataset->Values += " " + std::to_string (i + 1 );
@@ -269,3 +269,166 @@ gsoap_resqml2_0_1::resqml20__PillarShape AbstractColumnLayerGridRepresentation::
269269 throw logic_error (" Not implemented yet" );
270270 }
271271}
272+
273+ void AbstractColumnLayerGridRepresentation::getSplitNodeParentNodeIndices (uint64_t * splitNodeParentNodeIndices) const
274+ {
275+ if (gsoapProxy2_0_1 != nullptr ) {
276+ gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry*>(getPointGeometry2_0_1 (0 ));
277+ if (geom == nullptr ) {
278+ throw invalid_argument (" There is no geometry on this grid." );
279+ }
280+ if (geom->SplitNodes == nullptr || geom->SplitNodes ->Count == 0 ) {
281+ throw invalid_argument (" There is no split node on this grid." );
282+ }
283+
284+ readArrayNdOfIntegerValues (geom->SplitNodes ->ParentNodeIndices , splitNodeParentNodeIndices);
285+ }
286+ else {
287+ gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry*>(getPointGeometry2_2 (0 ));
288+ if (geom == nullptr ) {
289+ throw invalid_argument (" There is no geometry on this grid." );
290+ }
291+ if (geom->SplitNodePatch == nullptr || geom->SplitNodePatch ->Count == 0 ) {
292+ throw invalid_argument (" There is no split node on this grid." );
293+ }
294+
295+ readArrayNdOfIntegerValues (geom->SplitNodePatch ->ParentNodeIndices , splitNodeParentNodeIndices);
296+ }
297+ }
298+
299+ void AbstractColumnLayerGridRepresentation::getCumulativeCountOfCellsPerSplitNode (uint64_t * cumulativeCountOfCellsPerSplitNode) const
300+ {
301+ if (gsoapProxy2_0_1 != nullptr ) {
302+ gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry*>(getPointGeometry2_0_1 (0 ));
303+ if (geom == nullptr ) {
304+ throw invalid_argument (" There is no geometry on this grid." );
305+ }
306+ if (geom->SplitNodes == nullptr || geom->SplitNodes ->Count == 0 ) {
307+ throw invalid_argument (" There is no split node on this grid." );
308+ }
309+
310+ readArrayNdOfIntegerValues (geom->SplitNodes ->CellsPerSplitNode ->CumulativeLength , cumulativeCountOfCellsPerSplitNode);
311+ }
312+ else {
313+ gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry*>(getPointGeometry2_2 (0 ));
314+ if (geom == nullptr ) {
315+ throw invalid_argument (" There is no geometry on this grid." );
316+ }
317+ if (geom->SplitNodePatch == nullptr || geom->SplitNodePatch ->Count == 0 ) {
318+ throw invalid_argument (" There is no split node on this grid." );
319+ }
320+
321+ readArrayNdOfIntegerValues (geom->SplitNodePatch ->CellsPerSplitNode ->CumulativeLength , cumulativeCountOfCellsPerSplitNode);
322+ }
323+ }
324+
325+ void AbstractColumnLayerGridRepresentation::getCellsPerSplitNode (uint64_t * cellsPerSplitNode) const
326+ {
327+ if (gsoapProxy2_0_1 != nullptr ) {
328+ gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry*>(getPointGeometry2_0_1 (0 ));
329+ if (geom == nullptr ) {
330+ throw invalid_argument (" There is no geometry on this grid." );
331+ }
332+ if (geom->SplitNodes == nullptr || geom->SplitNodes ->Count == 0 ) {
333+ throw invalid_argument (" There is no split node on this grid." );
334+ }
335+
336+ readArrayNdOfIntegerValues (geom->SplitNodes ->CellsPerSplitNode ->Elements , cellsPerSplitNode);
337+ }
338+ else {
339+ gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry*>(getPointGeometry2_2 (0 ));
340+ if (geom == nullptr ) {
341+ throw invalid_argument (" There is no geometry on this grid." );
342+ }
343+ if (geom->SplitNodePatch == nullptr || geom->SplitNodePatch ->Count == 0 ) {
344+ throw invalid_argument (" There is no split node on this grid." );
345+ }
346+
347+ readArrayNdOfIntegerValues (geom->SplitNodePatch ->CellsPerSplitNode ->Elements , cellsPerSplitNode);
348+ }
349+ }
350+
351+ void AbstractColumnLayerGridRepresentation::setSplitNodePatch (uint64_t splitNodeCount, uint64_t * splitNodeParentNodeIndices,
352+ uint64_t * cumulativeCountOfCellsPerSplitNode, uint64_t * cellsPerSplitNode, EML2_NS::AbstractHdfProxy* proxy)
353+ {
354+ if (proxy == nullptr ) {
355+ proxy = getRepository ()->getDefaultHdfProxy ();
356+ if (proxy == nullptr ) {
357+ throw std::invalid_argument (" A (default) HDF Proxy must be provided." );
358+ }
359+ }
360+
361+ if (gsoapProxy2_0_1 != nullptr ) {
362+ gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_resqml2_0_1::resqml20__AbstractColumnLayerGridGeometry*>(getPointGeometry2_0_1 (0 ));
363+ if (geom == nullptr ) {
364+ throw invalid_argument (" There is no geometry on this grid." );
365+ }
366+
367+ auto * patch = soap_new_resqml20__SplitNodePatch (gsoapProxy2_0_1->soap );
368+ patch->Count = splitNodeCount;
369+
370+ auto * parentNodeIndicesArray = soap_new_resqml20__IntegerHdf5Array (gsoapProxy2_0_1->soap );
371+ parentNodeIndicesArray->Values = soap_new_eml20__Hdf5Dataset (gsoapProxy2_0_1->soap );
372+ parentNodeIndicesArray->Values ->HdfProxy = proxy->newResqmlReference ();
373+ parentNodeIndicesArray->Values ->PathInHdfFile = getHdfGroup () + " /SplitNodeParentNodeIndices" ;
374+ parentNodeIndicesArray->NullValue = -1 ;
375+ patch->ParentNodeIndices = parentNodeIndicesArray;
376+
377+ patch->CellsPerSplitNode = soap_new_resqml20__ResqmlJaggedArray (gsoapProxy2_0_1->soap );
378+ // Cumulative
379+ resqml20__IntegerHdf5Array* cumulativeLength = soap_new_resqml20__IntegerHdf5Array (gsoapProxy2_0_1->soap );
380+ patch->CellsPerSplitNode ->CumulativeLength = cumulativeLength;
381+ cumulativeLength->NullValue = -1 ;
382+ cumulativeLength->Values = soap_new_eml20__Hdf5Dataset (gsoapProxy2_0_1->soap );
383+ cumulativeLength->Values ->HdfProxy = proxy->newResqmlReference ();
384+ cumulativeLength->Values ->PathInHdfFile = getHdfGroup () + " /CellsPerSplitNode/" + EML2_NS::AbstractHdfProxy::CUMULATIVE_LENGTH_DS_NAME;
385+ // Elements
386+ resqml20__IntegerHdf5Array* elements = soap_new_resqml20__IntegerHdf5Array (gsoapProxy2_0_1->soap );
387+ patch->CellsPerSplitNode ->Elements = elements;
388+ elements->NullValue = -1 ;
389+ elements->Values = soap_new_eml20__Hdf5Dataset (gsoapProxy2_0_1->soap );
390+ elements->Values ->HdfProxy = proxy->newResqmlReference ();
391+ elements->Values ->PathInHdfFile = getHdfGroup () + " /CellsPerSplitNode/" + EML2_NS::AbstractHdfProxy::ELEMENTS_DS_NAME;
392+
393+ geom->SplitNodes = patch;
394+ }
395+ else {
396+ gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry* geom = dynamic_cast <gsoap_eml2_3::resqml22__AbstractColumnLayerGridGeometry*>(getPointGeometry2_2 (0 ));
397+ if (geom == nullptr ) {
398+ throw invalid_argument (" There is no geometry on this grid." );
399+ }
400+
401+ auto * patch = gsoap_eml2_3::soap_new_resqml22__SplitNodePatch (gsoapProxy2_3->soap );
402+ patch->Count = splitNodeCount;
403+
404+ auto * parentNodeIndicesArray = gsoap_eml2_3::soap_new_eml23__IntegerExternalArray (gsoapProxy2_3->soap );
405+ parentNodeIndicesArray->Values = gsoap_eml2_3::soap_new_eml23__ExternalDataArray (gsoapProxy2_3->soap );
406+ parentNodeIndicesArray->Values ->ExternalDataArrayPart .push_back (createExternalDataArrayPart (getHdfGroup () + " /SplitNodeParentNodeIndices" , splitNodeCount, proxy));
407+ parentNodeIndicesArray->NullValue = -1 ;
408+ patch->ParentNodeIndices = parentNodeIndicesArray;
409+
410+ patch->CellsPerSplitNode = gsoap_eml2_3::soap_new_eml23__JaggedArray (gsoapProxy2_3->soap );
411+ // cumulative XML
412+ auto * cumulativeDataset = gsoap_eml2_3::soap_new_eml23__IntegerExternalArray (gsoapProxy2_3->soap );
413+ cumulativeDataset->NullValue = -1 ;
414+ cumulativeDataset->Values = gsoap_eml2_3::soap_new_eml23__ExternalDataArray (gsoapProxy2_3->soap );
415+ cumulativeDataset->Values ->ExternalDataArrayPart .push_back (
416+ createExternalDataArrayPart (getHdfGroup () + " /CellsPerSplitNode/" + EML2_NS::AbstractHdfProxy::CUMULATIVE_LENGTH_DS_NAME, splitNodeCount, proxy));
417+ patch->CellsPerSplitNode ->CumulativeLength = cumulativeDataset;
418+ // element XML
419+ auto * elementDataset = gsoap_eml2_3::soap_new_eml23__IntegerExternalArray (gsoapProxy2_3->soap );
420+ elementDataset->NullValue = -1 ;
421+ elementDataset->Values = gsoap_eml2_3::soap_new_eml23__ExternalDataArray (gsoapProxy2_3->soap );
422+ elementDataset->Values ->ExternalDataArrayPart .push_back (
423+ createExternalDataArrayPart (getHdfGroup () + " /CellsPerSplitNode/" + EML2_NS::AbstractHdfProxy::ELEMENTS_DS_NAME, cumulativeCountOfCellsPerSplitNode[splitNodeCount-1 ], proxy));
424+ patch->CellsPerSplitNode ->Elements = elementDataset;
425+
426+ geom->SplitNodePatch = patch;
427+ }
428+
429+ // HDF
430+ proxy->writeArrayNdOfUInt64Values (getHdfGroup (), " SplitNodeParentNodeIndices" , splitNodeParentNodeIndices, &splitNodeCount, 1 );
431+ proxy->writeItemizedListOfList (getHdfGroup (), " CellsPerSplitNode" ,
432+ COMMON_NS::AbstractObject::numericalDatatypeEnum::UINT64, cumulativeCountOfCellsPerSplitNode, splitNodeCount,
433+ COMMON_NS::AbstractObject::numericalDatatypeEnum::UINT64, cellsPerSplitNode, cumulativeCountOfCellsPerSplitNode[splitNodeCount - 1 ]);
434+ }
0 commit comments