How to pause
Thanks to Jean, I was able to come this far. First of all, thank you Jean.
I am doing an analysis on a direct(simple) shear test.
I have created a program like below.
Next, I want idsCyl2 to move not only in the X direction, but also in the Y direction. In the future, I would like to input seismic waveforms in the XY direction as well.
Now, after moving idsCyl2 (O.bodies[
For example, the locus for dsCyl2 is (0.020, 0) ⇒ (0.020, 0.020) ⇒ (-0.020, 0.020) ⇒ (-0.020, -0.020) ⇒ (0.020, -0.020).
At that time, to run idsCyl2= on Yade's terminal, redefine the engine and enter it. So is there a way to pause the analysis when (0.020 , 0) is reached?
Of course I know how to do it with O.pause() and an input file
def checkDistortion():
If O.bodies[
I tried to input, but the analysis itself stopped and I could not move to (0.020, 0.020).
Also, in Yade's terminal
If O.bodies[
But it just gets cylDisplacementx at that point and doesn't pause when it reaches (0.020, 0).
Is there a way to move idsCyl2 in the X direction (0.020,0) and pause it?
#######
from __future__ import print_function
from yade import pack,plot,
from yade import export,qt
from yade.gridpfacet import *
import math
import numpy as np
import os
frictangle = np.radians(25)#45do
density = 3400.0
young = 3e8
gravity = (0.0, 0.0, 0)
velocity_cyl=1
velocity_
velocity_cyl_Box=1
# create cloud of spheres and insert them into the simulation
# we give corners, mean radius, radius variation
#######
#Create sphere
#######
mat_sp = CohFrictMat(
O.materials.
pred=pack.
sp0=pack.
O.bodies.
#######
#Boundary creation
#######
idsCyl1 = O.bodies.
idsCyl2 = O.bodies.
#idsCyl3 = O.bodies.
radius1 = .06
radius2 = .15
fixBoxIds=[]
moveBoxIds=[]
i=0
for i in range(0,365,5):
r = math.radians(i)
x1 = radius1 * math.cos(r)
y1 = radius1 * math.sin(r)
x2 = radius2 * math.cos(
y2 = radius2 * math.sin(
x3 = radius2 * math.cos(
y3 = radius2 * math.sin(
x4 = radius1 * math.cos(
y4 = radius1 * math.sin(
x5 = radius1 * math.cos(
y5 = radius1 * math.sin(
x6 = radius2 * math.cos(r)
y6 = radius2 * math.sin(r)
fixBoxIds.
fixBoxIds.
moveBoxIds.
moveBoxIds.
upper_plate=
upper_plateID=
O.bodies[
#O.forces.
O.forces.
#######
#engines
#######
O.engines = [
# interaction loop
),
#PyRunner(
]
def checkStress1():
cylDisplacement_x = O.bodies[
cylDisplacement_y = O.bodies[
plot.addData(
cylDisplacemen
cylDisplacemen
)
print(
#######
#output
#######
sp_num = len([b for b in O.bodies if isinstance(b.shape, Sphere)]) # 粒子の総数をカウント
print("number of spheres = ",sp_num)
O.dt=0.
def plotPlotData():
pipe_force_x = sum([O.
pipe_force_y = sum([O.
cylDisplacementx = O.bodies[
cylDisplacementy = O.bodies[
cylDisplacementz = O.bodies[
Dz=upper_
plot.addData(
i=O.iter,
disp=O.
force_
force_
Dz=Dz,
cylDisplacemen
cylDisplacemen
cylDisplacemen
)
plot.saveDataT
'Dz',
'
))
"""
def checkStress2():
if O.bodies[
O.pause()
"""
plot.plots={
'disp'
'i':('Dz'),
'cylDisplaceme
}
plot.plot()
#plot.saveDataT
#######
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- 内山康太郎
- Solved:
- Last query:
- Last reply: