Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pyHMT2D/Hydraulic_Models_Data/SRH_2D/SRH_2D_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,9 @@ def output_boundary_manning_n_profile(self, nodeStringID, nodeStringFileName, di


def readSRHXMDFFile(self, xmdfFileName, bNodal):
""" Read SRH-2D result file in XMDF format (current version 13.1.6 of SMS only support data at node).
""" Read SRH-2D result file in XMDFC format (In current version 13.1.6 of SMS, the initial results of SRH2D is saved at center
of the elements (XMDFC file). and using post processing they are interpolated to the nodes (XMDF) file). Currently
the pyHMT2D support XMDFC files created befpre post processing.

Parameters
----------
Expand Down Expand Up @@ -1569,6 +1571,9 @@ def readSRHXMDFFile(self, xmdfFileName, bNodal):
if gVerbose: print("Reading the XMDF file ...\n")

xmdfFile = h5py.File(xmdfFileName, "r")

if bNodal: #It is added by Ali because when it is nodal
xmdfFile=xmdfFile['Datasets'] #variables are inside Datasets

#build the list of solution variables
varNameList = []
Expand All @@ -1579,7 +1584,7 @@ def readSRHXMDFFile(self, xmdfFileName, bNodal):
for ds in xmdfFile.keys():
#print(ds)

if ds != "File Type" and ds != "File Version":
if ds != "File Type" and ds != "File Version" and ds != "Guid": #Ali added Guide for Nodal files
if "Velocity" in ds:
varNameVelocity = '%s' % ds
vel_x = ds.replace("Velocity","Vel_X",1)
Expand Down