When adding O.wait(), the graphical interface is black
I set a target porosity as a stop criterion and used O.run() to run simulation. In order to avoid the influence of the later Python code, I added O.wait(). However, after adding this command, the graphical interface will be black until it reaches the stop criterion. Is there any way to make the graphical interface display graphics.
Another question, when I run my code, the following warning appears:
/usr/lib/
mplDeprecation)
/usr/lib/
mplDeprecation)
Why does this happen?
Here is my code:
##______________ First section, generate sample_________
from __future__ import print_function
from yade import pack, qt, plot
from math import *
nRead=readParam
## model parameters
## material parameters
young=2e8,
poisson=.2,
alphaKtw=0,
competaRoll=.22,
etaTwist=0,
## fluid parameters
## control parameters
damp=0,
## output specifications
)
from yade.params.table import *
O.periodic=True
O.cell.
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the momentRotationL
O.materials.
# generate particles packing
sp=pack.
sp.makeCloud(
sp.toSimulation
O.engines=[
),
# specify target values and whether they are strains or stresses
# type of servo-control, the strain rate isn't determined, it shloud check the unbalanced force
# wait until the unbalanced force goes below this value
),
]
qt.View()
# enable energy tracking in the code
O.trackEnergy=True
# define function to record history
def history():
plot.
)
O.engines=
# define what to plot
plot.plots=
plot.live=True
plot.setLiveFor
# show the plot
plot.plot()
import sys
def compactionFinis
#check the current porosity
# if the current porosity is lager than target Porosity and comFricDegree is lager than 10,
# then we decrease friction value and apply it to all the bodies and contacts,
# else we decrease rolling friction value.
global compFricDegree, competaRoll
if porosity(
# we decrease friction value and apply it to all the bodies and contacts
# python syntax, make each step printout
elif porosity(
# we decrease rolling fiction value and apply it to all the bodies and contacts
for b in O.bodies:
for i in O.interactions:
else:
# after sample preparation, save the state
# next time, called python command
O.pause()
O.run()
O.wait()
plot.saveDataTx
##_____
# change the contact parameters to the final calibration value
setContactFrict
for b in O.bodies:
b.mat.
for i in O.interactions:
i.phys.
print(O.
# set the current cell configuration to be the reference one
O.cell.
O.run(1,True)
print(O.cell.trsf, triax.strain)
# change control type: keep constant confinement in x,y, 30% compression in z
triax.goal=
triax.stressMask=3
# allow faster deformation along x,y to better maintain stresses
triax.maxStrain
# call triaxFinished instead of compactionFinished
triax.doneHook=
def triaxFinished():
O.save(
print(
O.pause()
# Reset all plot data; keep plots and labels intact
plot.reset()
O.run(1000,True)
plot.saveDataTx
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Zhicheng Gao
- Solved:
- Last query:
- Last reply: