Simulation abnormal stop “terminate called after throwing an instance of 'std::bad_alloc'” with Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM.recordMoments
Hi all,
I am trying to continue my simulation on a single particle breakage, and I used a script based on the brazilian.py[1] but changed to JCFmat materials. When I start the simulation, the simulation will stop at a certain step ( I check it with O.iter), just like falling into an endless loop. The specific specific number of steps is uncertain, sometimes occur at early stage and sometimes at middle stage, so it really bother me. Then the simulation will crush with the information:
"terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)"
Maybe that is because memory is exhausted, but I can not figure out why it happened. Therefore, I want to some help.
[1]\trunk\
The scripts as following :
from __future__ import print_function
import math
# default parameters or from table
# generate paremters,
frictionAngle = radians(30)
# Sphere model setting
intRadius = 1.3
dtSafety = .8
strainRate = 1
specimenLength = .15
specimenRadius = .05
sphereRadius = 3.5e-3
# paramters for wall
# paramters for clump
xsize = sphereRadius * 20;
ysinze = sphereRadius * 20;
zsize = specimenRadius * 5;
# material
plate_material = JCFpmMat(
sphere_material = JCFpmMat(young=4e9, cohesion=.4e8 * 0.05, density=1400, frictionAngle=
O.materials.
O.materials.
# spheres
pred = pack.inSphere(
sp = pack.randomDens
sp.toSimulation
# loading part
zMin, zMax = [pt[2] for pt in aabbExtrema()]
wallIDs = O.bodies.
walls = wallMin, wallMax = [O.bodies[i] for i in wallIDs]
v = strainRate * 2 * specimenRadius
wallMin.state.vel = (0, 0, +v)
wallMax.state.vel = (0, 0, -v)
# engines
O.engines = [
ForceResett
InsertionSo
Interaction
),
GlobalStiff
# VTKRecorder(
NewtonInteg
PyRunner(
]
# plot stuff
def addPlotData():
# forces of walls. f1 is "down", f2 is "up" (f1 needs to be negated for evlauation)
f1, f2 = [O.forces.f(i)[2] for i in wallIDs]
f1 *= -1
# average force
f = .5 * (f1 + f2)
# displacement (2 times each wall)
wall = O.bodies[
dspl = 2 * wall.state.
# stress (according to standard brazilian test evaluation formula)
stress = f / (pi * specimenRadius * specimenLength)
# store values
yade.
t=O.time,
i=O.iter,
dspl=dspl,
f1=f1,
f2=f2,
f=f,
)
# plot dspl on x axis, stress on y1 axis and f,f1,f2 in y2 axis
plot.plots = {'dspl': ('stress', None, 'f1', 'f2', 'f')}
O.dt = 0.
O.step() # to create initial contacts
# now reset the interaction radius and go ahead
ss2sc.interacti
is2aabb.
# time step
O.dt = dtSafety * PWaveTimeStep()
# run simulation
plot.plot()
# O.run()
###
BTW, I am using this version yade-2022-03-18.git
Thanks in advance for your respopnse!
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: