toughanimator 0.1.7__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.7 → toughanimator-0.1.9}/PKG-INFO +2 -2
- {toughanimator-0.1.7 → toughanimator-0.1.9}/setup.py +2 -2
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator/run.py +1 -1
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator/tough_classes.py +76 -46
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator.egg-info/PKG-INFO +2 -2
- {toughanimator-0.1.7 → toughanimator-0.1.9}/README.md +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/pyproject.toml +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/setup.cfg +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/tests/test_all_cases.py +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator/__init__.py +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator.egg-info/SOURCES.txt +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator.egg-info/dependency_links.txt +0 -0
- {toughanimator-0.1.7 → toughanimator-0.1.9}/toughanimator.egg-info/requires.txt +0 -0
- {toughanimator-0.1.7 → 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"
|
|
@@ -817,8 +817,18 @@ class vis_reader:
|
|
|
817
817
|
|
|
818
818
|
vtr.GetCellData().AddArray(delPArray)
|
|
819
819
|
post_variable_list.append(VisVariable(f'del_{p_name}', ValueType.Scalar, 1))
|
|
820
|
+
|
|
821
|
+
# Put cell-centered data into points
|
|
822
|
+
filter = vtkCellDataToPointData()
|
|
823
|
+
filter.SetInputData(vtr)
|
|
824
|
+
filter.Update()
|
|
825
|
+
vtr_cell_to_points = filter.GetOutput()
|
|
826
|
+
|
|
827
|
+
if vtr.GetCellData().GetArray(f'del_{p_name}') is not None:
|
|
828
|
+
vtr.GetPointData().AddArray(vtr_cell_to_points.GetPointData().GetArray(f'del_{p_name}'))
|
|
820
829
|
|
|
821
|
-
|
|
830
|
+
|
|
831
|
+
# add toughreact variables
|
|
822
832
|
if self.setting.tough_version == ToughVersion.TOUGHReact or self.setting.tough_version == ToughVersion.TOUGH3:
|
|
823
833
|
trapHCO2_array = vtkDoubleArray()
|
|
824
834
|
trapHCO2_array.SetName('trapHCO2')
|
|
@@ -1018,6 +1028,9 @@ class vis_reader:
|
|
|
1018
1028
|
if os.path.isfile(self.tec_scalar_path):
|
|
1019
1029
|
firstFile = False
|
|
1020
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
|
+
|
|
1021
1034
|
if firstFile:
|
|
1022
1035
|
file.write('TITLE = TECPLOT PLOT \n')
|
|
1023
1036
|
selected_header_string = '"'+'", "'.join(self.setting.selected_variables_scalar) + '"'
|
|
@@ -1028,37 +1041,42 @@ class vis_reader:
|
|
|
1028
1041
|
|
|
1029
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'
|
|
1030
1043
|
|
|
1031
|
-
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)})'
|
|
1032
1045
|
if not firstFile:
|
|
1033
1046
|
time_statement = f'{time_statement}, D=(1,2,3,FECONNECT)'
|
|
1034
1047
|
#if self.setting.debug:
|
|
1035
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'
|
|
1036
1049
|
file.write(f'{time_statement}\n')
|
|
1037
|
-
|
|
1050
|
+
max_line_length = 20000
|
|
1038
1051
|
# X, Y, Z
|
|
1039
1052
|
if firstFile:
|
|
1040
|
-
for
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
file.write(
|
|
1053
|
-
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')
|
|
1054
1066
|
|
|
1055
1067
|
# Other data
|
|
1056
1068
|
for header in self.setting.selected_variables_scalar:
|
|
1057
1069
|
array = vtr.GetCellData().GetArray(header)
|
|
1058
|
-
|
|
1070
|
+
line_string = ''
|
|
1059
1071
|
for e in range(0, vtr.GetNumberOfCells()):
|
|
1060
|
-
file.write(str(array.
|
|
1061
|
-
|
|
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')
|
|
1062
1080
|
|
|
1063
1081
|
file.close()
|
|
1064
1082
|
|
|
@@ -1193,6 +1211,11 @@ class vis_reader:
|
|
|
1193
1211
|
|
|
1194
1212
|
if VisType.Tecplot not in self.setting.vis_types:
|
|
1195
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
|
|
1196
1219
|
|
|
1197
1220
|
# Start Tecplot generating
|
|
1198
1221
|
tec_name = pathlib.Path(self.setting.input_file_paths[0]).stem
|
|
@@ -1202,11 +1225,16 @@ class vis_reader:
|
|
|
1202
1225
|
firstFile = False
|
|
1203
1226
|
file = open(self.tec_vector_path, "a")
|
|
1204
1227
|
|
|
1205
|
-
|
|
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
|
+
|
|
1206
1233
|
# add header
|
|
1207
1234
|
if firstFile:
|
|
1208
1235
|
file.write('TITLE = TECPLOT PLOT \n')
|
|
1209
1236
|
header_string = '"'+'", "'.join(vector_headers) + '"'
|
|
1237
|
+
|
|
1210
1238
|
file.write(f'VARIABLES = "X", "Y", "Z", {header_string}\n')
|
|
1211
1239
|
|
|
1212
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)})'
|
|
@@ -1216,38 +1244,40 @@ class vis_reader:
|
|
|
1216
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'
|
|
1217
1245
|
file.write(f'{time_statement}\n')
|
|
1218
1246
|
|
|
1247
|
+
max_line_length = 20000
|
|
1219
1248
|
# X, Y, Z
|
|
1220
|
-
if firstFile:
|
|
1221
|
-
for
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
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')
|
|
1225
1262
|
|
|
1226
|
-
for i in range(0, vector_vtr.GetNumberOfPoints()):
|
|
1227
|
-
point = vector_vtr.GetPoint(i)
|
|
1228
|
-
file.write(str(point[1]) + " ")
|
|
1229
|
-
file.write(" \n")
|
|
1230
1263
|
|
|
1231
|
-
for i in range(0, vector_vtr.GetNumberOfPoints()):
|
|
1232
|
-
point = vector_vtr.GetPoint(i)
|
|
1233
|
-
file.write(str(point[2]) + " ")
|
|
1234
|
-
file.write(" \n")
|
|
1235
1264
|
|
|
1236
1265
|
# Other data
|
|
1237
|
-
for header in
|
|
1238
|
-
array = vector_vtr.GetCellData().GetArray(header)
|
|
1239
|
-
|
|
1240
|
-
for e in range(0, vector_vtr.GetNumberOfCells()):
|
|
1241
|
-
file.write(f'{str(array.GetComponent(e, 0))} ')
|
|
1242
|
-
file.write(" \n")
|
|
1266
|
+
for header in self.setting.selected_variables_vector:
|
|
1243
1267
|
|
|
1244
|
-
|
|
1245
|
-
file.write(f'{str(array.GetComponent(e, 1))} ')
|
|
1246
|
-
file.write(" \n")
|
|
1268
|
+
array = vector_vtr.GetCellData().GetArray(header)
|
|
1247
1269
|
|
|
1248
|
-
for
|
|
1249
|
-
|
|
1250
|
-
|
|
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')
|
|
1251
1281
|
|
|
1252
1282
|
file.close()
|
|
1253
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
|