Rotate cylinder
Hi,
How can I rotate this half cylinder 90 degrees in y-axis:
#Cylinderpunch
cyl1 =geom.facetCyli
cyl1 = [f for f in cyl1 if f.state.pos[0] < 0] # "half-cylinder"
cyl1=O.
for j in cyl1:
body= O.bodies[j]
body.
I tried this, but it did not move my cylinder.
Here is my code:
#!/usr/bin/env python
#encoding: ascii
# Testing of the Deformation Enginge with Luding Contact Law
# Modified Oedometric Test
from yade import utils, plot, timing
from yade import pack
import pandas as pd
o = Omega()
# Physical parameters
fr = 0.52
rho = 1050 #kg/m3
Diameter = 0.0079 #79 micrometer
r1 = Diameter
r2 = Diameter
k1 = 126000.0
kp = 12.0*k1
kc = k1 * 0.1
ks = k1 * 0.1
DeltaPMax = Diameter/3.0
Chi1 = 0.34
o.dt = 1.0e-5
particleMass = 4.0/3.0*
Vi1 = math.sqrt(
PhiF1=0.999
#PhiF1 = DeltaPMax*
#******
# Add material
mat1 = O.materials.
# Spheres for compression
# Spheres for compression
sp=pack.
sp.makeCloud(
#Cylinder cloud sphere pack
cyl = pack.inCylinder
sp = pack.filterSphe
sp.toSimulation
##No of particles
count = 0
for b in O.bodies:
if isinstance(b.shape, Sphere):
count +=1
##Mass of particles
n_p=count
#######
walls=O.
#height=0.067
##Top punch##
#find max Z coordinate of your cloud
max_z = aabbExtrema()[1][2]
min_z = aabbExtrema()[0][2]
#Top_punch=
#O.bodies[
#Cylinderpunch
cyl1 =geom.facetCyli
cyl1 = [f for f in cyl1 if f.state.pos[0] < 0] # "half-cylinder"
cyl1=O.
for j in cyl1:
body= O.bodies[j]
body.state.
for i in cyl1:
body= O.bodies[i]
body.state.vel = (0,1,0)
df = pd.DataFrame(
df.to_csv(
from csv import writer
def append_
# Open file in append mode
with open(file_name, 'a+', newline='') as write_obj:
# Create a writer object from csv module
csv_writer = writer(write_obj)
# Add contents of list as last row in the csv file
# Add engines
o.engines = [
ForceResetter(),
InsertionSort
InteractionLoop(
[Ig2_
Ig2_
Ig2_
[Ip2_
[Law2_
),
NewtonIntegra
#VTKRecorder(
#PyRunner(
#PyRunner(
PyRunner(
PyRunner(
DeformControl
]
def checkdata():
if O.iter < 20000:
return
else:
time=o.realtime
porosity=
Maxoverlap=
stress=
row_contents = [time,time,
append_
def checkForce():
# at the very start, unbalanced force can be low as there is only few
# contacts, but it does not mean the packing is stable
if O.iter < 20000:
return
# the rest will be run only if unbalanced is < .1 (stabilized packing)
timing.reset()
if unbalancedForce() > 0.2:
return
# add plate at upper box side
highSphere = 0.0
for b in O.bodies:
if highSphere < b.state.pos[2] and isinstance(b.shape, Sphere):
else:
pass
O.bodies.
# without this line, the plate variable would only exist inside this
# function
global plate
plate = O.bodies[-1] # the last particles is the plate
# Wall objects are "fixed" by default, i.e. not subject to forces
# prescribing a velocity will therefore make it move at constant velocity
# (downwards)
plate.state.vel = (0, 0, -0.01)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: