-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtensile_test.py
78 lines (65 loc) · 1.49 KB
/
tensile_test.py
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
import numpy as np
from operato.keywords.starter import Begin, Bcs, End, MatPlasJohns, Node
from operato.starter import Starter
materials = {
"MatPlasJohns": {
"rho_i": 7.8e-6,
"E": 210,
"nu": 0.3,
"i_flag": 1,
"sigma_y": 0.3,
"UTS": 0.686,
"eps_uts": 0.129,
"eps_max_p": 0.0,
}
}
node_data = np.recfromcsv(
"nodes.csv",
delimiter=";",
names=("node_ids", "xc", "yc", "zc"),
)
def main():
starter = Starter(add_separator=True)
# /BEGIN
starter.add(
Begin(
"tensile_test",
input_mass_unit="kg",
input_length_unit="mm",
input_time_unit="ms",
work_mass_unit="kg",
work_length_unit="mm",
work_time_unit="ms",
)
)
# /MAT/PLAS_JOHNS
starter.add(
MatPlasJohns(mat_id=2, mat_title="Steel_DP600", **materials["MatPlasJohns"])
)
# /NODE
starter.add(Node(node_ids=node_data, xc_yc_zc=node_data))
# /BCS
starter.add(
Bcs(
bcs_id=1,
bcs_title="Constraint 1",
trarot=[1, 1, 1, 1, 1, 1],
skew_id=0,
grnd_id=2,
)
)
# /BCS
starter.add(
Bcs(
bcs_id=2,
bcs_title="Constraint 2",
trarot=[0, 1, 1, 1, 1, 1],
skew_id=0,
grnd_id=3,
)
)
# /END
starter.add(End())
starter.write()
if __name__ == "__main__":
main()