[Bug report] Python flowknotarray crashes 3DEC


Recently, I encountered a bug when working with flowknots in 3DEC: any access to groups through the Python flowknotarray API makes the session crash.
I provide a demo Python script below.

Hopefully, this correction could be integrated in future updates?
Note that it is not a blocking bug since we can still manipulate flowknots through Fish, but the array-wise Python control logic feels handier to me!



PS: flowplanearray raises the same issue, while other arrays work fine.

""" A test case demonstrating flowknotarray buggy behavior """
import numpy as np

import itasca as it


model config fluid

block create brick test
block cut joint-set

block zone gen edge 0.5

block zone cmodel assign elastic
block zone property density 2600 young 5.e9 poisson 0.25

block fluid property density 1000 bulk 2.e9 viscosity 1.e-3

flowknot group 'side=xmax' range position-x 0.99, 1.01


fkids = it.flowknotarray.ids()

# Extras API works fine
demo = np.ones_like(it.flowknotarray.ids(), dtype=float)
it.flowknotarray.set_extra(1, demo)
assert (it.flowknotarray.extra(1)==demo).all()

# # Groups API makes 3DEC session crash
# # - Reading
# side_xmax = it.flowknotarray.in_group('xmax', 'side')
# # - Writing
# dummy_group = fkids < 10
# it.flowknotarray.set_group(dummy_group, 'true', 'dummy')

# The same goes with flowplanes: extras ok but groups crash session

Hi Theo,
Thanks for reporting. This issue has been fixed.

Hi @Huy .

Thanks a lot for the feedback!


@Huy Do you happen to know when the corresponding update will be available? I’m waiting for the next subversion, since a different bug I reported was allegedly fixed over three weeks ago, but still no update is available.

Sorry, I don’t. @jhazzard may have the answer.