abaqustools 2.2__tar.gz → 2.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {abaqustools-2.2/abaqustools.egg-info → abaqustools-2.32}/PKG-INFO +2 -8
- {abaqustools-2.2 → abaqustools-2.32/abaqustools.egg-info}/PKG-INFO +2 -8
- {abaqustools-2.2 → abaqustools-2.32}/abaqustools.egg-info/SOURCES.txt +1 -0
- {abaqustools-2.2 → abaqustools-2.32}/abaqustools.egg-info/requires.txt +0 -6
- abaqustools-2.32/develop/Export_new.py +115 -0
- {abaqustools-2.2 → abaqustools-2.32}/odbexport/export.py +127 -67
- {abaqustools-2.2 → abaqustools-2.32}/odbexport/odbfunc.py +3 -2
- {abaqustools-2.2 → abaqustools-2.32}/odbexport_example/Export.py +1 -1
- abaqustools-2.32/pyproject.toml +15 -0
- abaqustools-2.2/pyproject.toml +0 -15
- {abaqustools-2.2 → abaqustools-2.32}/LICENSE +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/README.md +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/EstimateCableDeflectionSimple.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/OLD_AbaqusExportModal.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/OLD_functions_gen - Copy.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/TestParameters.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/Test_time1.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/Test_time2.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/functions_gen.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/__old__/untitled0.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/abaqustools.egg-info/dependency_links.txt +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/abaqustools.egg-info/top_level.txt +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/Export_debug.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/nordsenga/nordsenga_truss.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/test_build_gradually/Runmodel.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/Langenuen_tower_exportstatic.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/Langenuen_tower_nograv_exportstatic.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/Sulafjorden_tower_exportstatic.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/Sulafjorden_tower_nograv_exportstatic.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/test_retract.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/testodb/TestLangenuen_exportmodal.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/testodb/TestLangenuen_exportstatic.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/testrayleigh/testray.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/develop/testrayleigh/testray_old.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/example/truss/create_model.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/example/trussjointc/create_model.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/odbexport/__init__.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/odbexport_example/Model_single_deck_exportmodal.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/odbexport_example/Model_single_deck_exportstatic.py +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/setup.cfg +0 -0
- {abaqustools-2.2 → abaqustools-2.32}/useful/Plot_model_and_modes.py +0 -0
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: abaqustools
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.32
|
|
4
4
|
Summary: Tools for FEM software ABAQUS.
|
|
5
5
|
Author-email: "O. W. Petersen" <oyvind.w.petersen@ntnu.no>
|
|
6
|
-
Keywords: abaqus,
|
|
6
|
+
Keywords: abaqus,export,fem,odb
|
|
7
7
|
Requires-Python: >=3
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: numpy
|
|
10
|
-
Requires-Dist: os
|
|
11
|
-
Requires-Dist: sys
|
|
12
|
-
Requires-Dist: time
|
|
13
10
|
Requires-Dist: scipy
|
|
14
11
|
Requires-Dist: nexusformat
|
|
15
|
-
Requires-Dist: datetime
|
|
16
12
|
Requires-Dist: h5py
|
|
17
|
-
Requires-Dist: timeit
|
|
18
|
-
Requires-Dist: warnings
|
|
19
13
|
Requires-Dist: putools
|
|
20
14
|
Requires-Dist: ypstruct
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: abaqustools
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.32
|
|
4
4
|
Summary: Tools for FEM software ABAQUS.
|
|
5
5
|
Author-email: "O. W. Petersen" <oyvind.w.petersen@ntnu.no>
|
|
6
|
-
Keywords: abaqus,
|
|
6
|
+
Keywords: abaqus,export,fem,odb
|
|
7
7
|
Requires-Python: >=3
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Dist: numpy
|
|
10
|
-
Requires-Dist: os
|
|
11
|
-
Requires-Dist: sys
|
|
12
|
-
Requires-Dist: time
|
|
13
10
|
Requires-Dist: scipy
|
|
14
11
|
Requires-Dist: nexusformat
|
|
15
|
-
Requires-Dist: datetime
|
|
16
12
|
Requires-Dist: h5py
|
|
17
|
-
Requires-Dist: timeit
|
|
18
|
-
Requires-Dist: warnings
|
|
19
13
|
Requires-Dist: putools
|
|
20
14
|
Requires-Dist: ypstruct
|
|
@@ -15,6 +15,7 @@ abaqustools.egg-info/dependency_links.txt
|
|
|
15
15
|
abaqustools.egg-info/requires.txt
|
|
16
16
|
abaqustools.egg-info/top_level.txt
|
|
17
17
|
develop/Export_debug.py
|
|
18
|
+
develop/Export_new.py
|
|
18
19
|
develop/nordsenga/nordsenga_truss.py
|
|
19
20
|
develop/test_build_gradually/Runmodel.py
|
|
20
21
|
develop/test_retract/Langenuen_tower_exportstatic.py
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Created on Thu Feb 1 15:18:47 2024
|
|
4
|
+
|
|
5
|
+
@author: oyvinpet
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# -*- coding: utf-8 -*-
|
|
9
|
+
|
|
10
|
+
#%% Import packages
|
|
11
|
+
|
|
12
|
+
import h5py
|
|
13
|
+
import numpy as np
|
|
14
|
+
import matplotlib.pyplot as plt
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
sys.path.append('C:/Cloud/OD_OWP/Work/Python/Github')
|
|
18
|
+
|
|
19
|
+
from abaqustools import odbexport
|
|
20
|
+
|
|
21
|
+
#%% Export from odb
|
|
22
|
+
|
|
23
|
+
folder_odb=r'C:\Cloud\OD_OWP\Work\Abaqus\Hardanger\ProjectStudents'
|
|
24
|
+
jobname='HardangerWindInitialNew'
|
|
25
|
+
folder_save=folder_odb
|
|
26
|
+
folder_python='C:/Cloud/OD_OWP/Work/Python/Github/abaqustools/odbexport'
|
|
27
|
+
|
|
28
|
+
# Export modes to h5 file
|
|
29
|
+
odbexport.export.modal(folder_odb,jobname,folder_save,folder_python)
|
|
30
|
+
|
|
31
|
+
# Export static state for dead loads to h5 file
|
|
32
|
+
# odbexport.export.static(folder_odb,jobname,folder_save,folder_python,stepnumber=-2,framenumber=-1)
|
|
33
|
+
|
|
34
|
+
#%% Import modal properties
|
|
35
|
+
|
|
36
|
+
hf=h5py.File(r'C:\Cloud\OD_OWP\Work\Abaqus\Hardanger\ProjectStudents\HardangerWindInitialNew_exportmodal.h5', 'r')
|
|
37
|
+
|
|
38
|
+
# Frequencies
|
|
39
|
+
f=np.array(hf.get('f'))
|
|
40
|
+
|
|
41
|
+
# Generalized mass
|
|
42
|
+
gm=np.array(hf.get('gm'))
|
|
43
|
+
|
|
44
|
+
# Node coordinates all nodes (size [N_nodes,4])
|
|
45
|
+
nodecoord=np.array(hf.get('nodecoord'))
|
|
46
|
+
|
|
47
|
+
# Mode shape matrix for all DOFs (size [6*N_nodes,N_modes])
|
|
48
|
+
phi=np.array(hf.get('phi'))
|
|
49
|
+
|
|
50
|
+
# Labels corresponding to each row of phi (each DOF), as a list of strings
|
|
51
|
+
phi_label_temp=np.array(hf.get('phi_label'))
|
|
52
|
+
phi_label=phi_label_temp[:].astype('U10').ravel().tolist()
|
|
53
|
+
|
|
54
|
+
# The DOFs are as follows:
|
|
55
|
+
# U1=x=longitudinal translation (along bridge)
|
|
56
|
+
# U2=y=horizontal translation
|
|
57
|
+
# U3=z=vertical translation
|
|
58
|
+
# UR1=rotation about x aka. torsion
|
|
59
|
+
# UR2=rotation about y aka. vertical bending
|
|
60
|
+
# UR3=rotation about z aka. horizontal bending
|
|
61
|
+
|
|
62
|
+
#%% Get node coordinates and mode shape for bridge deck only
|
|
63
|
+
|
|
64
|
+
# Nodes in bridge deck
|
|
65
|
+
node_deck=np.arange(1001,1311+1,1)
|
|
66
|
+
|
|
67
|
+
# Create list index of nodes in bridge deck
|
|
68
|
+
index_node_deck=[]
|
|
69
|
+
|
|
70
|
+
for k in np.arange(len(node_deck)):
|
|
71
|
+
index_node_deck.append(np.argwhere(node_deck[k]==nodecoord[:,0])[0,0])
|
|
72
|
+
|
|
73
|
+
nodecoord_deck=nodecoord[index_node_deck,:]
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# Create list of index of y-DOFs,z-DOFs, and t-DOFs in bridge deck
|
|
77
|
+
index_y=[]
|
|
78
|
+
index_z=[]
|
|
79
|
+
index_t=[]
|
|
80
|
+
|
|
81
|
+
for k in np.arange(len(node_deck)):
|
|
82
|
+
str_y=str(node_deck[k]) + '_U2'
|
|
83
|
+
index_y.append(phi_label.index(str_y))
|
|
84
|
+
|
|
85
|
+
str_z=str(node_deck[k]) + '_U3'
|
|
86
|
+
index_z.append(phi_label.index(str_z))
|
|
87
|
+
|
|
88
|
+
str_t=str(node_deck[k]) + '_UR1'
|
|
89
|
+
index_t.append(phi_label.index(str_t))
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
phi_y=phi[index_y,:]
|
|
93
|
+
phi_z=phi[index_z,:]
|
|
94
|
+
phi_t=phi[index_t,:]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
#%% Plot single mode
|
|
98
|
+
|
|
99
|
+
mode_plot=14 # Mode number to plot
|
|
100
|
+
scale_factor=1 # Scale factor
|
|
101
|
+
|
|
102
|
+
plt.figure()
|
|
103
|
+
|
|
104
|
+
x=nodecoord_deck[:,1] #x-coordinate of deck nodes
|
|
105
|
+
|
|
106
|
+
h1=plt.plot(x,phi_y[:,mode_plot]*scale_factor, label='Horizontal')
|
|
107
|
+
h2=plt.plot(x,phi_z[:,mode_plot]*scale_factor, label='Vertical')
|
|
108
|
+
h3=plt.plot(x,phi_t[:,mode_plot]*scale_factor, label='Torsion')
|
|
109
|
+
|
|
110
|
+
plt.xlabel('x [m]')
|
|
111
|
+
plt.ylabel('Modal deflection [m or rad]')
|
|
112
|
+
|
|
113
|
+
plt.legend()
|
|
114
|
+
|
|
115
|
+
plt.show()
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import sys
|
|
6
6
|
import os
|
|
7
|
+
import time
|
|
7
8
|
import numpy as np
|
|
8
9
|
import putools
|
|
9
10
|
import h5py
|
|
@@ -24,7 +25,7 @@ def static(folder_odb,jobname,folder_save,folder_python,variables=None,stepnumbe
|
|
|
24
25
|
# framenumber: framenumber(s) to export
|
|
25
26
|
# deletetxt: delete txt files
|
|
26
27
|
# saveh5: save to h5
|
|
27
|
-
# prefix: prefix for txt files
|
|
28
|
+
# prefix: prefix for txt files
|
|
28
29
|
# postfixh5: postfix for h5 file
|
|
29
30
|
# exportscript: name of python script that is created
|
|
30
31
|
|
|
@@ -61,7 +62,7 @@ def modal(folder_odb,jobname,folder_save,folder_python,variables=None,stepnumber
|
|
|
61
62
|
# framenumber: framenumber(s) to export
|
|
62
63
|
# deletetxt: delete txt files
|
|
63
64
|
# saveh5: save to h5
|
|
64
|
-
# prefix: prefix for txt files
|
|
65
|
+
# prefix: prefix for txt files
|
|
65
66
|
# postfixh5: postfix for h5 file
|
|
66
67
|
# exportscript: name of python script that is created # stepnumber
|
|
67
68
|
|
|
@@ -74,7 +75,7 @@ def modal(folder_odb,jobname,folder_save,folder_python,variables=None,stepnumber
|
|
|
74
75
|
|
|
75
76
|
# Variables to export
|
|
76
77
|
if variables is None:
|
|
77
|
-
variables=['f' , 'gm' , 'phi' , 'phi_sf' , 'nodecoord' , 'elconn'
|
|
78
|
+
variables=['f' , 'gm' , 'phi' , 'phi_sf' , 'nodecoord' , 'elconn']
|
|
78
79
|
|
|
79
80
|
# Script py file
|
|
80
81
|
if exportscript is None:
|
|
@@ -121,13 +122,23 @@ def exportmain(folder_odb,jobname,folder_save,folder_python,variables,stepnumber
|
|
|
121
122
|
if not file_exist_logic:
|
|
122
123
|
print('***** ' + file_name)
|
|
123
124
|
raise Exception('***** ODB file not found')
|
|
125
|
+
|
|
126
|
+
# Check if python folder and python files are given correctly
|
|
127
|
+
file_name=folder_python + '\\' + 'odbfunc.py'
|
|
128
|
+
file_exist_logic=os.path.isfile(file_name)
|
|
129
|
+
if not file_exist_logic:
|
|
130
|
+
print('***** ' + folder_python)
|
|
131
|
+
raise Exception('***** Supplied python (odbexport) folder and odbfunc module not found')
|
|
124
132
|
|
|
125
133
|
# Ensure list
|
|
126
134
|
if isinstance(variables,str):
|
|
127
135
|
variables=[variables]
|
|
128
|
-
|
|
136
|
+
|
|
137
|
+
# Lower case
|
|
138
|
+
variables=[x.lower() for x in variables]
|
|
139
|
+
|
|
129
140
|
# Check input variables
|
|
130
|
-
variables_allowed= ['u' , 'sf' , '
|
|
141
|
+
variables_allowed= ['u' , 'sf' , 'phi' , 'phi_sf' , 'f' , 'gm' , 'nodecoord' , 'elconn' , 'elset' ]
|
|
131
142
|
for k in np.arange(len(variables)):
|
|
132
143
|
if not variables[k] in variables_allowed:
|
|
133
144
|
print('***** Check variable ' + variables[k])
|
|
@@ -140,66 +151,113 @@ def exportmain(folder_odb,jobname,folder_save,folder_python,variables,stepnumber
|
|
|
140
151
|
system_cmd='abaqus cae noGUI=' + folder_save + '/' + exportscript + '.py'
|
|
141
152
|
sys_out=os.popen(system_cmd).read()
|
|
142
153
|
|
|
143
|
-
|
|
144
|
-
h5_var=[]
|
|
145
|
-
h5_data=[]
|
|
146
|
-
h5_isnum=[]
|
|
147
|
-
|
|
148
|
-
for k in np.arange(len(variables)):
|
|
149
|
-
|
|
150
|
-
# Base for txt files
|
|
151
|
-
filename_base=folder_save + '/' + prefix
|
|
152
|
-
|
|
153
|
-
# Read txt file
|
|
154
|
-
data_temp=np.genfromtxt(filename_base+variables[k]+'.txt', delimiter=',')
|
|
155
|
-
h5_var.append(variables[k])
|
|
156
|
-
h5_data.append(data_temp)
|
|
157
|
-
h5_isnum.append(True)
|
|
158
|
-
|
|
159
|
-
# Special cases where labels also need be imported
|
|
160
|
-
if variables[k]=='phi':
|
|
161
|
-
fid=open(filename_base+'phi_label.txt','r')
|
|
162
|
-
phi_label=fid.read().splitlines()
|
|
163
|
-
fid.close()
|
|
164
|
-
h5_var.append('phi_label')
|
|
165
|
-
h5_data.append(phi_label)
|
|
166
|
-
h5_isnum.append(False)
|
|
167
|
-
elif variables[k]=='phi_sf':
|
|
168
|
-
fid=open(filename_base+'phi_sf_label.txt','r')
|
|
169
|
-
phi_sf_label=fid.read().splitlines()
|
|
170
|
-
fid.close()
|
|
171
|
-
h5_var.append('phi_sf_label')
|
|
172
|
-
h5_data.append(phi_sf_label)
|
|
173
|
-
h5_isnum.append(False)
|
|
174
|
-
elif variables[k]=='u':
|
|
175
|
-
fid=open(filename_base+'u_label.txt','r')
|
|
176
|
-
u_label=fid.read().splitlines()
|
|
177
|
-
fid.close()
|
|
178
|
-
h5_var.append('u_label')
|
|
179
|
-
h5_data.append(u_label)
|
|
180
|
-
h5_isnum.append(False)
|
|
181
|
-
elif variables[k]=='sf':
|
|
182
|
-
fid=open(filename_base+'sf_label.txt','r')
|
|
183
|
-
sf_label=fid.read().splitlines()
|
|
184
|
-
fid.close()
|
|
185
|
-
h5_var.append('sf_label')
|
|
186
|
-
h5_data.append(sf_label)
|
|
187
|
-
h5_isnum.append(False)
|
|
188
|
-
elif variables[k]=='elset':
|
|
189
|
-
fid=open(filename_base+'elset_label.txt','r')
|
|
190
|
-
elset_label=fid.read().splitlines()
|
|
191
|
-
fid.close()
|
|
192
|
-
h5_var.append('elset_label')
|
|
193
|
-
h5_data.append(elset_label)
|
|
194
|
-
h5_isnum.append(False)
|
|
154
|
+
idx_error=sys_out.find('error')
|
|
195
155
|
|
|
156
|
+
if idx_error>0:
|
|
157
|
+
print(sys_out)
|
|
158
|
+
raise Exception('***** Export aborted due to errors, see above')
|
|
159
|
+
|
|
160
|
+
|
|
196
161
|
# Save h5 file
|
|
197
162
|
if saveh5==True:
|
|
198
|
-
|
|
199
|
-
#
|
|
163
|
+
|
|
164
|
+
# Base for txt files
|
|
200
165
|
hf_name=folder_save + '/' + jobname + postfixh5 + '.h5'
|
|
201
|
-
exporth5(hf_name,h5_var,h5_data,h5_isnum)
|
|
202
166
|
|
|
167
|
+
# Overwrite file
|
|
168
|
+
if os.path.exists(hf_name):
|
|
169
|
+
os.remove(hf_name)
|
|
170
|
+
time.sleep(1)
|
|
171
|
+
|
|
172
|
+
hf = h5py.File(hf_name,'w')
|
|
173
|
+
dt = h5py.special_dtype(vlen=str)
|
|
174
|
+
|
|
175
|
+
for k in np.arange(len(variables)):
|
|
176
|
+
|
|
177
|
+
# Base for txt files
|
|
178
|
+
filename_base=folder_save + '/' + prefix
|
|
179
|
+
|
|
180
|
+
# Read txt file
|
|
181
|
+
data_from_txt=np.genfromtxt(filename_base+variables[k]+'.txt', delimiter=',')
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
if variables[k]=='u':
|
|
185
|
+
|
|
186
|
+
hf.create_dataset('u',data=data_from_txt)
|
|
187
|
+
hf['u'].attrs.modify('Type', 'Displacement')
|
|
188
|
+
hf['u'].attrs.modify('Unit', 'm, rad')
|
|
189
|
+
|
|
190
|
+
fid=open(filename_base+'u_label.txt','r'); label=fid.read().splitlines(); fid.close()
|
|
191
|
+
hf.create_dataset('u_label',data=label,dtype=dt)
|
|
192
|
+
hf['u_label'].attrs.modify('Type', 'DOF labels')
|
|
193
|
+
|
|
194
|
+
elif variables[k]=='sf':
|
|
195
|
+
|
|
196
|
+
hf.create_dataset('sf',data=data_from_txt)
|
|
197
|
+
hf['sf'].attrs.modify('Type', 'Section force')
|
|
198
|
+
hf['sf'].attrs.modify('Unit', 'm, rad')
|
|
199
|
+
|
|
200
|
+
fid=open(filename_base+'sf_label.txt','r'); label=fid.read().splitlines(); fid.close()
|
|
201
|
+
hf.create_dataset('sf_label',data=label,dtype=dt)
|
|
202
|
+
hf['sf_label'].attrs.modify('Type', 'Element labels')
|
|
203
|
+
|
|
204
|
+
elif variables[k]=='phi':
|
|
205
|
+
|
|
206
|
+
hf.create_dataset('phi',data=data_from_txt)
|
|
207
|
+
hf['phi'].attrs.modify('Type', 'Modal displacement')
|
|
208
|
+
hf['phi'].attrs.modify('Unit', 'm, rad')
|
|
209
|
+
|
|
210
|
+
fid=open(filename_base+'phi_label.txt','r'); label=fid.read().splitlines(); fid.close()
|
|
211
|
+
hf.create_dataset('phi_label',data=label,dtype=dt)
|
|
212
|
+
hf['phi_label'].attrs.modify('Type', 'DOF labels')
|
|
213
|
+
|
|
214
|
+
elif variables[k]=='phi_sf':
|
|
215
|
+
|
|
216
|
+
hf.create_dataset('phi_sf',data=data_from_txt)
|
|
217
|
+
hf['phi_sf'].attrs.modify('Type', 'Modal section force')
|
|
218
|
+
hf['phi_sf'].attrs.modify('Unit', 'N, Nm')
|
|
219
|
+
|
|
220
|
+
fid=open(filename_base+'phi_sf_label.txt','r'); label=fid.read().splitlines(); fid.close()
|
|
221
|
+
hf.create_dataset('phi_sf_label',data=label,dtype=dt)
|
|
222
|
+
hf['phi_sf_label'].attrs.modify('Type', 'Element labels')
|
|
223
|
+
|
|
224
|
+
elif variables[k]=='f':
|
|
225
|
+
|
|
226
|
+
hf.create_dataset('f',data=data_from_txt)
|
|
227
|
+
hf['f'].attrs.modify('Type', 'Natural frequency')
|
|
228
|
+
hf['f'].attrs.modify('Unit', 'Hz')
|
|
229
|
+
|
|
230
|
+
elif variables[k]=='gm':
|
|
231
|
+
|
|
232
|
+
hf.create_dataset('gm',data=data_from_txt)
|
|
233
|
+
hf['gm'].attrs.modify('Type', 'Generalized mass')
|
|
234
|
+
hf['gm'].attrs.modify('Unit', 'kg')
|
|
235
|
+
|
|
236
|
+
elif variables[k]=='nodecoord':
|
|
237
|
+
|
|
238
|
+
hf.create_dataset('nodecoord',data=data_from_txt)
|
|
239
|
+
hf['nodecoord'].attrs.modify('Type', 'Node coordinate')
|
|
240
|
+
hf['nodecoord'].attrs.modify('Unit', 'Node number, m')
|
|
241
|
+
|
|
242
|
+
elif variables[k]=='elconn':
|
|
243
|
+
|
|
244
|
+
hf.create_dataset('elconn',data=data_from_txt)
|
|
245
|
+
hf['elconn'].attrs.modify('Type', 'Element connectivity')
|
|
246
|
+
hf['elconn'].attrs.modify('Unit', 'Element number, Node number')
|
|
247
|
+
|
|
248
|
+
elif variables[k]=='elset':
|
|
249
|
+
|
|
250
|
+
hf.create_dataset('elset',data=data_from_txt)
|
|
251
|
+
hf['elset'].attrs.modify('Type', 'Element sets')
|
|
252
|
+
hf['elset'].attrs.modify('Unit', 'Element number')
|
|
253
|
+
|
|
254
|
+
fid=open(filename_base+'elset_label.txt','r'); label=fid.read().splitlines(); fid.close()
|
|
255
|
+
hf.create_dataset('elset_label',data=label,dtype=dt)
|
|
256
|
+
hf['elset_label'].attrs.modify('Type', 'Element labels')
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
hf.close()
|
|
260
|
+
|
|
203
261
|
# Delete txt files identified by prefix
|
|
204
262
|
if deletetxt==True:
|
|
205
263
|
deletefiles(folder_save,prefix,['.txt'])
|
|
@@ -208,6 +266,8 @@ def exportmain(folder_odb,jobname,folder_save,folder_python,variables,stepnumber
|
|
|
208
266
|
|
|
209
267
|
def exporth5(hf_name,h5_var,h5_data,h5_isnum):
|
|
210
268
|
|
|
269
|
+
# NOT USED
|
|
270
|
+
|
|
211
271
|
# Save h5 file with data
|
|
212
272
|
#
|
|
213
273
|
# Inputs:
|
|
@@ -239,17 +299,17 @@ def deletefiles(foldername,name_match,extensions):
|
|
|
239
299
|
# extensions: list of extensions allowed
|
|
240
300
|
|
|
241
301
|
# Find files that match
|
|
242
|
-
|
|
243
|
-
|
|
302
|
+
filenames_dir=os.listdir(foldername)
|
|
303
|
+
idx_match=putools.num.listindexsub(filenames_dir,name_match)
|
|
244
304
|
|
|
245
|
-
for k in np.arange(len(
|
|
305
|
+
for k in np.arange(len(idx_match)):
|
|
246
306
|
|
|
247
|
-
|
|
307
|
+
filename_remove=filenames_dir[idx_match[k]]
|
|
248
308
|
|
|
249
|
-
# Only
|
|
250
|
-
match_logic=[list_sub in
|
|
309
|
+
# Only files with specified extensions
|
|
310
|
+
match_logic=[list_sub in filename_remove for list_sub in extensions]
|
|
251
311
|
if sum(match_logic)>0:
|
|
252
|
-
os.remove(foldername + '/' +
|
|
312
|
+
os.remove(foldername + '/' + filename_remove)
|
|
253
313
|
|
|
254
314
|
#%% Export modal script
|
|
255
315
|
|
|
@@ -10,7 +10,7 @@ def p(pstring):
|
|
|
10
10
|
prettyPrint(pstring)
|
|
11
11
|
|
|
12
12
|
# This module is imported in Abaqus by "import odbfunc"
|
|
13
|
-
# The folder must first be added to the system path
|
|
13
|
+
# The folder containing odbfunc.py must first be added to the system path
|
|
14
14
|
|
|
15
15
|
#%%
|
|
16
16
|
|
|
@@ -157,7 +157,8 @@ def exportnodecoord(odb_id,stepnumber,framenumber):
|
|
|
157
157
|
if 'COORD' not in SelectedFrame.fieldOutputs.keys():
|
|
158
158
|
NodeCoordMatrix=np.array([0 , 0 , 0])
|
|
159
159
|
NodeCoordLabelVector=np.array([0])
|
|
160
|
-
|
|
160
|
+
NodeCoord=np.hstack((NodeCoordLabelVector,NodeCoordMatrix))
|
|
161
|
+
return NodeCoord
|
|
161
162
|
|
|
162
163
|
t_start=timer()
|
|
163
164
|
CoordValues=SelectedFrame.fieldOutputs['COORD'].values
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[tool.setuptools.packages.find]
|
|
6
|
+
exclude = ["develop/","__old__/","__pycache__/*",".idea/*",".git/*",".github/*"]
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "abaqustools"
|
|
10
|
+
version = "2.32" # Follow PEP440
|
|
11
|
+
authors = [{ name="O. W. Petersen", email="oyvind.w.petersen@ntnu.no" },]
|
|
12
|
+
description = "Tools for FEM software ABAQUS."
|
|
13
|
+
requires-python = ">=3"
|
|
14
|
+
keywords = ["abaqus", "export","fem","odb"]
|
|
15
|
+
dependencies = ["numpy","scipy","nexusformat","h5py","putools","ypstruct"]
|
abaqustools-2.2/pyproject.toml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[tool.setuptools.packages.find]
|
|
6
|
-
exclude = ["develop/*","__old__/*","__pycache__/*",".idea/*",".git/*",".github/*"]
|
|
7
|
-
|
|
8
|
-
[project]
|
|
9
|
-
name = "abaqustools"
|
|
10
|
-
version = "2.2" # Follow PEP440
|
|
11
|
-
authors = [{ name="O. W. Petersen", email="oyvind.w.petersen@ntnu.no" },]
|
|
12
|
-
description = "Tools for FEM software ABAQUS."
|
|
13
|
-
requires-python = ">=3"
|
|
14
|
-
keywords = ["abaqus", "suspension","bridge","fem","odb"]
|
|
15
|
-
dependencies = ["numpy","os","sys","time","scipy","nexusformat","datetime","h5py","timeit","warnings","putools","ypstruct"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/Langenuen_tower_nograv_exportstatic.py
RENAMED
|
File without changes
|
|
File without changes
|
{abaqustools-2.2 → abaqustools-2.32}/develop/test_retract/Sulafjorden_tower_nograv_exportstatic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|