I found my mistake, I did not use the right way the API.
The
Model.CrossSection.* variables are not 2D arrays, but a collection of 1D arrays, which is consistent with the fact that cross sections are not always described by the same number of points.
In my old script, I used the method
get_var_size as follows:
mascaret.get_var_size('Model.CrossSection.X') # returns (2, 6, 0)
In my new script, I used the same method but with its second argument, allowing me to select the cross section I want:
mascaret.get_var_size('Model.CrossSection.X', 0) # returns (2, 6, 0)
mascaret.get_var_size('Model.CrossSection.X', 1) # returns (2, 8, 0)
Here, the second value of each returned tuple is what I expected.
The new script giving the expected values is attached and gives the following result:
> Model.CrossSection.X
[array([-2.5, -2.5, -2.5, 2.5, 2.5, 2.5]), array([-3.5, -3.5, -2.5, -2.5, 2.5, 2.5, 3.5, 3.5])]
> Model.CrossSection.Y
[array([ 14.5, 4.5, 0.5, 0.5, 4.5, 14.5]), array([ 15., 5., 4., 0., 0., 4., 5., 15.])]