VTKRecorder: Aborted (core dumped)

Asked by Jiannan Wang

Hello,

I'm trying to inject water into aJCFpm. It is working fine until I enable the VTKRecorder, I got the following error:

python3.6: /build/vtk6-VHOYAG/vtk6-6.3.0+dfsg1/IO/XML/vtkXMLOffsetsManager.h:142: void OffsetsManagerGroup::Allocate(int, int): Assertion `numElements > 0' failed.
Aborted (core dumped)

My Yade version: try both compiled from the source and yadedaily, same error
Linux version: Ubuntu 18.04.4 LTS

Did I miss anything? Thanks.

Best
Jiannan

Here is the script:
#############
from builtins import range
from yade import pack,plot,utils
import math

intR=0.1
DENS=2500
YOUNG=1800
FRICT=7
ALPHA=0.1
TENS=100
COH=1000
iterper=100

O.materials.append(JCFpmMat(type=1,density=DENS,young=YOUNG,poisson=ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH,label='mat1'))

mn,mx=Vector3(0,0,0),Vector3(1,2,1) # corners of the initial packing
walls=aabbWalls([mn,mx],thickness=0,material='mat1')
wallIds=O.bodies.append(walls)
sps=SpherePack() sp=pack.randomDensePack(pack.inAlignedBox(mn,mx),spheresInCell=2000,radius=1/20.,returnSpherePack=True)
O.bodies.append([sphere(s[0],s[1],color=(0.6+0.15*rand(),0.5+0.15*rand(),0.15+0.15*rand()),material='mat1') for s in sp])

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb()]),
    InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR)],
     [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
     [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=True,label='interactionLaw', recordCracks=True, recordMoments=True,Key='identifier',momentRadiusFactor=5,neverErase=True),Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    DFNFlowEngine(dead=1,label="flow"),
    GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5, defaultDt=utils.PWaveTimeStep()),
    NewtonIntegrator(damping=0.1),
]

flow.dead=0
flow.defTolerance=0.3
flow.meshUpdateInterval=1
flow.updateTriangulation=True
flow.breakControlledRemesh=True
flow.imposePressure(Vector3(0.5,1,0),30000000)
O.dt=0.1e-5
O.dynDt=False

O.engines=O.engines+[VTKRecorder(Key='identifier',label='vtk',iterPeriod=iterper,initRun=True,fileName='output-',recorders=['moments','spheres','intr','stress','velocity','bstresses','jcfpm', 'cracks'])]
######################

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jiannan Wang
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

>My Yade version: try both compiled from the source and yadedaily, same error

The script you provided has DFNFlowEngine, which is not compiled in yadedaily. If you are seeing this error with a yadedaily install, that means DFNFlow has nothing to do with it. Is this correct? Can you please provide the script that you use to reproduce the error with yadedaily?

Revision history for this message
Jiannan Wang (jnwang) said :
#2

Hello Robert,

Thank you for the swift response. Sorry about the confusion: when I use DFNFlowEngine, I just run the compiled source version (as you suggest in anther thread [1]). Then I switch DFNFlowEngine to FlowEngine and run with both the compiled source version and the yadedaily. The script that I use to reproduce the error with yadedaily is just replace DFNFlowEngine with FlowEngine, everything else is the same.

Also, I also tried removing the FlowEngine/DFNFlowEngine (no fluid at all). I also got the same error.

[1]https://answers.launchpad.net/yade/+question/689755

Revision history for this message
Robert Caulk (rcaulk) said :
#3

Great, can you go ahead and paste the MWE here? MWE would include as few lines as possible, would not include anything extraneous (e.g. FlowEngine) and will run on yadedaily.

Revision history for this message
Jiannan Wang (jnwang) said :
#4

Hello Robert,

Absolutely. Here is my MWE. Thanks.

Best
Jiannan Wang

#############
from builtins import range
from yade import pack,utils
import math

O.materials.append(JCFpmMat(type=1,density=2500,young=1800,poisson=0.1,frictionAngle=radians(7),tensileStrength=100,cohesion=1000,label='mat'))

mn,mx=Vector3(0,0,0),Vector3(1,2,1)
walls=aabbWalls([mn,mx],thickness=0,material='mat')
wallIds=O.bodies.append(walls)
sps=SpherePack() sp=pack.randomDensePack(pack.inAlignedBox(mn,mx),spheresInCell=2000,radius=1/20.,returnSpherePack=True)
O.bodies.append([sphere(s[0],s[1],color=(0.6+0.15*rand(),0.5+0.15*rand(),0.15+0.15*rand()),material='mat1') for s in sp])

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb()]),
    InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR)],
     [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
     [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=True,label='interactionLaw', recordCracks=True, recordMoments=True,Key='identifier',momentRadiusFactor=5,neverErase=True),Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    GlobalStiffnessTimeStepper(active=1,timestepSafetyCoefficient=0.5),
    NewtonIntegrator(damping=0.1),
]

O.engines=O.engines+[VTKRecorder(Key='identifier',label='vtk',iterPeriod=iterper,initRun=True,fileName='output-',recorders=['moments','spheres','intr','stress','velocity','bstresses','jcfpm', 'cracks'])]
######################

Revision history for this message
Robert Caulk (rcaulk) said :
#5

The MWE does not reproduce the error you describe. It has syntax errors:

>>>>
    sps=SpherePack() sp=pack.randomDensePack(pack.inAlignedBox(mn,mx),spheresInCell=2000,radius=1/20,returnSpherePack=True)
                      ^
SyntaxError: invalid syntax
>>>>

after fixing that I get:

>>>>
O.bodies.append([sphere(s[0],s[1],color=(0.6+0.15*rand(),0.5+0.15*rand(),0.15+0.15*rand()),material='mat1') for s in sp])
NameError: name 'rand' is not defined
>>>

Please provide an MWE [1].

[1]https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
Jiannan Wang (jnwang) said :
#6

Hello Robert,

I'm sorry about the missing lines. I just added them back. It should be fine this time. Thank you again for the helps.

I think I know where it gave me the error, but I don't know why.... Only when I add:
from yade import qt
v=qt.View()

Things went wrong. Otherwise it works OK. Seems qt.View() and VTKRecorder cannot co-exist... Could you give me some advise?

Best
Jiannan Wang

#############
from builtins import range
from yade import pack,utils
import math
from pylab import rand

O.materials.append(JCFpmMat(type=1,density=2500,young=1800,poisson=0.1,frictionAngle=radians(7),tensileStrength=100,cohesion=1000,label='mat'))

mn,mx=Vector3(0,0,0),Vector3(1,2,1)
walls=aabbWalls([mn,mx],thickness=0,material='mat')
wallIds=O.bodies.append(walls)
sps=pack.SpherePack()
sp=pack.randomDensePack(pack.inAlignedBox(mn,mx),spheresInCell=2000,radius=1/20,returnSpherePack=True)
sp.toSimulation(material='mat')

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb()]),
    InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR)],
     [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
     [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=True,label='interactionLaw', recordCracks=True, recordMoments=True,Key='identifier',momentRadiusFactor=5,neverErase=True),Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    GlobalStiffnessTimeStepper(active=1,timestepSafetyCoefficient=0.5),
    NewtonIntegrator(damping=0.1),
]

from yade import qt
v=qt.View()

O.engines=O.engines+[VTKRecorder(Key='identifier',label='vtk',iterPeriod=iterper,initRun=True,fileName='output-',recorders=['moments','spheres','intr','stress','velocity','bstresses','jcfpm', 'cracks'])]
######################

Revision history for this message
Robert Caulk (rcaulk) said :
#7

> It should be fine this time.

Please test your scripts. It still has undefined variables and syntax errors.

Revision history for this message
Jiannan Wang (jnwang) said :
#8

Hello Robert,

Oops... Sorry about the missing variable, again. The following MWE runs as expected. Thank you.

Best
Jiannan Wang

######################3
from builtins import range
from yade import pack,utils
import math
from pylab import rand

O.materials.append(JCFpmMat(type=1,density=2500,young=1800,poisson=0.1,frictionAngle=radians(7),tensileStrength=100,cohesion=1000,label='mat'))

mn,mx=Vector3(0,0,0),Vector3(1,2,1)
walls=aabbWalls([mn,mx],thickness=0,material='mat')
wallIds=O.bodies.append(walls)
sps=pack.SpherePack()
sp=pack.randomDensePack(pack.inAlignedBox(mn,mx),spheresInCell=2000,radius=1/20,returnSpherePack=True)
sp.toSimulation(material='mat')

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1)]),
    InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1)],
     [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
     [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=True,label='interactionLaw', recordCracks=True, recordMoments=True,Key='identifier',momentRadiusFactor=5,neverErase=True),Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    GlobalStiffnessTimeStepper(active=1,timestepSafetyCoefficient=0.5),
    NewtonIntegrator(damping=0.1),
]

from yade import qt
v=qt.View()

O.engines=O.engines+[VTKRecorder(Key='identifier',label='vtk',iterPeriod=100,initRun=True,fileName='output-',recorders=['moments','spheres','intr','stress','velocity','bstresses','jcfpm', 'cracks'])]

######################

Revision history for this message
Robert Caulk (rcaulk) said :
#9

I ran your script with yadedaily (latest) and did not encounter the error you describe.

After how many iterations do you see the error?

Revision history for this message
Jiannan Wang (jnwang) said :
#10

Hello Robert,

That's very odd. Once I start, the error shows up immediately.

Should I provide more system information or is there anyway I can check I may be missing beside the script itself?

Thank you again.

Best
Jiannan Wang

Revision history for this message
Janek Kozicki (cosurgi) said :
#11

If yade version is recent enough, you could provide the output of command:

printAllVersions()

or:

yade.libVersions.printAllVersions()

Revision history for this message
Jiannan Wang (jnwang) said :
#12

Hello Janek,

Thank you for willing to help. Here is the output. Let me know if there is anything I should provide.

Best
Jiannan Wang
##################
Yade version : 20200518-3844~fb69be8~bionic1
Yade features : BoostLog PrecisionDouble Odeint VTK OpenMP GTS GUI-Qt5 CGAL PFVFLOW PFVFLOW LINSOLV MPI TWOPHASEFLOW FEMLIKE GL2PS LBMFLOW THERMAL PotentialParticles PotentialBlocks
Yade config dir: ~/.yadedaily
Yade precision : 64 bits, 15 decimal places, without mpmath
```

