-
Notifications
You must be signed in to change notification settings - Fork 3
/
createVABSInputMain.py
64 lines (57 loc) · 2.02 KB
/
createVABSInputMain.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
from abaqus import *
from parseAbaqusInput import *
from reorgAbaqusInput import *
from writeVABSInput import *
import os
def createVABSInputMain(
abq_inp, new_filename,
timoshenko_flag, thermal_flag, trapeze_flag, vlasov_flag,
curve_flag, ik, oblique_flag, cos
):
if new_filename == '':
vabs_inp = abq_inp[:-4] + r'_vabs.dat'
else:
dir = os.path.dirname(abq_inp)
new_filename = new_filename + '.dat'
vabs_inp = os.path.join(dir, new_filename)
# ========== Parse data from Abaqus input ==========
milestone('Parsing data from Abaqus input...')
results = parseAbaqusInput(abq_inp)
# nsg = results['nsg']
nsg = 2
nodes = results['nodes']
elements2d = results['elements 2d']
elements3d = results['elements 3d']
elsets = results['element sets']
sections = results['sections']
distributions = results['distribution']
orientations = results['orientation']
materials = results['materials']
densities = results['densities']
elastics = results['elastics']
# ========== Reorganize data for VABS input ==========
milestone('Reorganizing data for VABS input...')
results = reorgAbaqusInput(
nsg, nodes, elements2d, elements3d, elsets,
sections, distributions, orientations,
materials, densities, elastics
)
n_coord = results['nodes']
eid_all = results['all elements ids']
eid_lid = results['element to layer type']
e_connt_2d = results['elements 2d']
# e_connt_3d = results['elements 3d']
distr_all = results['distributions']
layer_types = results['layer types']
materials = results['materials']
# ========== Write VABS input ==========
milestone('Writing VABS input...')
writeVABSInput(
vabs_inp,
nsg, n_coord, eid_all, eid_lid, e_connt_2d,
distr_all, layer_types, materials,
timoshenko_flag, thermal_flag, trapeze_flag, vlasov_flag,
curve_flag, ik, oblique_flag, cos
)
# vabs_inp = os.path.basename(vabs_inp)
return vabs_inp