Hi,
I noticed that using some API results in exceptions being thrown in the code. For example:
for(size_t s = 0; s < subdomains_count; s++) {
boost::shared_ptr<AbstractIjkGridRepresentation> abstract_ijk_grid_ptr(m_impl->epc->createPartialIjkGridRepresentation("", subdomains_name[s]));
abstract_ijk_grid_ptr->setICellCount(subdomain_nijk[s * 3 + 0]);
abstract_ijk_grid_ptr->setJCellCount(subdomain_nijk[s * 3 + 1]);
abstract_ijk_grid_ptr->setKCellCount(subdomain_nijk[s * 3 + 2]);
abstract_ijk_grid_ptrs[s] = abstract_ijk_grid_ptr;
}
The above call to API setICellCount
throws exceptions. But this works:
for(size_t s = 0; s < subdomains_count; s++) {
boost::shared_ptr<IjkGridNoGeometryRepresentation> abstract_ijk_grid_ptr(m_impl->epc->createIjkGridNoGeometryRepresentation("", subdomains_name[s], subdomain_nijk[s * 3 + 0], subdomain_nijk[s * 3 + 1], subdomain_nijk[s * 3 + 2]));
m_impl->abstract_ijk_grid_ptrs.push_back(abstract_ijk_grid_ptr);
}
Further, the below code throws exception too.
boost::shared_ptr<resqml2::GridConnectionSetRepresentation> grid_conn_set_rep(m_impl->epc->createGridConnectionSetRepresentation("", "GridConnectionSetRepresentation"));
// IX assumes only top level grid connections presently
grid_conn_set_rep->pushBackSupportingGridRepresentation((resqml2::AbstractGridRepresentation*)m_impl->epc->getIjkGridRepresentation(0));
at the call to pushBackSupportingGridRepresentation
, but the below code works fine (when the grid pointer is cached):
boost::shared_ptr<resqml2::GridConnectionSetRepresentation> grid_conn_set_rep(m_impl->epc->createGridConnectionSetRepresentation("", "GridConnectionSetRepresentation"));
// IX assumes only top level grid connections presently
grid_conn_set_rep->pushBackSupportingGridRepresentation(m_impl->abstract_ijk_grid_ptrs[0].get());
I am not sure why these exceptions are thrown - any ideas? I suspect it may be due to const correctness of the relevant APIs and their internal implementation, but the same works when accessing the HDF proxy using the API getHdfProxy
, so I am not sure if that is the reason or not. Likewise, I see an exception just now for the below usage:
boost::uint64_t nb_resqml_connections = m_impl->epc->getIjkGridRepresentation(0)->getGridConnectionSetRepresentation(0)->getCellIndexPairCount();
which I plan to resolve by caching again (I hope so, anyway).