toughanimator 0.1.8__tar.gz → 0.1.9__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.
- {toughanimator-0.1.8 → toughanimator-0.1.9}/PKG-INFO +2 -2
- {toughanimator-0.1.8 → toughanimator-0.1.9}/setup.py +2 -2
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator/run.py +1 -1
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator/tough_classes.py +65 -45
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator.egg-info/PKG-INFO +2 -2
- {toughanimator-0.1.8 → toughanimator-0.1.9}/README.md +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/pyproject.toml +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/setup.cfg +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/tests/test_all_cases.py +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator/__init__.py +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator.egg-info/SOURCES.txt +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator.egg-info/dependency_links.txt +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator.egg-info/requires.txt +0 -0
- {toughanimator-0.1.8 → toughanimator-0.1.9}/toughanimator.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toughanimator
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: A tool for visualizing TOUGH simulation outputs.
|
|
5
5
|
Home-page: https://github.com/scarletref/toughanimator
|
|
6
6
|
Author: scarletref
|
|
@@ -8,7 +8,7 @@ Author-email: scarletreflection@gmail.com
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11,<3.14
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
Requires-Dist: numpy
|
|
14
14
|
Requires-Dist: pandas
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='toughanimator', # Package name on PyPI
|
|
5
|
-
version='0.1.
|
|
5
|
+
version='0.1.9',
|
|
6
6
|
description='A tool for visualizing TOUGH simulation outputs.',
|
|
7
7
|
long_description=open('README.md').read(),
|
|
8
8
|
long_description_content_type='text/markdown',
|
|
@@ -16,7 +16,7 @@ setup(
|
|
|
16
16
|
'pandas',
|
|
17
17
|
'vtk',
|
|
18
18
|
],
|
|
19
|
-
python_requires='>=3.
|
|
19
|
+
python_requires='>=3.11,<3.14',
|
|
20
20
|
classifiers=[
|
|
21
21
|
'Programming Language :: Python :: 3',
|
|
22
22
|
'License :: OSI Approved :: MIT License',
|
|
@@ -10,7 +10,7 @@ test_case_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), dir_nam
|
|
|
10
10
|
|
|
11
11
|
case_dir = os.path.join(test_case_dir, case_name)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
case_dir = r"D:\Projects\202511\dip_left\TRv4"
|
|
14
14
|
#case_dir = r"D:\Projects\202504\polygonal\poly_test"
|
|
15
15
|
#case_dir = r"D:\Projects\202507\tough系列output\tough output format\TR_MINC_exe"
|
|
16
16
|
#case_dir = r"D:\Projects\202508\tough_cases\WW\7_TR_MINC_petrasim2025__5spot"
|
|
@@ -1028,6 +1028,9 @@ class vis_reader:
|
|
|
1028
1028
|
if os.path.isfile(self.tec_scalar_path):
|
|
1029
1029
|
firstFile = False
|
|
1030
1030
|
file = open(self.tec_scalar_path, "a")
|
|
1031
|
+
if len(self.setting.selected_variables_scalar) == 0:
|
|
1032
|
+
self.setting.selected_variables_scalar = headers
|
|
1033
|
+
|
|
1031
1034
|
if firstFile:
|
|
1032
1035
|
file.write('TITLE = TECPLOT PLOT \n')
|
|
1033
1036
|
selected_header_string = '"'+'", "'.join(self.setting.selected_variables_scalar) + '"'
|
|
@@ -1038,37 +1041,42 @@ class vis_reader:
|
|
|
1038
1041
|
|
|
1039
1042
|
#time_statement = f'ZONE T ="{vis_time_step.time_step}, Time = {vis_time_step.time}", N = {vtu_cell_to_points.GetNumberOfPoints()}, E = {vtu_cell_to_points.GetNumberOfCells()}, F = FEPOINT, ET = {tecplot_cell_type}, SOLUTIONTIME = {vis_time_step.time}\n'
|
|
1040
1043
|
|
|
1041
|
-
time_statement = f'ZONE T="{vis_time_step.time_step}, Time = {vis_time_step.time}", I={self.xyz_elem[0] + 1}, J={self.xyz_elem[1] + 1}, K={self.xyz_elem[2] + 1}, SOLUTIONTIME={vis_time_step.time}, DATAPACKING=BLOCK, VARLOCATION=({self.__get_varlocarion_string(
|
|
1044
|
+
time_statement = f'ZONE T="{vis_time_step.time_step}, Time = {vis_time_step.time}", I={self.xyz_elem[0] + 1}, J={self.xyz_elem[1] + 1}, K={self.xyz_elem[2] + 1}, SOLUTIONTIME={vis_time_step.time}, DATAPACKING=BLOCK, VARLOCATION=({self.__get_varlocarion_string(self.setting.selected_variables_scalar)})'
|
|
1042
1045
|
if not firstFile:
|
|
1043
1046
|
time_statement = f'{time_statement}, D=(1,2,3,FECONNECT)'
|
|
1044
1047
|
#if self.setting.debug:
|
|
1045
1048
|
#time_statement = f'ZONE T ="{vis_time_step.time_step}, Time = {vis_time_step.time}", N = {vtu_cell_to_points.GetNumberOfPoints()}, E = {vtu_cell_to_points.GetNumberOfCells()}, F = FEPOINT, ET = {tecplot_cell_type}\n'
|
|
1046
1049
|
file.write(f'{time_statement}\n')
|
|
1047
|
-
|
|
1050
|
+
max_line_length = 20000
|
|
1048
1051
|
# X, Y, Z
|
|
1049
1052
|
if firstFile:
|
|
1050
|
-
for
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
file.write(
|
|
1063
|
-
file.write(" \n")
|
|
1053
|
+
for point_idx in range(0, 3):
|
|
1054
|
+
line_string = ''
|
|
1055
|
+
for i in range(0, vtr.GetNumberOfPoints()):
|
|
1056
|
+
point = vtr.GetPoint(i)
|
|
1057
|
+
#file.write(str(point[0]) + " ")
|
|
1058
|
+
if len(line_string) + len(str(point[point_idx])) + 1 > max_line_length:
|
|
1059
|
+
# write the current line to file
|
|
1060
|
+
file.write(f'{line_string}\n')
|
|
1061
|
+
# reset the line string
|
|
1062
|
+
line_string = ''
|
|
1063
|
+
line_string = f'{line_string}{str(point[point_idx])} '
|
|
1064
|
+
|
|
1065
|
+
file.write(f'{line_string}\n')
|
|
1064
1066
|
|
|
1065
1067
|
# Other data
|
|
1066
1068
|
for header in self.setting.selected_variables_scalar:
|
|
1067
1069
|
array = vtr.GetCellData().GetArray(header)
|
|
1068
|
-
|
|
1070
|
+
line_string = ''
|
|
1069
1071
|
for e in range(0, vtr.GetNumberOfCells()):
|
|
1070
|
-
file.write(str(array.
|
|
1071
|
-
|
|
1072
|
+
#file.write(f'{str(array.GetComponent(e, 0))} ')
|
|
1073
|
+
if len(line_string) + len(str(array.GetValue(e))) + 1 > max_line_length:
|
|
1074
|
+
# write the current line to file
|
|
1075
|
+
file.write(f'{line_string}\n')
|
|
1076
|
+
# reset the line string
|
|
1077
|
+
line_string = ''
|
|
1078
|
+
line_string = f'{line_string}{str(array.GetValue(e))} '
|
|
1079
|
+
file.write(f'{line_string}\n')
|
|
1072
1080
|
|
|
1073
1081
|
file.close()
|
|
1074
1082
|
|
|
@@ -1203,6 +1211,11 @@ class vis_reader:
|
|
|
1203
1211
|
|
|
1204
1212
|
if VisType.Tecplot not in self.setting.vis_types:
|
|
1205
1213
|
return
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
if self.setting.mesh_type == MeshType.PolygonalMesh:
|
|
1217
|
+
print(f' Tecplot output for polygonal mesh is not supported yet.')
|
|
1218
|
+
return
|
|
1206
1219
|
|
|
1207
1220
|
# Start Tecplot generating
|
|
1208
1221
|
tec_name = pathlib.Path(self.setting.input_file_paths[0]).stem
|
|
@@ -1212,11 +1225,16 @@ class vis_reader:
|
|
|
1212
1225
|
firstFile = False
|
|
1213
1226
|
file = open(self.tec_vector_path, "a")
|
|
1214
1227
|
|
|
1215
|
-
|
|
1228
|
+
#selected_header_string = '"'+'", "'.join(self.setting.selected_variables_scalar) + '"'
|
|
1229
|
+
if len(self.setting.selected_variables_vector) == 0:
|
|
1230
|
+
self.setting.selected_variables_vector = headers
|
|
1231
|
+
vector_headers = self.__get_tec_vector_headers(self.setting.selected_variables_vector)
|
|
1232
|
+
|
|
1216
1233
|
# add header
|
|
1217
1234
|
if firstFile:
|
|
1218
1235
|
file.write('TITLE = TECPLOT PLOT \n')
|
|
1219
1236
|
header_string = '"'+'", "'.join(vector_headers) + '"'
|
|
1237
|
+
|
|
1220
1238
|
file.write(f'VARIABLES = "X", "Y", "Z", {header_string}\n')
|
|
1221
1239
|
|
|
1222
1240
|
time_statement = f'ZONE T="{vis_time_step.time_step}, Time = {vis_time_step.time}", I={self.xyz_elem[0] + 1}, J={self.xyz_elem[1] + 1}, K={self.xyz_elem[2] + 1}, SOLUTIONTIME={vis_time_step.time}, DATAPACKING=BLOCK, VARLOCATION=({self.__get_varlocarion_string(vector_headers)})'
|
|
@@ -1226,38 +1244,40 @@ class vis_reader:
|
|
|
1226
1244
|
#time_statement = f'ZONE T ="{vis_time_step.time_step}, Time = {vis_time_step.time}", N = {vtu_cell_to_points.GetNumberOfPoints()}, E = {vtu_cell_to_points.GetNumberOfCells()}, F = FEPOINT, ET = {tecplot_cell_type}\n'
|
|
1227
1245
|
file.write(f'{time_statement}\n')
|
|
1228
1246
|
|
|
1247
|
+
max_line_length = 20000
|
|
1229
1248
|
# X, Y, Z
|
|
1230
|
-
if firstFile:
|
|
1231
|
-
for
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1249
|
+
if firstFile:
|
|
1250
|
+
for point_idx in range(0, 3):
|
|
1251
|
+
line_string = ''
|
|
1252
|
+
for i in range(0, vector_vtr.GetNumberOfPoints()):
|
|
1253
|
+
point = vector_vtr.GetPoint(i)
|
|
1254
|
+
#file.write(str(point[0]) + " ")
|
|
1255
|
+
if len(line_string) + len(str(point[point_idx])) + 1 > max_line_length:
|
|
1256
|
+
# write the current line to file
|
|
1257
|
+
file.write(f'{line_string}\n')
|
|
1258
|
+
# reset the line string
|
|
1259
|
+
line_string = ''
|
|
1260
|
+
line_string = f'{line_string}{str(point[point_idx])} '
|
|
1261
|
+
file.write(f'{line_string}\n')
|
|
1235
1262
|
|
|
1236
|
-
for i in range(0, vector_vtr.GetNumberOfPoints()):
|
|
1237
|
-
point = vector_vtr.GetPoint(i)
|
|
1238
|
-
file.write(str(point[1]) + " ")
|
|
1239
|
-
file.write(" \n")
|
|
1240
1263
|
|
|
1241
|
-
for i in range(0, vector_vtr.GetNumberOfPoints()):
|
|
1242
|
-
point = vector_vtr.GetPoint(i)
|
|
1243
|
-
file.write(str(point[2]) + " ")
|
|
1244
|
-
file.write(" \n")
|
|
1245
1264
|
|
|
1246
1265
|
# Other data
|
|
1247
|
-
for header in
|
|
1248
|
-
array = vector_vtr.GetCellData().GetArray(header)
|
|
1266
|
+
for header in self.setting.selected_variables_vector:
|
|
1249
1267
|
|
|
1250
|
-
|
|
1251
|
-
file.write(f'{str(array.GetComponent(e, 0))} ')
|
|
1252
|
-
file.write(" \n")
|
|
1253
|
-
|
|
1254
|
-
for e in range(0, vector_vtr.GetNumberOfCells()):
|
|
1255
|
-
file.write(f'{str(array.GetComponent(e, 1))} ')
|
|
1256
|
-
file.write(" \n")
|
|
1268
|
+
array = vector_vtr.GetCellData().GetArray(header)
|
|
1257
1269
|
|
|
1258
|
-
for
|
|
1259
|
-
|
|
1260
|
-
|
|
1270
|
+
for dim_idx in range(0, 3):
|
|
1271
|
+
line_string = ''
|
|
1272
|
+
for e in range(0, vector_vtr.GetNumberOfCells()):
|
|
1273
|
+
#file.write(f'{str(array.GetComponent(e, 0))} ')
|
|
1274
|
+
if len(line_string) + len(str(array.GetComponent(e, dim_idx))) + 1 > max_line_length:
|
|
1275
|
+
# write the current line to file
|
|
1276
|
+
file.write(f'{line_string}\n')
|
|
1277
|
+
# reset the line string
|
|
1278
|
+
line_string = ''
|
|
1279
|
+
line_string = f'{line_string}{str(array.GetComponent(e, dim_idx))} '
|
|
1280
|
+
file.write(f'{line_string}\n')
|
|
1261
1281
|
|
|
1262
1282
|
file.close()
|
|
1263
1283
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toughanimator
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: A tool for visualizing TOUGH simulation outputs.
|
|
5
5
|
Home-page: https://github.com/scarletref/toughanimator
|
|
6
6
|
Author: scarletref
|
|
@@ -8,7 +8,7 @@ Author-email: scarletreflection@gmail.com
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11,<3.14
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
Requires-Dist: numpy
|
|
14
14
|
Requires-Dist: pandas
|
|
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
|