segmentation fault tesselating particle geometry

Asked by rhaven

Hi,
I am trying to tessellate particle geometry generated with Yade. For this purpose I am using the TwoPhaseFlowEngine.
When I run the TwoPhaseFlowEngine on geometry generated directly from makeCloud everything runs smoothly. However, when I try to run the TwoPhaseFlowEngine on geometry which I have generated to simulate an aggregate. I receive a segmentation fault. In order to track down this issue, I have written the code below.
This code reads a packing of 113 spheres. If I run the TwoPhaseFlowEngine at this point, there is no error, however looking at the exported pore network, only 8 pores are generated by the tesselation, and they are all located at the same location (see here: http://pasteall.org/1012264 )

In order to try and dig into the issue. I wrote the following code. First I load the sphere geometry. I try to run the tesselation. I then save the individual sphere locations and radii and add them back in one at a time to the simulation. At every step I try to run the tesselation. In this case, when I add the 5th particle I receive a Segmentation fault (core dumped) and the contents of PoreBodyLocation.txt is a list of 0,0,0 's .

from yade import export,ymport

sp = ymport.textClumps('/tmp/clump0.txt')
print('Number of particles = ' , len(O.bodies))

TwoPhase=TwoPhaseFlowEngine()
TwoPhase.initialization()
TwoPhase.savePoreNetwork('networkTest')
#raw_input('Pause')

spheres = []
for b in O.bodies:
 if b.isClump == False:
  spheres.append([b.state.pos, b.shape.radius])

O.resetThisScene()

for pos,r in spheres:
 O.bodies.append(sphere(pos,r))
 print('Number of particles = ' , len(O.bodies))
 #raw_input('Pause')
 TwoPhase.initialization()
 TwoPhase.savePoreNetwork('networkTest')

try:
 from yade import qt
 qt.View()
except:
 pass

and clump0.txt at http://pasteall.org/1012270

Does anyone know the reason for this segmentation fault, and or the reason for the pore locations = 0,0,0 ?

many thanks in advance
Jesse

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Is the question about O.resetThisScene()?
Else why is it here? Why not trying simple things first?
B

Revision history for this message
rhaven (rhavenj) said :
#2

Hi Bruno,
I am using O.resetThisScene() in order to try and figure out which sphere is causing the issue. I add spheres one at a time till the segmentation fault occurs.
Jesse

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

Doing your own experiments to understand the problem is good, but it is not the question here.
You never showed us the problem in a simple way until now (which means, namely, without O.resetThisScene() in the middle).
Hence I still have no real idea what your question is about.
B

Revision history for this message
rhaven (rhavenj) said :
#4

Hi Bruno,
thank you for the reply.

My question is about tesselation of the geometry. When I take a look at the pore locations after exporting with savePoreNetwork, they are 0,0,0. Ive created the MWE to show this. Something is going wrong with the tesselation or the export.
To track down the error I continued by trying to tesselate the geometry on sphere at a time. After adding the 5th sphere I get the segmentation fault.

many thanks
Jesse

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

>Something is going wrong with the tesselation or the export.

Right: there is a "or". And you can add a 3rd option: something wrong with the way tesselation and export interact.
Hence why I am not spending time on it.
I asked to remove O.reset(), it is now replaced by O.resetThisScene()...
Hopefully someone (not me) will have ample time to debug your script.
Make things simpler if you like.
Bruno

Revision history for this message
rhaven (rhavenj) said :
#6

Hi Bruno,
Thank you for the reply. Looking at the sourcecode in TwoPhaseFlowEngine I dont see a way to access the pore locations from python, is that correct?

Could you perhaps recommend another way that I might be able to find out the source of this issue (pore locations are 0,0,0)?
many thanks
Jesse

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#7
Revision history for this message
rhaven (rhavenj) said :
#8

Hi Bruno,
In order to find out if there is an issue with the tesselation, or if the issue is with the export (or both), I am wondering if there is a way to access the pore locations from python. If I can access the pore locations within my script, I can check if the locations are indeed being calculated as 0,0,0. If they are then the issue doesnt lie in the export of the tesselation data.

If this is not possible, is there perhaps another way of figuring out why the pore locations are being calculated as 0,0,0
many thanks
Jesse

Revision history for this message
Launchpad Janitor (janitor) said :
#9

This question was expired because it remained in the 'Open' state without activity for the last 15 days.