~yade-dev/yade/0.80

« back to all changes in this revision

Viewing changes to examples/WireMatPM/wirepackings.py

  • Committer: Anton Gladky
  • Date: 2012-05-02 21:50:42 UTC
  • Revision ID: gladky.anton@gmail.com-20120502215042-v1fa9r65usqe7kfk
0.80.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# encoding: utf-8
 
2
from yade import qt
 
3
 
 
4
#### short description of script
 
5
print 'This script shows the use of the function hexaNet of module pack (interactions are not initialised)'
 
6
 
 
7
#### define parameters for the net
 
8
# mesh geometry
 
9
mos = 0.08
 
10
a = 0.04
 
11
b = 0.04
 
12
# wire diameter
 
13
d = 2.7/1000.
 
14
# net dimension
 
15
Lx = 0.2
 
16
Ly = 0.15
 
17
 
 
18
# properties of particles
 
19
radius = d*4.
 
20
 
 
21
#### startAtCorner=True
 
22
kw = {'color':[1,1,0],'wire':True,'highlight':False,'fixed':False,'material':-1}
 
23
 
 
24
#### packing 1
 
25
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[0,0,0], xLength=Lx, yLength=Ly, mos=mos, a=a, b=b, startAtCorner=True, isSymmetric=True, **kw )
 
26
O.bodies.append(netpack)
 
27
print 'Packing 1:'
 
28
print 'Real net length in x-direction [m]: ', lx
 
29
print 'Real net length in y-direction [m]: ', ly
 
30
 
 
31
 
 
32
#### packing 2
 
33
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[0.4,0,0], xLength=Lx, yLength=Ly, mos=mos, a=a, b=b, startAtCorner=True, isSymmetric=False, **kw )
 
34
O.bodies.append(netpack)
 
35
print 'Packing 2:'
 
36
print 'Real net length in x-direction [m]: ', lx
 
37
print 'Real net length in y-direction [m]: ', ly
 
38
 
 
39
 
 
40
#### packing 3
 
41
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[0,-0.4,0], xLength=Lx, yLength=Ly+0.05, mos=mos, a=a, b=b, startAtCorner=True, isSymmetric=True, **kw )
 
42
O.bodies.append(netpack)
 
43
print 'Packing 3:'
 
44
print 'Real net length in x-direction [m]: ', lx
 
45
print 'Real net length in y-direction [m]: ', ly
 
46
 
 
47
 
 
48
#### packing 4
 
49
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[0.4,-0.4,0], xLength=Lx, yLength=Ly+0.05, mos=mos, a=a, b=b, startAtCorner=True, isSymmetric=False, **kw )
 
50
O.bodies.append(netpack)
 
51
print 'Packing 4:'
 
52
print 'Real net length in x-direction [m]: ', lx
 
53
print 'Real net length in y-direction [m]: ', ly
 
54
 
 
55
 
 
56
#### startAtCorner=False
 
57
kw = {'color':[1,0,0],'wire':True,'highlight':False,'fixed':False,'material':-1}
 
58
 
 
59
#### packing 1
 
60
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[1,0,0], xLength=Lx, yLength=Ly, mos=mos, a=a, b=b, startAtCorner=False, isSymmetric=True, **kw )
 
61
O.bodies.append(netpack)
 
62
print 'Packing 1:'
 
63
print 'Real net length in x-direction [m]: ', lx
 
64
print 'Real net length in y-direction [m]: ', ly
 
65
 
 
66
 
 
67
#### packing 2
 
68
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[1.4,0,0], xLength=Lx, yLength=Ly, mos=mos, a=a, b=b, startAtCorner=False, isSymmetric=False, **kw )
 
69
O.bodies.append(netpack)
 
70
print 'Packing 2:'
 
71
print 'Real net length in x-direction [m]: ', lx
 
72
print 'Real net length in y-direction [m]: ', ly
 
73
 
 
74
 
 
75
#### packing 3
 
76
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[1,-0.4,0], xLength=Lx, yLength=Ly+0.05, mos=mos, a=a, b=b, startAtCorner=False, isSymmetric=True, **kw )
 
77
O.bodies.append(netpack)
 
78
print 'Packing 3:'
 
79
print 'Real net length in x-direction [m]: ', lx
 
80
print 'Real net length in y-direction [m]: ', ly
 
81
 
 
82
 
 
83
#### packing 4
 
84
[netpack,lx,ly] = hexaNet( radius=radius, cornerCoord=[1.4,-0.4,0], xLength=Lx, yLength=Ly+0.05, mos=mos, a=a, b=b, startAtCorner=False, isSymmetric=False, **kw )
 
85
O.bodies.append(netpack)
 
86
print 'Packing 4:'
 
87
print 'Real net length in x-direction [m]: ', lx
 
88
print 'Real net length in y-direction [m]: ', ly
 
89
 
 
90
## to see it
 
91
v=qt.Controller()
 
92
v=qt.View()