Skip to content

Commit

Permalink
fix resqml time index inverted
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchengtkc committed Aug 28, 2024
1 parent b976ff0 commit c57f812
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions warmth/mesh_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.")
Expand Down Expand Up @@ -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 ]


Expand Down
2 changes: 1 addition & 1 deletion warmth/resqpy_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c57f812

Please sign in to comment.