From c57f8124586bcc31268886873d95ee55da1561fa Mon Sep 17 00:00:00 2001 From: Adam Cheng <52572642+adamchengtkc@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:55:30 +0000 Subject: [PATCH] fix resqml time index inverted --- warmth/mesh_model.py | 8 ++++---- warmth/resqpy_helpers.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/warmth/mesh_model.py b/warmth/mesh_model.py index 3c403df..26841da 100644 --- a/warmth/mesh_model.py +++ b/warmth/mesh_model.py @@ -8,6 +8,7 @@ from petsc4py import PETSc import ufl import sys +import time from scipy.interpolate import LinearNDInterpolator from progress.bar import Bar from warmth.build import single_node, Builder @@ -18,12 +19,10 @@ from .resqpy_helpers import write_tetra_grid_with_properties, write_hexa_grid_with_timeseries, write_hexa_grid_with_properties,read_mesh_resqml_hexa def tic(): #Homemade version of matlab tic and toc functions - import time global startTime_for_tictoc startTime_for_tictoc = time.time() def toc(msg=""): - import time if 'startTime_for_tictoc' in globals(): delta = time.time() - startTime_for_tictoc print (msg+": Elapsed time is " + str(delta) + " seconds.") @@ -350,12 +349,13 @@ def write_hexa_mesh_timeseries( self, out_path): points_cached_series[idx,count,:]=x_original_order[i,:] point_original_to_cached[i]= count count += 1 - logger.info("Calculating vitrinite reflectance EasyRo%DL") + s = time.time() + logger.debug("Calculating vitrinite reflectance EasyRo%DL") for i in range(Temp_per_vertex_series.shape[1]): ts = Temp_per_vertex_series[:,i] ro = VR.easyRoDL(ts) Ro_per_vertex_series[:,i] = ro.flatten() - + logger.debug(f"VR calculation {time.time()-s}s") hexa_renumbered = [ [point_original_to_cached[i] for i in hexa] for hexa in hexa_to_keep ] diff --git a/warmth/resqpy_helpers.py b/warmth/resqpy_helpers.py index e91cacc..3537fed 100644 --- a/warmth/resqpy_helpers.py +++ b/warmth/resqpy_helpers.py @@ -560,7 +560,7 @@ def write_hexa_grid_with_timeseries(filename, nodes_series, cells, modelTitle = pc = hexa.property_collection # nodes0 = nodes.copy() - for time_index in range(nodes_series.shape[0]-1,-1,-1): #oldest first + for time_index in range(nodes_series.shape[0]): #oldest first nodes2 = nodes_series[time_index,:,:].astype(np.float32)