# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-from MEDCoupling import *
from MEDLoader import WriteMesh
XCoords=[-0.3,0.,0.1,0.3,0.45,0.47,0.49,1.,1.22] # 9 values along X
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
from MEDLoader import WriteMesh
arr=DataArrayDouble(range(2))
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-from MEDCoupling import *
from MEDLoader import WriteMesh
m=MEDCouplingCurveLinearMesh("myCurveLinearMesh")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(5))
mesh1=MEDCouplingCMesh("mesh")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "ParaViS")
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
+
from MEDLoader import WriteMesh, WriteFieldUsingAlreadyWrittenMesh
medfile1="mesh1.med"
ipar.append("AP_MODULES_LIST", "Mesh")
-from MEDCoupling import *
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(6))
mesh1=MEDCouplingCMesh("mesh")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(6))
mesh1=MEDCouplingCMesh("mesh")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(3))
mesh1=MEDCouplingCMesh("mesh")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(6))
mesh2d=MEDCouplingCMesh("mesh2d")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(6))
mesh2d=MEDCouplingCMesh("mesh2")
salome.salome_init()
theStudy = salome.myStudy
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
+
from MEDLoader import WriteMesh, WriteFieldUsingAlreadyWrittenMesh
medfile="mesh1.med"
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-from MEDCoupling import *
from MEDLoader import WriteMesh
coordsArr=DataArrayDouble(range(6))
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
from MEDLoader import WriteMesh
coordsArr=DataArrayDouble(range(6))
### This script is intended to be launched in a new SALOME study
###
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(3))
mesh1=MEDCouplingCMesh("mesh")
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-
-from MEDCoupling import *
from MEDLoader import ReadMeshFromFile, WriteMesh
coordsArr=DataArrayDouble(range(8))
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-
-from MEDCoupling import *
from MEDLoader import ReadMeshFromFile, WriteMesh
coordsArr=DataArrayDouble(range(8))
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
srcCoo=DataArrayDouble([(0,0),(1,0),(3,0),(0,1),(1,1),(3,1)])
src=MEDCouplingUMesh("src",2)
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
srcCoo=DataArrayDouble([(0,0),(1,0),(3,0),(0,1),(1,1),(3,1)])
src=MEDCouplingUMesh("src",2)
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
srcCoo=DataArrayDouble([(0,0),(1,0),(3,0),(0,1),(1,1),(3,1)])
src=MEDCouplingUMesh("src",2)
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-
-from MEDCoupling import *
from MEDLoader import WriteMesh
coordsArr=DataArrayDouble(range(2))
# fill list AP_MODULES_LIST
ipar.append("AP_MODULES_LIST", "Mesh")
-
-
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(3))
mesh1=MEDCouplingCMesh("mesh")
ipar.append("AP_MODULES_LIST", "Mesh")
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
coordsArr=DataArrayDouble(range(5))
mesh1=MEDCouplingCMesh("mesh")
ipar.append("AP_MODULES_LIST", "Mesh")
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
from MEDLoader import WriteMesh
coords=DataArrayDouble(range(6))
swig_ready)
ENDIF()
+IF(WIN32)
+ # Under Windows MEDCoupling conflicts wiht medcoupling from PyWrapping
+ SET(MEDCouling_target_name MEDCouplingCompat)
+ELSE()
+ SET(MEDCouling_target_name MEDCoupling)
+ENDIF()
+
IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
- SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i)
+ SWIG_ADD_MODULE(${MEDCouling_target_name} python MEDCoupling.i)
ELSE()
- SWIG_ADD_LIBRARY(MEDCoupling LANGUAGE python SOURCES MEDCoupling.i)
+ SWIG_ADD_LIBRARY(${MEDCouling_target_name} LANGUAGE python SOURCES MEDCoupling.i)
ENDIF()
-SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp)
-SWIG_CHECK_GENERATION(MEDCoupling)
+SWIG_LINK_LIBRARIES(${MEDCouling_target_name} ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp)
+SWIG_CHECK_GENERATION(${MEDCouling_target_name})
SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_FLAGS "-py3")
IF(WIN32)
SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingRemapper_d)
- SET_TARGET_PROPERTIES(_MEDCoupling PROPERTIES DEBUG_OUTPUT_NAME _MEDCoupling_d)
+ SET_TARGET_PROPERTIES(_${MEDCouling_target_name} PROPERTIES DEBUG_OUTPUT_NAME _${MEDCouling_target_name}_d)
ENDIF(WIN32)
-INSTALL(TARGETS ${SWIG_MODULE_MEDCoupling_REAL_NAME} ${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
+INSTALL(TARGETS ${SWIG_MODULE_${MEDCouling_target_name}_REAL_NAME} ${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py)
SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${MEDCOUPLING_INSTALL_PYTHON})
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
+
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
+
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
class MEDCouplingDataForTest:
def build2DTargetMesh_1(cls):
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
import unittest
from math import pi, sqrt
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
import unittest
from math import pi,e,sqrt,cos,sin
from datetime import datetime
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
if MEDCouplingHasNumPyBindings():
from numpy import *
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
from MEDCouplingDataForTest import MEDCouplingDataForTest
if MEDCouplingHasNumPyBindings():
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
from math import pi, sqrt
# ! [PySnippetUMeshStdBuild1_1]
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+import sys
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
-from MEDCoupling import *
from math import pi, sqrt
import numpy
-import MEDCoupling
+if sys.platform == "win32":
+ import MEDCouplingCompat as MEDCoupling
+else:
+ import MEDCoupling
+
#! [UG_DataArrayNumpy_0]
# NumPy is an optional pre-requisite!
assert(MEDCoupling.MEDCouplingHasNumPyBindings())
ENDIF(MEDCOUPLING_USE_MPI)
IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
- SWIG_ADD_MODULE(medcoupling1 python medcoupling.i)
+ SWIG_ADD_MODULE(medcoupling python medcoupling.i)
ELSE()
- SWIG_ADD_LIBRARY(medcoupling1 LANGUAGE python SOURCES medcoupling.i)
+ SWIG_ADD_LIBRARY(medcoupling LANGUAGE python SOURCES medcoupling.i)
ENDIF()
-SWIG_LINK_LIBRARIES(medcoupling1 ${medcoupling_LIB_dependancies})
-SWIG_CHECK_GENERATION(medcoupling1)
+SWIG_LINK_LIBRARIES(medcoupling ${medcoupling_LIB_dependancies})
+SWIG_CHECK_GENERATION(medcoupling)
IF(WIN32)
- SET_TARGET_PROPERTIES(_medcoupling1 PROPERTIES DEBUG_OUTPUT_NAME _medcoupling1_d)
+ SET_TARGET_PROPERTIES(_medcoupling PROPERTIES DEBUG_OUTPUT_NAME _medcoupling_d)
ENDIF(WIN32)
-INSTALL(TARGETS _medcoupling1 DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
+INSTALL(TARGETS _medcoupling DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
INSTALL(FILES medcoupling.i medcoupling_pycode DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/medcoupling.py ${MEDCOUPLING_INSTALL_PYTHON})
from MEDRenumber import *
import unittest
+import sys
class MEDRenumberTest(unittest.TestCase):
@unittest.skipUnless("BOOST" in RenumberAvailableMethods(),"requires BOOST prerequisite !")
def test1(self):
- from MEDCoupling import MEDCouplingCMesh
+ if sys.platform == "win32":
+ from MEDCouplingCompat import MEDCouplingCMesh
+ else:
+ from MEDCoupling import MEDCouplingCMesh
+
ren=RenumberingFactory("BOOST")
arr=DataArrayDouble(10) ; arr.iota()
c=MEDCouplingCMesh() ; c.setCoords(arr,arr)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from MEDCoupling import *
+import sys
+
+if sys.platform == "win32":
+ from MEDCouplingCompat import *
+else:
+ from MEDCoupling import *
+
from math import pi, sqrt
-import MEDCoupling
+if sys.platform == "win32":
+ import MEDCouplingCompat as MEDCoupling
+else:
+ import MEDCoupling
from MEDCouplingDataForTest import MEDCouplingDataForTest
m=MEDCouplingDataForTest.build2DTargetMesh_1();
#! [UG_Optimization_0]
#! [UG_Optimization_1]
-from MEDCoupling import MEDCouplingSkyLineArray
import MEDPartitioner
# prepare a MEDPartitioner
a,b=m.computeNeighborsOfCells()