Libraries used :

| library | cmake | C++ |
| ------------- | -------------------- | ------------------- |
| boost | 106501 | 1.65.1 |
| cgal | | 4.11 |
| clp | 1.16.11 | 1.16.11 |
| cmake | 3.10.2 | |
| coinutils | 2.10.14 | 2.10.14 |
| compiler | /usr/bin/c++ 7.5.0 | gcc 7.5.0 |
| eigen | 3.3.4 | 3.3.4 |
| freeglut | 2.8.1 | |
| gl | | 20190611 |
| ipython | 5.5.0 | |
| metis | | 5.1.0 |
| mpi | 3.1 | ompi:2.1.1 |
| mpi4py | 2.0.0 | |
| openblas | | OpenBLAS 0.2.20 |
| python | 3.6.9 | 3.6.9 |
| qglviewer | | 2.6.3 |
| qt | | 5.9.5 |
| sphinx | 1.6.7-final-0 | |
| sqlite | | 3.22.0 |
| suitesparse | 5.1.2 | 5.1.2 |
| vtk | 6.3.0 | 6.3.0 |

Linux version: Ubuntu 18.04.4 LTS
#########################

Revision history for this message
Janek Kozicki (cosurgi) said :
#13

I did run your script from post number #8 in this thread, for 2000 iterations. It didn't crash. I used the same clean install of ubuntu as you. Maybe you did some experimenting inside VTK?

```
Yade version : 2020-05-16.git-fb69be8
Yade features : BoostLog PrecisionDouble Odeint VTK OpenMP GTS GUI-Qt5 CGAL PFVFLOW PFVFLOW LINSOLV MPI TWOPHASEFLOW FEMLIKE GL2PS LBMFLOW THERMAL PotentialParticles PotentialBlocks
Yade config dir: ~/.yade-2020-05-16.git-fb69be8
Yade precision : 64 bits, 15 decimal places, without mpmath
```

Libraries used :

| library | cmake | C++ |
| ------------- | -------------------- | ------------------- |
| boost | 106501 | 1.65.1 |
| cgal | | 4.11 |
| clp | 1.16.11 | 1.16.11 |
| cmake | 3.10.2 | |
| coinutils | 2.10.14 | 2.10.14 |
| compiler | /usr/bin/g++ 7.5.0 | gcc 7.5.0 |
| eigen | 3.3.4 | 3.3.4 |
| freeglut | 2.8.1 | |
| gl | | 20190611 |
| ipython | 5.5.0 | |
| metis | | 5.1.0 |
| mpi | 3.1 | ompi:2.1.1 |
| mpi4py | 2.0.0 | |
| openblas | | OpenBLAS 0.2.20 |
| python | 3.6.9 | 3.6.9 |
| qglviewer | | 2.6.3 |
| qt | | 5.9.5 |
| sphinx | 1.6.7-final-0 | |
| sqlite | | 3.22.0 |
| suitesparse | 5.1.2 | 5.1.2 |
| vtk | 6.3.0 | 6.3.0 |

