# WRN: this use case does not require a med input file because the
# data (mesh and field) to work with are created from scratch.
-from MEDCoupling import *
+from medcoupling import *
# =======================================================
# Creation of the input data (mesh and field)
# fields when defined on a cartesian mesh (grid).
# (gboulant - 11/07/2011)
-import MEDCoupling as MC
+import medcoupling as MC
import MEDLoader as ML
import numpy
import os
-import MEDCoupling as MC
+import medcoupling as MC
import MEDLoader as ML
#
# and save all the stuff in a med file.
# (gboulant - 27/06/2011)
-import MEDCoupling as MC
+import medcoupling as MC
import MEDLoader as ML
#
print(matrix)
print(list(matrix))
-import MEDCoupling as MC
+import medcoupling as MC
import MEDLoader as ML
def createMesh(meshname, sizeX, sizeY):
"""
#
# (gboulant, nov. 2012)
from MEDLoader import *
-from MEDCoupling import *
+from medcoupling import *
import os
filename = "timeseries.med"
# This functions are to be used to notify the USER of some events
# arising on the field operation. It is NOT to be used for logging
# purpose
+def print_verbose(function):
+ from functools import wraps
+ @wraps(function)
+ def wrapper(self, *args, **kwargs):
+ from salome_utils import verbose
+ if verbose():
+ function(self, *args, **kwargs)
+ return wrapper
+@print_verbose
def inf(msg): print("INF: "+str(msg))
def wrn(msg): print("WRN: "+str(msg))
def err(msg): print("ERR: "+str(msg))
+@print_verbose
def dbg(msg): print("DBG: "+str(msg))
# Initialize CORBA stuff
# Some helper functions to deal with the fields and meshes
import sys
if sys.platform == "win32":
- import MEDCouplingCompat as MEDCoupling
+ import MEDCouplingCompat as medcoupling
else:
- import MEDCoupling
+ import medcoupling
__mapTypeOfFieldLabel = {
- MEDCoupling.ON_CELLS: "ON_CELLS",
- MEDCoupling.ON_NODES: "ON_NODES",
- MEDCoupling.ON_GAUSS_PT: "ON_GAUSS_PT",
- MEDCoupling.ON_GAUSS_NE: "ON_GAUSS_NE"
+ medcoupling.ON_CELLS: "ON_CELLS",
+ medcoupling.ON_NODES: "ON_NODES",
+ medcoupling.ON_GAUSS_PT: "ON_GAUSS_PT",
+ medcoupling.ON_GAUSS_NE: "ON_GAUSS_NE"
}
#
def _typeOfFieldLabel(typeOfField):
"""
self.__fieldHandler = fieldHandler
self.__restriction = None
- print(self.__repr__())
+ from salome_utils import verbose
+ if verbose():
+ print(self.__repr__())
#
def __getattr__(self, name ):
"""
notifyGui_updateField(self.id)
# Print for visual control
- print(self.__repr__())
+ from salome_utils import verbose
+ if verbose():
+ print(self.__repr__())
#
#
if sys.platform == "win32":
import MEDCouplingCompat as MC
else:
- import MEDCoupling as MC
+ import medcoupling as MC
import MEDLoader as ML
#
# Author : Anthony Geay (CEA/DEN)
-from MEDCoupling import *
+from medcoupling import *
import math
import os