no view about qt.View() and yade.qt.Controller()
My yade is come from GitLib source, and cmake, make, make-install to my computer. I build a symbol link named "yadeImport".
The system can run very nice, if I use the command in terminal
"~/myYade/
But, today, I want run the code by script. the yade.qt.View(), yade.qt.
The problem is the same. The yade.qt.View() and yade.qt.
(1) How to get 3D view() by runing the script?
(2) If I cannot get the 3D process during simulation, how to save the date of each step of process, and replay after simulation?
Beacause my code is complex, I put the script-session2.py as below, the problem is the same.
# -*- coding: utf-8 -*-
from __future__ import print_function
from yade import pack
num_spheres=500
## corners of the initial packing
mn,mx=Vector3(
thick = 0.01
compFricDegree = 2
rate=0.2
damp=0.1
stabilityThresh
key='_define_
## create material #0, which will be used as default
O.materials.
O.materials.
## create walls around the packing
walls=aabbWalls
wallIds=
sp=pack.
sp.makeCloud(
volume = (mx[0]-
mean_rad = pow(0.09*
clumps=False
if clumps:
c1=pack.
sp.makeClumpCl
O.bodies.
standalone,
for clump in clumps:
O.bodies.
for i in clump[1:]: O.bodies[
#sp.toSimulation()
else:
O.bodies.
O.dt=.5*
O.usesTimeStepp
triax=ThreeDTri
maxMultiplier=
finalMaxMultip
thickness = thick,
stressControl_1 = False,
stressControl_2 = False,
stressControl_3 = False,
## Independant stress values for anisotropic loadings
goal1=-10000,
goal2=-10000,
goal3=-10000,
internalCompac
Key=key,
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax,
TriaxialStateR
newton
]
#Display spheres with 2 colors for seeing rotations better
Gl1_Sphere.
yade.qt.
while 1:
O.run(1000, True)
#the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium
unb=unbalance
#average stress
#note: triax.stress(k) returns a stress vector, so we need to keep only the normal component
meanS=
print('unbalanced force:',unb,' mean stress: ',meanS)
if unb<stabilityTh
break
O.save(
print("### Isotropic state saved ###")
#let us turn internal compaction off...
triax.internalC
#
triax.setContac
#... and make stress control independant on each axis
triax.stressCon
# We have to turn all these flags true, else boundaries will be fixed
triax.wall_
triax.wall_
triax.wall_
triax.wall_
triax.wall_
triax.wall_
#If we want a triaxial loading at imposed strain rate, let's assign srain rate instead of stress
triax.stressCon
triax.strainRat
triax.strainRat
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- yang yi
- Solved:
- Last query:
- Last reply: