yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #29058
[Question #705741]: Aborted (core dumped) when using VTKRecorder
New question #705741 on Yade:
https://answers.launchpad.net/yade/+question/705741
In addtion to the previous question (https://answers.launchpad.net/yade/+question/705740),
Yade gives following errors when using VTKRecorder regardless of using GlobalStiffnessTimeStepper
===
python3.10: ./pkg/common/InsertionSortCollider.hpp:125: yade::InsertionSortCollider::Bounds& yade::InsertionSortCollider::VecBounds::operator[](long int): Assertion `idx < long(size()) && idx >= 0' failed.
Aborted (core dumped)
===
MWE
=== CBT_P2.py
from yade import pack, plot
import sys
sys.path.append('/home/jinsun/Dropbox/Yadee/PARAVIEW')
O.load("CDSS_box_1.yade")
loadVars('geoms')
from yade.params.geoms import * # load initilized variables
O.materials.append(FrictMat(young=20e6, poisson=0.17, density=2700, frictionAngle=0.523, label='frictmat'))
#O.materials.append(FrictMat(young=70e9, poisson=0.17, density=2300, frictionAngle=0.523, label='frictmat')) # silica https://www.azom.com/properties.aspx?ArticleID=1114
cp1 = (-width/2,-width/2,3*height) #corner point #1
cp2 = (width/2,width/2,2*height+3*height/2) #corner point #2
radius_mean = 0.002
sp = pack.SpherePack()
sp.makeCloud(cp1, cp2, rMean=radius_mean, rRelFuzz=0.0, num = 10000)
sp.toSimulation(color=(0,0,1)) # pure blue
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()], # collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()] # contact law -- apply forces
),
# Apply gravity force to particles. damping: numerical dissipation of energy.
# GlobalStiffnessTimeStepper(active=True, timestepSafetyCoefficient=0.8, timeStepUpdateInterval=1000, label = 'timeStepper'),
NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.5),
VTKRecorder(fileName='spheres/3d-vtk-', recorders=['spheres', 'intr', 'facets', 'colors'], iterPeriod=100),
PyRunner(command='addData()', iterPeriod=1000),
PyRunner(command='checkUnbalanced()', iterPeriod=1000),
PyRunner(command='addPlotData()', iterPeriod=1000),
# DomainLimiter(lo=(-width,-width,-height), hi=(width,width,5*height), iterPeriod = 10000, label = 'Domain') # destroy balls outside domain in every 100 steps
]
def addData():
for b in O.bodies:
b.shape.color=scalarOnColorScale(b.state.vel.norm(),0.0,1e-1)
elapsed_time=0.0
def checkUnbalanced():
# print(unbalancedForce())
global elapsed_time
if (O.time-elapsed_time) > 1.0:
ball_highest_z = numpy.max([b.state.pos[2] for b in O.bodies if isinstance(b.shape,Sphere)]) # make list of ball z position if body is sphere and find max value
print("The highest ball position is = ", ball_highest_z)
if ball_highest_z < height/2:
sp.makeCloud(cp1, cp2, rMean=radius_mean, rRelFuzz=0.0, num = 10000)
sp.toSimulation(color=(0,0,1)) # pure blue
print("Total number of balls =", len(O.bodies))
elapsed_time=O.time
else:
O.pause(); print("simulation paused")
O.save("CDSS_ball_2.yade")
# plotting
def addPlotData():
plot.addData(i=O.iter, unbalanced=unbalancedForce())
plot.plots={'i':('unbalanced')}
plot.plot()
O.dt=0.5*PWaveTimeStep()
O.run() #; O.wait()
--
You received this question notification because your team yade-users is
an answer contact for Yade.