@@ -45,12 +45,19 @@ def join_path(filename):
45
45
46
46
47
47
@pytest .fixture (params = ["2022" , "2023" , "2024" ])
48
- def client (datapath , request ):
49
- abaqus_version = request .param
50
- abaqus_bin = shutil .which (f"abaqus{ abaqus_version } " )
48
+ def abaqus_version (request ):
49
+ return request .param
50
+
51
+
52
+ @pytest .fixture
53
+ def abaqus_bin (abaqus_version ):
51
54
if sys .platform == 'win32' :
52
- abaqus_bin = f"C:/Program Files/SIMULIA/{ abaqus_version } /EstProducts/win_b64/code/bin/SMALauncher.exe"
55
+ return f"C:/Program Files/SIMULIA/{ abaqus_version } /EstProducts/win_b64/code/bin/SMALauncher.exe"
56
+ return shutil .which (f"abaqus{ abaqus_version } " )
57
+
53
58
59
+ @pytest .fixture
60
+ def client (datapath , abaqus_version , abaqus_bin ):
54
61
python_path = os .path .join (Path .home (), ".conda" , "envs" , f"odbserver-{ abaqus_version } " )
55
62
odb_file = datapath (f"beam_3d_hex_quad-{ abaqus_version } .odb" )
56
63
return odbclient .OdbClient (odb_file , abaqus_bin = abaqus_bin , python_env_path = python_path )
@@ -188,13 +195,8 @@ def test_variable_stress_integration_point(client, datapath):
188
195
pd .testing .assert_frame_equal (result , expected )
189
196
190
197
191
- @pytest .fixture (params = ["2022" , "2023" , "2024" ])
192
- def client_history (datapath , request ):
193
- abaqus_version = request .param
194
- abaqus_bin = shutil .which (f"abaqus{ abaqus_version } " )
195
- if sys .platform == 'win32' :
196
- abaqus_bin = f"C:/Program Files/SIMULIA/{ abaqus_version } /EstProducts/win_b64/code/bin/SMALauncher.exe"
197
-
198
+ @pytest .fixture ()
199
+ def client_history (datapath , abaqus_version , abaqus_bin ):
198
200
python_path = os .path .join (Path .home (), ".conda" , "envs" , f"odbserver-{ abaqus_version } " )
199
201
odb_file = datapath (f"history_output_test-{ abaqus_version } .odb" )
200
202
return odbclient .OdbClient (odb_file , abaqus_bin = abaqus_bin , python_env_path = python_path )
@@ -234,14 +236,17 @@ def test_history_output_values(client_history):
234
236
assert client_history .history_output_values ("Step-1" , 'Element ASSEMBLY.1' , 'CTF1' ).array [1 ] == pytest .approx (0.09999854117631912 )
235
237
236
238
237
- def test_history_region_description (client_history ):
239
+ def test_history_region_description (client_history , abaqus_version ):
238
240
result = client_history .history_region_description ("Step-1" , 'Element ASSEMBLY.1' )
239
- assert result == "Output at assembly ASSEMBLY instance ASSEMBLY element 1"
241
+ expected = "Output at assembly ASSEMBLY instance ASSEMBLY element 1"
242
+ if abaqus_version == "2024" :
243
+ expected += " region _PICKEDSET21"
244
+ assert result == expected
240
245
241
246
242
- def test_history_info (client_history ):
247
+ def test_history_info (client_history , abaqus_version ):
243
248
expected = {
244
- "Output at assembly ASSEMBLY region Whole Model " : {
249
+ "Output at assembly ASSEMBLY" : {
245
250
"History Outputs" : [
246
251
"ALLAE" ,
247
252
"ALLCCDW" ,
@@ -326,4 +331,11 @@ def test_history_info(client_history):
326
331
"Steps " : ["Step-1" , "Step-2" ],
327
332
},
328
333
}
329
- assert client_history .history_info () == expected
334
+ if abaqus_version == "2024" :
335
+ expected ["Output at assembly ASSEMBLY region Whole Model" ] = expected .pop ("Output at assembly ASSEMBLY" )
336
+ element_1 = expected .pop ("Output at assembly ASSEMBLY instance ASSEMBLY element 1" )
337
+ expected ["Output at assembly ASSEMBLY instance ASSEMBLY element 1 region _PICKEDSET21" ] = element_1
338
+ expected ["Output at assembly ASSEMBLY instance ASSEMBLY element 1 region _PICKEDSET22" ] = element_1
339
+
340
+ result = client_history .history_info ()
341
+ assert result == expected
0 commit comments