toughanimator 0.1.12__tar.gz → 0.1.14__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.12 → toughanimator-0.1.14}/PKG-INFO +1 -1
- {toughanimator-0.1.12 → toughanimator-0.1.14}/setup.py +1 -1
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator/run.py +5 -4
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator/tough_classes.py +128 -56
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator.egg-info/PKG-INFO +1 -1
- {toughanimator-0.1.12 → toughanimator-0.1.14}/README.md +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/pyproject.toml +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/setup.cfg +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/tests/test_all_cases.py +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator/__init__.py +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator.egg-info/SOURCES.txt +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator.egg-info/dependency_links.txt +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator.egg-info/requires.txt +0 -0
- {toughanimator-0.1.12 → toughanimator-0.1.14}/toughanimator.egg-info/top_level.txt +0 -0
|
@@ -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.14',
|
|
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',
|
|
@@ -11,7 +11,8 @@ case_name = "3D five spot MINC"
|
|
|
11
11
|
test_case_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), dir_name)
|
|
12
12
|
|
|
13
13
|
case_dir = os.path.join(test_case_dir, case_name)
|
|
14
|
-
case_dir = r"D:\Projects\
|
|
14
|
+
case_dir = r"D:\Projects\202601\0 Base_res_k_hysteresis"
|
|
15
|
+
#case_dir = r"D:\Projects\202601\260123_UWC_homo"
|
|
15
16
|
#case_dir = r"D:\Projects\202511\ta-post\0 Base_res_k"
|
|
16
17
|
#case_dir = r"D:\Projects\202504\polygonal\poly_test"
|
|
17
18
|
#case_dir = r"D:\Projects\202507\tough系列output\tough output format\TR_MINC_exe"
|
|
@@ -19,10 +20,10 @@ case_dir = r"D:\Projects\tough-processing\uwc\tough_case\uwc_polygonal_20251231\
|
|
|
19
20
|
#case_dir = r"D:\Projects\202511\case_TRv4\uwc"
|
|
20
21
|
#case_dir = r"D:\Projects\202501\toughanimator\test_cases\2DCCS 100yrs_RC"
|
|
21
22
|
reader = ta.vis_reader(case_dir)
|
|
22
|
-
reader.write_eleme_conne()
|
|
23
|
-
reader.write_geometry()
|
|
23
|
+
#reader.write_eleme_conne()
|
|
24
|
+
#reader.write_geometry()
|
|
24
25
|
#reader.write_incon()
|
|
25
26
|
#reader.write_result()
|
|
26
|
-
|
|
27
|
+
reader.write_all()
|
|
27
28
|
|
|
28
29
|
|
|
@@ -70,7 +70,7 @@ class VisVariable:
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
class VisSetting:
|
|
73
|
-
def __init__(self, input_file_paths, out_file_paths, vis_dir, corners_file="unkown", out_format_type=OutType.Unknown, tough_version = ToughVersion.Unknown, vis_types=[VisType.ParaView, VisType.Tecplot], mesh_type=MeshType.RegularGrid, debug=False, eos="ECO2N", minc=False, selected_variables_scalar = [], selected_variables_vector = [], ngv=False):
|
|
73
|
+
def __init__(self, input_file_paths, out_file_paths, vis_dir, corners_file="unkown", out_format_type=OutType.Unknown, tough_version = ToughVersion.Unknown, vis_types=[VisType.ParaView, VisType.Tecplot], mesh_type=MeshType.RegularGrid, debug=False, eos="ECO2N", minc=False, selected_variables_scalar = [], selected_variables_vector = [], ngv=False, trap=False):
|
|
74
74
|
self.mesh_type = mesh_type
|
|
75
75
|
self.out_format_type = out_format_type
|
|
76
76
|
self.vis_types = vis_types
|
|
@@ -89,6 +89,7 @@ class VisSetting:
|
|
|
89
89
|
self.selected_variables_scalar = selected_variables_scalar
|
|
90
90
|
self.selected_variables_vector = selected_variables_vector
|
|
91
91
|
self.ngv = ngv
|
|
92
|
+
self.trap = trap
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
def setBounds(self, x_bounds, y_bounds, z_bounds):
|
|
@@ -106,7 +107,7 @@ class vis_reader:
|
|
|
106
107
|
self.rock_dict = []
|
|
107
108
|
if os.path.isdir(case_dir):
|
|
108
109
|
config_path = os.path.join(case_dir, "config.json")
|
|
109
|
-
if os.path.
|
|
110
|
+
if os.path.isfile(config_path):
|
|
110
111
|
with open(config_path, "r", encoding="latin-1") as config_file:
|
|
111
112
|
config = json.load(config_file)
|
|
112
113
|
|
|
@@ -167,7 +168,8 @@ class vis_reader:
|
|
|
167
168
|
selected_variables_scalar = config['selected_variables_scalar'] if 'selected_variables_scalar' in config else [],
|
|
168
169
|
selected_variables_vector = config['selected_variables_vector'] if 'selected_variables_vector' in config else [],
|
|
169
170
|
#ngv= config['NGV'] if 'NGV' in config else False
|
|
170
|
-
ngv = next((v for k, v in config.items() if k.lower() == "ngv"),False)
|
|
171
|
+
ngv = next((v for k, v in config.items() if k.lower() == "ngv"),False),
|
|
172
|
+
trap= next((v for k, v in config.items() if k.lower() == "trap"),False)
|
|
171
173
|
)
|
|
172
174
|
|
|
173
175
|
# check if the project is using MINC
|
|
@@ -406,10 +408,15 @@ class vis_reader:
|
|
|
406
408
|
|
|
407
409
|
#skip 1 lines
|
|
408
410
|
f.readline()
|
|
409
|
-
third_line = f.readline()
|
|
410
|
-
new_line = f'{first_line}{third_line}'
|
|
411
|
-
self.rocks_buffer.write(new_line)
|
|
412
411
|
f.readline()
|
|
412
|
+
forth_line = f.readline() # read forth line
|
|
413
|
+
if len(forth_line) < 30:
|
|
414
|
+
# create a line with fixed lenth dafault value
|
|
415
|
+
values = [8, 0, 0.03]
|
|
416
|
+
forth_line = "".join(f"{v:10.3f}" for v in values)
|
|
417
|
+
new_line = f'{first_line}{forth_line}' # merge first and forth line
|
|
418
|
+
self.rocks_buffer.write(new_line)
|
|
419
|
+
|
|
413
420
|
|
|
414
421
|
|
|
415
422
|
if has_rocks == False:
|
|
@@ -851,8 +858,8 @@ class vis_reader:
|
|
|
851
858
|
extension = os.path.splitext(self.main_geometry)[1]
|
|
852
859
|
vtr_path = os.path.join(self.setting.vis_dir, 'paraview', f'time_step_{vis_time_step.time_step}{extension}')
|
|
853
860
|
self.time_steps_list[time_index].vtu_file_name = vtr_path
|
|
854
|
-
|
|
855
|
-
|
|
861
|
+
vtr = self.__read_vtk_file(vtr_path)
|
|
862
|
+
|
|
856
863
|
|
|
857
864
|
post_variable_list = []
|
|
858
865
|
# p
|
|
@@ -889,7 +896,8 @@ class vis_reader:
|
|
|
889
896
|
|
|
890
897
|
|
|
891
898
|
# add toughreact variables
|
|
892
|
-
if self.setting.tough_version == ToughVersion.TOUGHReact or self.setting.tough_version == ToughVersion.TOUGH3:
|
|
899
|
+
#if self.setting.tough_version == ToughVersion.TOUGHReact or self.setting.tough_version == ToughVersion.TOUGH3:
|
|
900
|
+
if self.setting.trap:
|
|
893
901
|
trapHCO2_array = vtkDoubleArray()
|
|
894
902
|
trapHCO2_array.SetName('trapHCO2')
|
|
895
903
|
|
|
@@ -902,49 +910,94 @@ class vis_reader:
|
|
|
902
910
|
trapMCO2_array = vtkDoubleArray()
|
|
903
911
|
trapMCO2_array.SetName('trapMCO2')
|
|
904
912
|
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
# 1. Saturation of gas
|
|
916
|
+
sat_gas_array = None
|
|
917
|
+
sat_gas_names = ["SatGas", "SAT_G", "SG"]
|
|
918
|
+
for sat_gas_name in sat_gas_names:
|
|
919
|
+
if vtr.GetCellData().GetArray(sat_gas_name) is not None:
|
|
920
|
+
sat_gas_array = vtr.GetCellData().GetArray(sat_gas_name)
|
|
921
|
+
if sat_gas_array is None:
|
|
922
|
+
print(f' ⚠️ Can\'t find gas saturation array (SatGas/SAT_G/SG). Skipping trap calculations.')
|
|
923
|
+
return
|
|
924
|
+
|
|
925
|
+
# 2. Porosity
|
|
926
|
+
porosity_array = None
|
|
927
|
+
porosity_names = ["Porosity", "POR"] # if not found, try Rock_dict # TODO:異質性考慮
|
|
928
|
+
for porosity_name in porosity_names:
|
|
929
|
+
if vtr.GetCellData().GetArray(porosity_name) is not None:
|
|
930
|
+
porosity_array = vtr.GetCellData().GetArray(porosity_name)
|
|
931
|
+
if porosity_array is None:
|
|
932
|
+
porosity_array = vtr.GetCellData().GetArray("rock_por")
|
|
933
|
+
if porosity_array is None:
|
|
934
|
+
print(f' ⚠️ Can\'t find porosity array (Porosity/POR). Skipping trap calculations.')
|
|
935
|
+
return
|
|
936
|
+
|
|
937
|
+
# 3. Gas density
|
|
938
|
+
dgas_kg_m3_array = None
|
|
939
|
+
dgas_names = ["DGas_kg/m3", "DEN_G", "DG (kg/m^3)"]
|
|
940
|
+
for dgas_name in dgas_names:
|
|
941
|
+
if vtr.GetCellData().GetArray(dgas_name) is not None:
|
|
942
|
+
dgas_kg_m3_array = vtr.GetCellData().GetArray(dgas_name)
|
|
943
|
+
if dgas_kg_m3_array is None:
|
|
944
|
+
print(f' ⚠️ Can\'t find gas density array (DGas_kg/m3/DEN_G). Skipping trap calculations.')
|
|
945
|
+
return
|
|
946
|
+
|
|
947
|
+
# 4. Liquid saturation (if not, 1-SG)
|
|
948
|
+
sat_liq_array = None
|
|
949
|
+
sat_liq_names = ["SatLiq", "SAT_L"]
|
|
950
|
+
for sat_liq_name in sat_liq_names:
|
|
951
|
+
if vtr.GetCellData().GetArray(sat_liq_name) is not None:
|
|
952
|
+
sat_liq_array = vtr.GetCellData().GetArray(sat_liq_name)
|
|
953
|
+
if sat_liq_array is None:
|
|
954
|
+
if sat_gas_array is not None:
|
|
955
|
+
sat_liq_array = vtkDoubleArray()
|
|
956
|
+
for index in range(0, vtr.GetNumberOfCells()):
|
|
957
|
+
sat_liq_value = 1 - sat_gas_array.GetValue(index)
|
|
958
|
+
sat_liq_array.InsertNextValue(sat_liq_value)
|
|
959
|
+
else:
|
|
960
|
+
print(f' ⚠️ Can\'t find liquid saturation array (SatLiq/SAT_L). Skipping trap calculations.')
|
|
961
|
+
return
|
|
962
|
+
|
|
963
|
+
# 5. CO2 concentration in liquid
|
|
964
|
+
xco2_liq_array = None
|
|
965
|
+
xco2_liq_names = ["XCO2Liq", "X_CO2 _L", "X_CO2_L", "XCO2aq"]
|
|
966
|
+
for xco2_liq_name in xco2_liq_names:
|
|
967
|
+
if vtr.GetCellData().GetArray(xco2_liq_name) is not None:
|
|
968
|
+
xco2_liq_array = vtr.GetCellData().GetArray(xco2_liq_name)
|
|
969
|
+
if xco2_liq_array is None:
|
|
970
|
+
print(f' ⚠️ Can\'t find XCO2 in liquid array (XCO2Liq/X_CO2_L). Skipping trap calculations.')
|
|
971
|
+
return
|
|
972
|
+
|
|
973
|
+
# 6. residual gas saturation
|
|
974
|
+
sgr_array = None
|
|
975
|
+
if vtr.GetCellData().GetArray("sgr") is not None: # rock line4 3rd value default = 0.03 user guide:resitual of gas
|
|
976
|
+
sgr_array = vtr.GetCellData().GetArray("sgr")
|
|
977
|
+
if sgr_array is None:
|
|
978
|
+
print(f' ⚠️ Can\'t find residual gas saturation array (sgr). Skipping trap calculations.')
|
|
979
|
+
return
|
|
980
|
+
|
|
981
|
+
# 7. VOLX
|
|
982
|
+
volx_array = None
|
|
983
|
+
if vtr.GetCellData().GetArray("VOLX") is not None:
|
|
984
|
+
volx_array = vtr.GetCellData().GetArray("VOLX")
|
|
985
|
+
else:
|
|
986
|
+
print(f' ⚠️ Can\'t find cell volume array (VOLX). Skipping trap calculations.')
|
|
987
|
+
return
|
|
988
|
+
|
|
905
989
|
for index in range(0, vtr.GetNumberOfCells()):
|
|
906
990
|
trapHCO2 = 0
|
|
907
991
|
trapRCO2 = 0
|
|
908
992
|
trapDCO2 = 0
|
|
909
993
|
trapMCO2 = 0
|
|
910
|
-
VOLX =
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
elif vtr.GetCellData().GetArray("SAT_G") is not None:
|
|
918
|
-
SatGas = vtr.GetCellData().GetArray("SAT_G").GetValue(index)
|
|
919
|
-
|
|
920
|
-
Porosity = 0
|
|
921
|
-
if vtr.GetCellData().GetArray("Porosity") is not None:
|
|
922
|
-
Porosity = vtr.GetCellData().GetArray("Porosity").GetValue(index)
|
|
923
|
-
elif vtr.GetCellData().GetArray("POR") is not None:
|
|
924
|
-
Porosity = vtr.GetCellData().GetArray("POR").GetValue(index)
|
|
925
|
-
|
|
926
|
-
DGas_kg_m3 = 0
|
|
927
|
-
if vtr.GetCellData().GetArray("DGas_kg/m3") is not None:
|
|
928
|
-
DGas_kg_m3 = vtr.GetCellData().GetArray("DGas_kg/m3").GetValue(index)
|
|
929
|
-
elif vtr.GetCellData().GetArray("DEN_G") is not None:
|
|
930
|
-
DGas_kg_m3 = vtr.GetCellData().GetArray("DEN_G").GetValue(index)
|
|
931
|
-
|
|
932
|
-
SatLiq = 0
|
|
933
|
-
if vtr.GetCellData().GetArray("SatLiq") is not None:
|
|
934
|
-
SatLiq = vtr.GetCellData().GetArray("SatLiq").GetValue(index)
|
|
935
|
-
elif vtr.GetCellData().GetArray("SAT_L") is not None:
|
|
936
|
-
SatLiq = vtr.GetCellData().GetArray("SAT_L").GetValue(index)
|
|
937
|
-
|
|
938
|
-
XCO2Liq = 0
|
|
939
|
-
if vtr.GetCellData().GetArray("XCO2Liq") is not None:
|
|
940
|
-
XCO2Liq = vtr.GetCellData().GetArray("XCO2Liq").GetValue(index)
|
|
941
|
-
elif vtr.GetCellData().GetArray("X_CO2_L") is not None:
|
|
942
|
-
XCO2Liq = vtr.GetCellData().GetArray("X_CO2_L").GetValue(index)
|
|
943
|
-
|
|
944
|
-
sgr = 0
|
|
945
|
-
if vtr.GetCellData().GetArray("sgr") is not None:
|
|
946
|
-
sgr = vtr.GetCellData().GetArray("sgr").GetValue(index)
|
|
947
|
-
|
|
994
|
+
VOLX = volx_array.GetValue(index)
|
|
995
|
+
SatGas = sat_gas_array.GetValue(index)
|
|
996
|
+
Porosity = porosity_array.GetValue(index)
|
|
997
|
+
DGas_kg_m3 = dgas_kg_m3_array.GetValue(index)
|
|
998
|
+
SatLiq = sat_liq_array.GetValue(index)
|
|
999
|
+
XCO2Liq = xco2_liq_array.GetValue(index)
|
|
1000
|
+
sgr = sgr_array.GetValue(index)
|
|
948
1001
|
|
|
949
1002
|
trapHCO2 =(SatGas-sgr)*VOLX*Porosity*DGas_kg_m3* (SatGas>sgr)
|
|
950
1003
|
trapRCO2 = 0.05 * VOLX * Porosity * DGas_kg_m3* (SatGas > sgr)+ SatGas * VOLX * Porosity * DGas_kg_m3*(SatGas <= sgr)
|
|
@@ -1586,12 +1639,12 @@ class vis_reader:
|
|
|
1586
1639
|
'''
|
|
1587
1640
|
compute permeability
|
|
1588
1641
|
'''
|
|
1589
|
-
rock_colspecs = [(0, 5), (30, 40), (40, 50), (50, 60), (100, 110)] # define column widths
|
|
1590
|
-
rock_names = ['MAT', 'PER_1', 'PER_2', 'PER_3', 'SGR']
|
|
1642
|
+
rock_colspecs = [(0, 5), (20, 30), (30, 40), (40, 50), (50, 60), (100, 110)] # define column widths
|
|
1643
|
+
rock_names = ['MAT', 'POR', 'PER_1', 'PER_2', 'PER_3', 'SGR']
|
|
1591
1644
|
self.rocks_buffer.seek(0)
|
|
1592
1645
|
rocks_df = pd.read_fwf(self.rocks_buffer, colspecs=rock_colspecs, header=None,
|
|
1593
1646
|
names=rock_names,
|
|
1594
|
-
dtype={'MAT':str, 'PER_1':str, 'PER_2':str, 'PER_3':str, 'SGR':str})
|
|
1647
|
+
dtype={'MAT':str, 'POR':str, 'PER_1':str, 'PER_2':str, 'PER_3':str, 'SGR':str})
|
|
1595
1648
|
|
|
1596
1649
|
#sgr_dict = {}
|
|
1597
1650
|
self.rock_dict = None
|
|
@@ -1603,6 +1656,7 @@ class vis_reader:
|
|
|
1603
1656
|
rock_dict.append({
|
|
1604
1657
|
'id': i,
|
|
1605
1658
|
'rock_name': rocks_df['MAT'][i],
|
|
1659
|
+
'por':self.__parse_float(rocks_df['POR'][i]),
|
|
1606
1660
|
'per_1':self.__parse_float(rocks_df['PER_1'][i]),
|
|
1607
1661
|
'per_2':self.__parse_float(rocks_df['PER_2'][i]),
|
|
1608
1662
|
'per_3':self.__parse_float(rocks_df['PER_3'][i]),
|
|
@@ -1615,22 +1669,31 @@ class vis_reader:
|
|
|
1615
1669
|
|
|
1616
1670
|
sgr_array = vtkDoubleArray()
|
|
1617
1671
|
sgr_array.SetName('sgr')
|
|
1672
|
+
|
|
1673
|
+
porosity_array = vtkDoubleArray()
|
|
1674
|
+
porosity_array.SetName('rock_por')
|
|
1675
|
+
|
|
1618
1676
|
for i in range(0, len(elem_df.values)):
|
|
1619
1677
|
value = 0
|
|
1620
|
-
|
|
1678
|
+
sgr = 0
|
|
1679
|
+
porosity = 0
|
|
1621
1680
|
mat = matArray.GetValue(i)
|
|
1622
1681
|
if self.__isInt(mat):
|
|
1623
1682
|
mat_id = int(mat)
|
|
1624
1683
|
value = pmxArray.GetValue(i) * rock_dict[mat_id-1]['per_1']
|
|
1625
1684
|
sgr = rock_dict[mat_id-1]['sgr']
|
|
1685
|
+
porosity = rock_dict[mat_id-1]['por']
|
|
1626
1686
|
else:
|
|
1627
1687
|
rock_item = [rock for rock in rock_dict if rock['rock_name'] == mat]
|
|
1628
1688
|
#if mat in rock_dict:
|
|
1629
1689
|
value = pmxArray.GetValue(i) * rock_item[0]['per_1']
|
|
1630
1690
|
sgr = rock_item[0]['sgr']
|
|
1691
|
+
porosity = rock_item[0]['por']
|
|
1692
|
+
|
|
1631
1693
|
|
|
1632
1694
|
per_array.InsertNextValue(value)
|
|
1633
1695
|
sgr_array.InsertNextValue(sgr)
|
|
1696
|
+
porosity_array.InsertNextValue(porosity)
|
|
1634
1697
|
self.rock_dict = rock_dict
|
|
1635
1698
|
|
|
1636
1699
|
|
|
@@ -1673,6 +1736,10 @@ class vis_reader:
|
|
|
1673
1736
|
elem_conne_vtu.GetPointData().AddArray(volxArray)
|
|
1674
1737
|
elem_conne_vtu.GetPointData().AddArray(matArray)
|
|
1675
1738
|
elem_conne_vtu.GetPointData().AddArray(matIDArray)
|
|
1739
|
+
if self.rock_dict is not None:
|
|
1740
|
+
elem_conne_vtu.GetPointData().AddArray(per_array)
|
|
1741
|
+
elem_conne_vtu.GetPointData().AddArray(sgr_array)
|
|
1742
|
+
elem_conne_vtu.GetPointData().AddArray(porosity_array)
|
|
1676
1743
|
|
|
1677
1744
|
elem_conne_vtu.SetCells(4, line_cell_array)
|
|
1678
1745
|
elem_conne_vtu.GetCellData().AddArray(d1_array)
|
|
@@ -1711,8 +1778,9 @@ class vis_reader:
|
|
|
1711
1778
|
matIDArray = elem_conne_vtu.GetPointData().GetArray('Material_ID')
|
|
1712
1779
|
pmxArray = elem_conne_vtu.GetPointData().GetArray('PMX')
|
|
1713
1780
|
if self.rock_dict is not None:
|
|
1714
|
-
per_array = elem_conne_vtu.
|
|
1715
|
-
sgr_array = elem_conne_vtu.
|
|
1781
|
+
per_array = elem_conne_vtu.GetPointData().GetArray('Permeability')
|
|
1782
|
+
sgr_array = elem_conne_vtu.GetPointData().GetArray('sgr')
|
|
1783
|
+
porosity_array = elem_conne_vtu.GetPointData().GetArray('rock_por')
|
|
1716
1784
|
|
|
1717
1785
|
|
|
1718
1786
|
|
|
@@ -1754,7 +1822,7 @@ class vis_reader:
|
|
|
1754
1822
|
|
|
1755
1823
|
|
|
1756
1824
|
if all(xyz_elem) and range_ratio < 1000:
|
|
1757
|
-
if os.path.
|
|
1825
|
+
if os.path.isfile(self.setting.corners_file):
|
|
1758
1826
|
self.setting.mesh_type = MeshType.StructuredGridOrth
|
|
1759
1827
|
else:
|
|
1760
1828
|
self.setting.mesh_type = MeshType.RegularGrid
|
|
@@ -1762,7 +1830,7 @@ class vis_reader:
|
|
|
1762
1830
|
else:
|
|
1763
1831
|
is_parallel = self.__checkParallel(elem_conne_vtu)
|
|
1764
1832
|
# check if polygonal mesh
|
|
1765
|
-
if os.path.
|
|
1833
|
+
if os.path.isfile(self.setting.corners_file):
|
|
1766
1834
|
|
|
1767
1835
|
if is_parallel:
|
|
1768
1836
|
self.setting.mesh_type = MeshType.StructuredGridFree
|
|
@@ -1775,7 +1843,7 @@ class vis_reader:
|
|
|
1775
1843
|
print(f' Mesh type: {self.setting.mesh_type.name}')
|
|
1776
1844
|
|
|
1777
1845
|
# Read corners file to dataframe
|
|
1778
|
-
if os.path.
|
|
1846
|
+
if os.path.isfile(self.setting.corners_file):
|
|
1779
1847
|
corners_buffer = io.StringIO()
|
|
1780
1848
|
csv_headers = []
|
|
1781
1849
|
line_number = -1
|
|
@@ -1934,6 +2002,7 @@ class vis_reader:
|
|
|
1934
2002
|
if self.rock_dict is not None:
|
|
1935
2003
|
rGrid.GetCellData().AddArray(per_array)
|
|
1936
2004
|
rGrid.GetCellData().AddArray(sgr_array)
|
|
2005
|
+
rGrid.GetCellData().AddArray(porosity_array)
|
|
1937
2006
|
rGrid.GetCellData().AddArray(pmxArray)
|
|
1938
2007
|
|
|
1939
2008
|
self.main_geometry = os.path.join(
|
|
@@ -1973,6 +2042,7 @@ class vis_reader:
|
|
|
1973
2042
|
if self.rock_dict is not None:
|
|
1974
2043
|
vts.GetCellData().AddArray(per_array)
|
|
1975
2044
|
vts.GetCellData().AddArray(sgr_array)
|
|
2045
|
+
vts.GetCellData().AddArray(porosity_array)
|
|
1976
2046
|
self.main_geometry = os.path.join(self.setting.vis_dir, "main_geometry.vts")
|
|
1977
2047
|
self.__write_vtk_file(vts, self.main_geometry)
|
|
1978
2048
|
|
|
@@ -2020,6 +2090,7 @@ class vis_reader:
|
|
|
2020
2090
|
if self.rock_dict is not None:
|
|
2021
2091
|
auto_corner_vtu.GetCellData().AddArray(per_array)
|
|
2022
2092
|
auto_corner_vtu.GetCellData().AddArray(sgr_array)
|
|
2093
|
+
auto_corner_vtu.GetCellData().AddArray(porosity_array)
|
|
2023
2094
|
auto_corner_vtu.GetCellData().AddArray(matIDArray)
|
|
2024
2095
|
self.main_geometry = os.path.join(self.setting.vis_dir, "main_geometry.vtu")
|
|
2025
2096
|
self.__write_vtk_file(auto_corner_vtu, self.main_geometry)
|
|
@@ -2360,6 +2431,7 @@ class vis_reader:
|
|
|
2360
2431
|
if self.rock_dict is not None:
|
|
2361
2432
|
main_geometray.GetCellData().AddArray(per_array)
|
|
2362
2433
|
main_geometray.GetCellData().AddArray(sgr_array)
|
|
2434
|
+
main_geometray.GetCellData().AddArray(porosity_array)
|
|
2363
2435
|
|
|
2364
2436
|
main_geometray.GetCellData().AddArray(matIDArray)
|
|
2365
2437
|
main_geometray.GetCellData().AddArray(horizon_id_array)
|
|
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
|