# Split grid/geometry and properties EPC

**URL:** <https://discourse.f2i-consulting.com/t/split-grid-geometry-and-properties-epc/207>\
**Category:** FESAPI\
**Created:** [March 5, 2022, 5:49pm UTC](https://discourse.f2i-consulting.com/t/split-grid-geometry-and-properties-epc/207 "2022-03-05T17:49:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgthomas-github](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/sgthomas-github/32/12_2.png) [@sgthomas-github](https://discourse.f2i-consulting.com/u/sgthomas-github)\
**Post date:** [March 5, 2022, 5:49pm UTC](https://discourse.f2i-consulting.com/t/split-grid-geometry-and-properties-epc/207/1 "2022-03-05T17:49:48Z")

</div>

Hi,

I am trying to export a case as split geometry (grid topological and any grid related property info e.g. cell IDs etc) and properties (e.g. cell and connection model properties) EPC/H5 file combos. It is to be noted that all the properties are supported on the same grid (cell properties on the grid representation, connection properties on the connection set representation). But using 0.13.0.0 C++ APIs it is always throwing an exception when trying to serialize the props EPC.

For additional detail, my grid is of type UnstructuredGridRepresentation, connection is of type GridConnectionSetRepresentation as usual. The two H5 files appear to be generated OK and if I comment out the serialize call to the properties EPC, it runs through OK as well, and unified EPC export has always been working OK for me. So I wonder if this type of split export scenario is even supported in that version 0.13.0.0 (it seems that one problem could be the memory management of same grid and connection set representation across two EPC?) and perhaps resolved in later versions?

Appreciate any thoughts on this.

Thanks,  
-Sunil

---

<div class="post-metadata">

**Author:** ![sgthomas-github](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/sgthomas-github/32/12_2.png) [@sgthomas-github](https://discourse.f2i-consulting.com/u/sgthomas-github)\
**Post date:** [March 7, 2022, 5:33pm UTC](https://discourse.f2i-consulting.com/t/split-grid-geometry-and-properties-epc/207/2 "2022-03-07T17:33:36Z")

</div>

Update - I just tried with `createPartialUnstructruedGridRepresentation` and still see the same behavior (exception when trying to serialize the properties EPC). My current workflow is as follows:

Main implementation that creates and populates (from input data) the two EPC documents (grid, properties) and their corresponding H5 bulk data using Fesapi APIs, are inside a dedicated class. Then after they have been created and populated, in the driving application I call to serialize (following the outline in `example.cpp`):

```auto
        EpcDocument* props_ptr = converter.get_props();
        if (!props_ptr)
        {
          return false;
        }
        EpcDocument* ptr = converter.get();
        if (!ptr)
        {
          return false;
        }
        props_ptr->getHdfProxy(0)->close();
        ptr->getHdfProxy(0)->close();
        props_ptr->serialize();
        ptr->serialize();

```

In the above snippet, tested also various ordering (e.g. first grid EPC, then closing it, then properties EPC, or reversing the order etc); commenting all the references to `props_ptr` in the above, or even commenting only the call to properties EPC `props_ptr->serialize()` allows it to run through without the exception.
