]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
ParaMEDMEM python revival
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 13 Dec 2017 13:31:02 +0000 (14:31 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 13 Dec 2017 13:31:02 +0000 (14:31 +0100)
src/ParaMEDMEM_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/ParaMEDMEM.i
src/ParaMEDMEM_Swig/test_InterpKernelDEC.py

index c09fdd220210c60681cd903e5d92b9dca0f361b1..17c86d796e8715fc3bcadd290c9ad72b5962f843 100644 (file)
@@ -58,7 +58,8 @@ SWIG_CHECK_GENERATION(ParaMEDMEM)
 
 INSTALL(TARGETS _ParaMEDMEM DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
 INSTALL(FILES ParaMEDMEM.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py test_InterpKernelDEC.py test_NonCoincidentDEC.py test_StructuredCoincidentDEC.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+INSTALL(FILES test_InterpKernelDEC.py test_NonCoincidentDEC.py test_StructuredCoincidentDEC.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py ${MEDCOUPLING_INSTALL_PYTHON})
 
 SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
 INSTALL(FILES test_InterpKernelDEC.py test_NonCoincidentDEC.py test_StructuredCoincidentDEC.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
index a1168109fd5846a988ea7dd73e75409041b3c6e8..da9810e8a1a5edd965329c7585c423a28339f12d 100644 (file)
@@ -19,6 +19,9 @@
 
 %module ParaMEDMEM
 
+#define MEDCOUPLING_EXPORT
+#define INTERPKERNEL_EXPORT
+
 %include "ParaMEDMEM.typemap"
 %include "MEDCouplingCommon.i"
 
 
 #include <mpi.h>
 
+using namespace INTERP_KERNEL;
 using namespace MEDCoupling;
 using namespace ICoCo;
       
 enum mpi_constants { mpi_comm_world, mpi_comm_self, mpi_double, mpi_int };
 %}
 
+%include "InterpolationOptions.hxx"
 %include "CommInterface.hxx"
 %include "ProcessorGroup.hxx"
 %include "DECOptions.hxx"
@@ -52,9 +57,11 @@ enum mpi_constants { mpi_comm_world, mpi_comm_self, mpi_double, mpi_int };
 %include "MPIProcessorGroup.hxx"
 %include "ComponentTopology.hxx"
 %include "DEC.hxx"
+%include "DisjointDEC.hxx"
 %include "InterpKernelDEC.hxx"
 %include "StructuredCoincidentDEC.hxx"
 
+%include "ICoCoField.hxx"
 %rename(ICoCoMEDField) ICoCo::MEDField;
 %include "ICoCoMEDField.hxx"
 
index 056fd751f02102c9ae60a351dcfa3c823e914595..8a42cc3572658d21857319f565e1a43bb773932e 100755 (executable)
 #
 
 from ParaMEDMEM import *
+from MEDLoader import ReadUMeshFromFile
 import sys, os
 import unittest
 import math
+from mpi4py import MPI
+
 
 class ParaMEDMEMBasicsTest(unittest.TestCase):
     def testInterpKernelDEC_2D(self):
-        MPI_Init(sys.argv)
-        size = MPI_Comm_size(MPI_COMM_WORLD)
-        rank = MPI_Comm_rank(MPI_COMM_WORLD)
+        size = MPI.COMM_WORLD.size
+        rank = MPI.COMM_WORLD.rank
         if size != 5:
             raise RuntimeError("Expect MPI_COMM_WORLD size == 5")
         print(rank)
@@ -68,8 +70,7 @@ class ParaMEDMEMBasicsTest(unittest.TestCase):
             nb_local=mesh.getNumberOfCells()
             value = [1.0]*nb_local
             parafield.getField().setValues(value)
-            icocofield = ICoCoMEDField(mesh,parafield.getField())
-            dec.setMethod("P0")
+            icocofield = ICoCoMEDField(parafield.getField())
             dec.attachLocalField(icocofield)
             pass
         else:
@@ -83,8 +84,7 @@ class ParaMEDMEMBasicsTest(unittest.TestCase):
             nb_local=mesh.getNumberOfCells()
             value = [0.0]*nb_local
             parafield.getField().setValues(value)
-            icocofield = ICoCoMEDField(mesh,parafield.getField())
-            dec.setMethod("P0")
+            icocofield = ICoCoMEDField(parafield.getField())
             dec.attachLocalField(icocofield)
             pass