forked from calculix/CalculiX-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre.fbd
More file actions
105 lines (100 loc) · 1.84 KB
/
pre.fbd
File metadata and controls
105 lines (100 loc) · 1.84 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# <L=500> Length
# <W=20> Width
# <T=5> thickness
# <num=5> number of leafs
valu L 300
valu W 20
valu T 5
valu num 6
# naming scheme
# leaf1...leafn
# top1...topn
# bot2...botn
# basic brick
valu L0 / L num
pnt p0 0 0 0
swep all new tra 0 W 0
swep all new tra 0 0 T
swep all new tra L0 0 0
elty all he20
div all auto W
mesh all
seta leaf0 b all
setr leaf0 e all
#other leafs
valu count 1
# init surface-file
sys echo **surfaces include > sur.inc
sys echo **contact pairs > pairs.inc
while count < num
# counter
valu leafi & leaf count
valu topi & top count
valu boti & bot count
# leafi
# offset in z
valu offset * T count
valu count + count 1
valu count int count
# extract top surface of upper leaf
seta nodes n all
enq nodes topi rec _ _ offset 0.1
# create new leaf
copy leaf0 leafi tra 0 0 offset
move leafi scal count 1 1
seta nl n leafi
zap nl
elty leafi he20
div leafi auto W
mesh leafi
# bottom surface of new leaf
del se nodes
seta nodes n leafi
enq nodes boti rec _ _ offset 0.1
comp boti do
# write surface definitions
send boti abq sur
send topi abq sur
valu topfile & topi .sur
valu botfile & boti .sur
sys echo *include, input= topfile >> sur.inc
sys echo *include, input= botfile >> sur.inc
valu tops & S topi
valu bots & S boti
sys echo tops , bots >> pairs.inc
endwhile
send all abq
seta ! all
# Symmetry
seta nodes n all
enq nodes ysym rec _ 0 _ 0.1
enq nodes xsym rec 0 _ _ 0.1
send ysym abq spc 2
send xsym abq spc 1
# Load
enq nodes load rec 0 _ _ 0.1
send load abq spc 3 10
# support
enq nodes support rec L _ offset 0.1
send support abq nam
# image
frame
rot y
rot l 80
rot d 10
zoom 4
seta ! all
hcpy png Refs/geo
# contact plot
seta master f bot*
seta slave n top*
frame
rot y
rot l 80
rot d 10
zoom 4
plot fb all n 50
plus fb master b 50
plus n slave r 4
view ill
hcpy png Refs/contact