Linux version: Ubuntu 18.04.4 LTS

Revision history for this message
Jiannan Wang (jnwang) said :
#14

Hello Janek,

Thank you for the help. I don't recall doing experiment inside VTK, maybe I did but was aware of? Do you think reinstall would help?

Anyway, I'll mark this question as solved since it appears be my own problem. Thank you guys again.

Best
Jiannan Wang

Revision history for this message
Robert Caulk (rcaulk) said :
#15

You should check to make sure you have write privileges in the directory you are trying to write to. Then you should check to make sure there is storage capacity in that directory.

ls -l /yourDirHere

df -h

Revision history for this message
Robert Caulk (rcaulk) said :
#16

also provide output of ls -ld /yourDirHere

Revision history for this message
Jiannan Wang (jnwang) said :
#17

Hello Robert,

Thank you for the advice. Probably not the space and write privilege issue since I tested the MWE on ~/Desktop. Here is the output of ls -ld and df -h:

##############
drwxr-xr-x 13 odisi odisi 12288 May 22 11:35 /home/odisi/Desktop
#############
odisi@odisi-linux-1:~/Desktop$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 2.3M 3.2G 1% /run
/dev/nvme0n1p3 463G 132G 309G 30% /
tmpfs 16G 146M 16G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/loop1 141M 141M 0 100% /snap/gnome-3-26-1604/92
/dev/loop3 141M 141M 0 100% /snap/gnome-3-26-1604/98
/dev/loop2 157M 157M 0 100% /snap/gnome-3-28-1804/110
/dev/loop4 2.3M 2.3M 0 100% /snap/gnome-system-monitor/145
/dev/loop5 94M 94M 0 100% /snap/core/8935
/dev/loop6 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop8 7.9M 7.9M 0 100% /snap/evince/391
/dev/loop7 94M 94M 0 100% /snap/core/9066
/dev/loop9 3.8M 3.8M 0 100% /snap/gnome-system-monitor/135
/dev/loop13 243M 243M 0 100% /snap/gnome-3-34-1804/27
/dev/loop12 7.9M 7.9M 0 100% /snap/evince/290
/dev/loop11 1.0M 1.0M 0 100% /snap/gnome-logs/93
/dev/loop10 55M 55M 0 100% /snap/gtk-common-themes/1502
/dev/loop14 384K 384K 0 100% /snap/gnome-characters/539
/dev/loop17 55M 55M 0 100% /snap/core18/1754
/dev/loop15 256M 256M 0 100% /snap/gnome-3-34-1804/33
/dev/nvme0n1p1 776M 53M 724M 7% /boot/efi
/dev/loop18 2.5M 2.5M 0 100% /snap/gnome-calculator/748
/dev/loop19 15M 15M 0 100% /snap/gnome-characters/495
/dev/loop20 161M 161M 0 100% /snap/gnome-3-28-1804/116
/dev/loop21 1.0M 1.0M 0 100% /snap/gnome-logs/100
/dev/loop22 55M 55M 0 100% /snap/core18/1705
/dev/loop23 2.5M 2.5M 0 100% /snap/gnome-calculator/730
tmpfs 3.2G 16K 3.2G 1% /run/user/120
tmpfs 3.2G 36K 3.2G 1% /run/user/1001
#######################