File: wirepackings.py

package info (click to toggle)
yade 2026.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,448 kB
  • sloc: cpp: 97,645; python: 52,173; sh: 677; makefile: 162
file content (89 lines) | stat: -rw-r--r-- 3,234 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -*- encoding=utf-8 -*-
from yade import qt

#### short description of script
print('This script shows the use of the function hexaNet of module pack (interactions are not initialised)')

#### define parameters for the net
# mesh geometry
mos = 0.08
a = 0.04
b = 0.04
# wire diameter
d = 2.7 / 1000.
# net dimension
Lx = 0.2
Ly = 0.15

# properties of particles
radius = d * 4.

#### startAtCorner=True
kw = {'color': [1, 1, 0], 'wire': True, 'highlight': False, 'fixed': False, 'material': -1}

#### packing 1
[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)
O.bodies.append(netpack)
print('Packing 1:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### packing 2
[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)
O.bodies.append(netpack)
print('Packing 2:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### packing 3
[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)
O.bodies.append(netpack)
print('Packing 3:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### packing 4
[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)
O.bodies.append(netpack)
print('Packing 4:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### startAtCorner=False
kw = {'color': [1, 0, 0], 'wire': True, 'highlight': False, 'fixed': False, 'material': -1}

#### packing 1
[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)
O.bodies.append(netpack)
print('Packing 1:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### packing 2
[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)
O.bodies.append(netpack)
print('Packing 2:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### packing 3
[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)
O.bodies.append(netpack)
print('Packing 3:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

#### packing 4
[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)
O.bodies.append(netpack)
print('Packing 4:')
print('Real net length in x-direction [m]: ', lx)
print('Real net length in y-direction [m]: ', ly)

## to see it
v = qt.Controller()
v = qt.View()