import numpy as np
import MEDLoader as ml
-import MEDCoupling as mc
+import medcoupling as mc
-# Get current study id
salome.salome_init()
-theStudy = salome.myStudy
-theStudyId = salome.myStudyId
class BadParamsError(ValueError):
"""Bad parameters exception"""
# 1. Controls
# 1.1. Check calculation case
- doc = HYDROPy.HYDROData_Document.Document(theStudyId)
+ doc = HYDROPy.HYDROData_Document.Document()
case = doc.FindObjectByName(nomCas)
if case is None:
raise BadParamsError("Calculation case '%s' not found" % nomCas)
import salome
salome.salome_init()
-theStudy = salome.myStudy
-theStudyId = salome.myStudyId
import numpy as np
import MEDLoader as ml
-import MEDCoupling as mc
+import medcoupling as mc
# -----------------------------------------------------------------------------
if verbose:
ligne = "nomCas: %s" % nomCas
- ligne += "\ninterpolMethods: " % regions_interp_method
+ ligne += "\ninterpolMethods: %s" % regions_interp_method
if (zUndef != None ):
ligne += "\nzUndef: %f" % zUndef
ligne += "\nm3d: %d" % m3d
print (ligne)
- doc = HYDROPy.HYDROData_Document.Document(theStudyId)
+ doc = HYDROPy.HYDROData_Document.Document()
cas = doc.FindObjectByName(nomCas)
- print(( "cas : ", cas))
+ print ( "cas : ", cas)
custom_inter = MyInterpolator()
basename = fichierMaillage[:-4]
fichierFMaillage = basename + 'F.med'
- print(("dicoGroupeRegion = ", dicoGroupeRegion))
+ print ("dicoGroupeRegion = ", dicoGroupeRegion)
ligne = "fichierMaillage = %s" % fichierMaillage
ligne += "\nfichierFMaillage = %s" % fichierFMaillage
if xyzFile:
print (ligne)
#
coords = meshMEDFileRead.getCoords()
- #print coords
+ #print (coords)
if verbose:
nb_comp = coords.getNumberOfComponents()
l_info = coords.getInfoOnComponents()
#
vx = list()
vy = list()
- for nodeId in np_aux[0]:
+ for nid in np_aux[0]:
+ nodeId = nid.item()
vx.append(coords[nodeId, 0])
vy.append(coords[nodeId, 1])
#print ("vx:\n", vx)
Option: Z value also in Z coordinate if m3D is true
return <fichierMaillage>.xyz : text file with X, Y, Z values
"""
- doc = HYDROPy.HYDROData_Document.Document(theStudyId)
+ doc = HYDROPy.HYDROData_Document.Document()
bathy_obj = doc.FindObjectByName(bathyName)
- print(( "bathy : ", bathy_obj))
+ print( "bathy : ", bathy_obj)
if bathy_obj is None:
print ( "bathy is None")
return False