Convert fault ASCII to RESQML

Hi! I’m trying to generate a RESQML with fault interpretation, to put the binary need to create the PolylineSetRepresentation and use the def: PushBackGeometry. But I got the error: Wrong number or type of arguments for overloaded function ‘Resqml2_PolylineSetRepresentation_pushBackGeometryPatch’.
But I’m putting the right variables maybe the most confusion part is understand the nodeCountPerPolyline and is Array 1D… of UNTINT. Anyone has experience creating RESQML with fault using FASAPI and could give me any advice. Already try different approaches without succeeds

Hi,
Which FESAPI programming language flavor do you use? C++? Java? C#? Python?

Hi, python and FASPI version 2.12.0

Arrays of numerical values in FESAPI are managed through some dedicated classes.
An example can be found here in block #5 : fesapi/python/example/fesapi.ipynb at master · F2I-Consulting/fesapi · GitHub

resqml_points = fesapi.DoubleArray(24)

Above is the creation of an array of 24 double values which you can set this way

resqml_points.setitem(i, i*100)

and use directly in a FESAPI method such as in

horizon_grid_2d_representation.setGeometryAsArray2dOfExplicitZ(resqml_points, 2, 3, hdf_proxy, …)

Here are all different arrays in FESAPI Python :

	%array_class(int64_t, Int64Array);
	%array_class(uint64_t, UInt64Array);
	%array_class(int32_t, Int32Array);
	%array_class(uint32_t, UInt32Array);
	%array_class(int16_t, Int16Array);
	%array_class(uint16_t, UInt16Array);
	%array_class(int8_t, Int8Array);
	%array_class(uint8_t, UInt8Array);
	%array_class(float, FloatArray);
	%array_class(double, DoubleArray);
	%array_class(bool, BoolArray);

In your case, you want to use UInt32Array for an array of UINT since UINT are 32 bits long.

I do exactly that for the two required arrays, as shown in the following lines

  • resqml_nodes = fesapi.UInt32Array(num_points_nodes)
  • resqml_points = fesapi.DoubleArray(num_points * 3)

I then populate both arrays with the data, and finally:
polyline_set_representation.pushBackGeometryPatch(resqml_nodes,resqml_points,num_points_nodes,False,hdf_proxy)

However, this last step results in the following error:
[9245](file:///…/Python311/Lib/site-packages/fesapi/init.py:9245) def pushBackGeometryPatch(self, *args) → “void”: →
[9246](file:///…/Python/Python311/Lib/site-packages/fesapi/init.py:9246) return _fesapi.Resqml2_PolylineSetRepresentation_pushBackGeometryPatch(self, *args) TypeError: Wrong number or type of arguments for overloaded function ‘Resqml2_PolylineSetRepresentation_pushBackGeometryPatch’. Possible C/C++ prototypes are: resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int *,double *,uint64_t,bool,eml2::AbstractHdfProxy *,eml2::AbstractLocal3dCrs *) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int *,double *,uint64_t,bool,eml2::AbstractHdfProxy *) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int *,double *,uint64_t,bool) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int *,double *,uint64_t,bool *,eml2::AbstractHdfProxy *,eml2::AbstractLocal3dCrs *) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int *,double *,uint64_t,bool *,eml2::AbstractHdfProxy *) resqml2::PolylineSetRepresentation::pushBackGeometryPatch(unsigned int *,double *,uint64_t,bool *)

The error suggests a mismatch in the number or types of arguments for the pushBackGeometryPatch() function. However, I have already provided all the arguments in the correct order.

It looks like a bug on FESAPI Python version side. I am on it and will let you know when I’ll find time to investigate exactly why.

1 Like

Thank you very much!

It actually looks more as an example bug where I forgot to cast the array.
The cast looks mandatory here maybe because Python cannot deduce the correct cast in case of overloaded methods…

Could you try to cast your arrays when used in a method please?
polyline_set_representation.pushBackGeometryPatch(resqml_nodes.cast(),resqml_points.cast(),num_points_nodes,False,hdf_proxy)
instead of
polyline_set_representation.pushBackGeometryPatch(resqml_nodes,resqml_points,num_points_nodes,False,hdf_proxy)

It works! I successfully created the fault in RESQML. Thank you very much for your help!