# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
SET(_${PROJECT_NAME}_exposed_targets
- interpkernel medcouplingcpp medcouplingremapper)
+ interpkernel medcouplingcpp medcouplingremapper medicoco)
IF(NOT MEDCOUPLING_MICROMED)
LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader)
SET(MEDCoupling_interpkernel interpkernel)
SET(MEDCoupling_medcouplingcpp medcouplingcpp)
SET(MEDCoupling_medcoupling medcouplingcpp)
+SET(MEDCoupling_medicoco medicoco)
SET(MEDCoupling_medcouplingremapper medcouplingremapper)
SET(MEDCoupling_medloader medloader)
SET(MEDCoupling_renumbercpp renumbercpp)
# MEDCoupling
ADD_SUBDIRECTORY(MEDCoupling)
+ADD_SUBDIRECTORY(ICoCo)
+
IF(MEDCOUPLING_ENABLE_PYTHON)
ADD_SUBDIRECTORY(MEDCoupling_Swig)
ADD_SUBDIRECTORY(PyWrapping)
SUBDIRS(INTERP_KERNELTest)
SUBDIRS(MEDCoupling)
SUBDIRS(MEDCoupling_Swig)
+SUBDIRS(ICoCo_Swig)
SUBDIRS(MEDLoader)
SUBDIRS(MEDLoader_Swig)
SUBDIRS(MEDPartitioner)
--- /dev/null
+# Copyright (C) 2012-2021 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author : Adrien Bruneton (CEA/DES)
+
+IF (NOT DEFINED MSVC)
+ ADD_DEFINITIONS(-Wsign-compare -Wconversion)
+ENDIF()
+
+IF(MEDCOUPLING_ENABLE_PYTHON)
+ ADD_SUBDIRECTORY(Swig)
+ENDIF()
+
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
+ ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
+ ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
+ )
+
+SET(icoco_SOURCES
+ ICoCoField.cpp # [ABN] Yes, .cpp, this is imposed by ICoCo.
+ ICoCoMEDDoubleField.cxx
+ ICoCoMEDIntField.cxx
+)
+
+ADD_LIBRARY(medicoco ${icoco_SOURCES})
+SET_TARGET_PROPERTIES(medicoco PROPERTIES OUTPUT_NAME "medicoco")
+TARGET_LINK_LIBRARIES(medicoco medcouplingcpp)
+INSTALL(TARGETS medicoco EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
+
+FILE(GLOB icoco_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx"
+ "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+INSTALL(FILES ${icoco_HEADERS_HXX} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
-Linked into target 'paramedmem' library.
+Linked into target 'mc_icoco' library.
The files below are part of the official ICoCo API and should NOT be modified:
- ICoCoField.h
Their official version can be found in the TRUST repository:
- https://sourceforge.net/projects/trust/
+ https://github.com/cea-trust-platform/icoco-coupling
--- /dev/null
+# Copyright (C) 2012-2021 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton (CEA/DES)
+#
+
+#
+# Only managing Python tests here. Python wrapping is done solely at the "medcoupling" level
+# (see PyWrapping source directory)
+#
+
+INCLUDE(tests.set)
+
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_CURRENT_BINARY_DIR}/../../PyWrapping)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
+FOREACH(test ${ALL_TESTS})
+ GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
+ ADD_TEST(NAME ${testname}
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test})
+ SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
+ENDFOREACH()
+
+# Application tests
+
+SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/ICoCo_Swig)
+INSTALL(FILES ${ALL_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${TEST_INSTALL_DIRECTORY}
+ RENAME CTestTestfile.cmake)
+INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
--- /dev/null
+# Copyright (C) 2015-2021 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(tests.set)
+
+FOREACH(tfile ${ALL_TESTS})
+ GET_FILENAME_COMPONENT(BASE_NAME ${tfile} NAME_WE)
+ SET(TEST_NAME ${COMPONENT_NAME}_${BASE_NAME})
+ ADD_TEST(${TEST_NAME} python ${tfile})
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ TIMEOUT ${TIMEOUT}
+ )
+ENDFOREACH()
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from medcoupling import *
+
+import unittest
+
+class ICoCoICoCoMEDDoubleFieldTest(unittest.TestCase):
+ def generate_fields_double(self):
+ """ Dummy MCFieldDouble """
+ msh = MEDCouplingCMesh("toto_mesh")
+ msh.setCoords(DataArrayDouble([0.,1.,2.]))
+ msh = msh.buildUnstructured()
+ f1 = MEDCouplingFieldDouble(ON_CELLS, ONE_TIME)
+ f1.setMesh(msh)
+ f1.setName("toto")
+ f1.setArray(DataArrayDouble([0.,1.,2.,3.]))
+
+ f2 = f1.deepCopy()
+ da = f2.getArray()
+ da += 3.5
+ da2 = f2.getArray()
+ return f1, f2
+
+ def generate_fields_int(self):
+ """ Dummy MCFieldDouble """
+ msh = MEDCouplingCMesh("toto_mesh")
+ msh.setCoords(DataArrayDouble([0.,1.,2.]))
+ msh = msh.buildUnstructured()
+ f1 = MEDCouplingFieldInt32(ON_CELLS, ONE_TIME)
+ f1.setMesh(msh)
+ f1.setName("toto")
+ f1.setArray(DataArrayInt32([0,1,2,3]))
+
+ f2 = f1.deepCopy()
+ da = f2.getArray()
+ da += 3
+ da2 = f2.getArray()
+ return f1, f2
+
+ def test1(self):
+ lst_typ = [ICoCoMEDDoubleField, ICoCoMEDIntField]
+ f1d, f2d = self.generate_fields_double()
+ f1i, f2i = self.generate_fields_int()
+ fld1_lst = [f1d, f1i]
+ fld2_lst = [f2d, f2i]
+ for ICoCoMED_T_Field, f1, f2 in zip(lst_typ, fld1_lst, fld2_lst):
+ mf = ICoCoMED_T_Field()
+ mf.setName("titi")
+ self.assertEqual(mf.getName(), "titi")
+ mfd = mf.getMCField()
+ self.assertTrue(mfd is None)
+ mf.setMCField(f1)
+ f11 = mf.getMCField()
+ self.assertEqual(f1.getHiddenCppPointer(), f11.getHiddenCppPointer()) # strictly the same
+ self.assertEqual(mf.getName(), "toto") # name is taken from MC object
+ mf.setMCField(f2)
+ f22 = mf.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+
+ mf = ICoCoMED_T_Field(f1) # ctor with MC object
+ mfd = mf.getMCField()
+ self.assertEqual(mfd.getHiddenCppPointer(), f1.getHiddenCppPointer()) # strictly the same
+ self.assertEqual(mf.getName(), "toto") # name is taken from MC object
+
+ mf.setMCField(None)
+ mfd = mf.getMCField()
+ self.assertTrue(mfd is None)
+ self.assertEqual(mf.getName(), "") # name is reset
+
+ mf.setMCField(f2)
+ f22 = mf.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+
+ mf.setName("aa")
+ mf2 = ICoCoMED_T_Field(mf) # copy ctor
+ f22 = mf2.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+ self.assertEqual(mf2.getName(), "aa")
+
+ mf2 = mf # assignement op
+ f22 = mf2.getMCField()
+ self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
+ self.assertEqual(mf2.getName(), "aa")
+
+ mf2.setMCField(None)
+ self.assertEqual(mf2.getName(), "")
+
+if __name__ == '__main__':
+ unittest.main()
--- /dev/null
+# Copyright (C) 2017-2021 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(ALL_TESTS
+ ICoCoMEDFieldTest.py
+)
+
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
- ${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo
)
SET(medcoupling_SOURCES
MEDCouplingPartDefinition.cxx
MEDCouplingSkyLineArray.cxx
MEDCouplingVoronoi.cxx
- ../ICoCo/ICoCoField.cpp # [ABN] Yes, .cpp, this is imposed by ICoCo.
- ../ICoCo/ICoCoMEDDoubleField.cxx
- ../ICoCo/ICoCoMEDIntField.cxx
)
SET(medcouplingremapper_SOURCES
TARGET_LINK_LIBRARIES(medcouplingremapper medcouplingcpp)
INSTALL(TARGETS medcouplingremapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
-FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx"
- "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.hxx"
- "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.h")
+FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
FILE(GLOB medcoupling_HEADERS_TXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
-FILE(GLOB icoco_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/../ICoCo/*.hxx")
-INSTALL(FILES ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} ${icoco_HEADERS_HXX} MEDCouplingNatureOfFieldEnum DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
+INSTALL(FILES ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} MEDCouplingNatureOfFieldEnum DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
# To allow usage as SWIG dependencies:
SET(medcoupling_HEADERS_HXX PARENT_SCOPE)
+++ /dev/null
-# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-from medcoupling import *
-
-import unittest
-
-class ICoCoICoCoMEDDoubleFieldTest(unittest.TestCase):
- def generate_fields_double(self):
- """ Dummy MCFieldDouble """
- msh = MEDCouplingCMesh("toto_mesh")
- msh.setCoords(DataArrayDouble([0.,1.,2.]))
- msh = msh.buildUnstructured()
- f1 = MEDCouplingFieldDouble(ON_CELLS, ONE_TIME)
- f1.setMesh(msh)
- f1.setName("toto")
- f1.setArray(DataArrayDouble([0.,1.,2.,3.]))
-
- f2 = f1.deepCopy()
- da = f2.getArray()
- da += 3.5
- da2 = f2.getArray()
- return f1, f2
-
- def generate_fields_int(self):
- """ Dummy MCFieldDouble """
- msh = MEDCouplingCMesh("toto_mesh")
- msh.setCoords(DataArrayDouble([0.,1.,2.]))
- msh = msh.buildUnstructured()
- f1 = MEDCouplingFieldInt32(ON_CELLS, ONE_TIME)
- f1.setMesh(msh)
- f1.setName("toto")
- f1.setArray(DataArrayInt32([0,1,2,3]))
-
- f2 = f1.deepCopy()
- da = f2.getArray()
- da += 3
- da2 = f2.getArray()
- return f1, f2
-
- def test1(self):
- lst_typ = [ICoCoMEDDoubleField, ICoCoMEDIntField]
- f1d, f2d = self.generate_fields_double()
- f1i, f2i = self.generate_fields_int()
- fld1_lst = [f1d, f1i]
- fld2_lst = [f2d, f2i]
- for ICoCoMED_T_Field, f1, f2 in zip(lst_typ, fld1_lst, fld2_lst):
- mf = ICoCoMED_T_Field()
- mf.setName("titi")
- self.assertEqual(mf.getName(), "titi")
- mfd = mf.getMCField()
- self.assertTrue(mfd is None)
- mf.setMCField(f1)
- f11 = mf.getMCField()
- self.assertEqual(f1.getHiddenCppPointer(), f11.getHiddenCppPointer()) # strictly the same
- self.assertEqual(mf.getName(), "toto") # name is taken from MC object
- mf.setMCField(f2)
- f22 = mf.getMCField()
- self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
-
- mf = ICoCoMED_T_Field(f1) # ctor with MC object
- mfd = mf.getMCField()
- self.assertEqual(mfd.getHiddenCppPointer(), f1.getHiddenCppPointer()) # strictly the same
- self.assertEqual(mf.getName(), "toto") # name is taken from MC object
-
- mf.setMCField(None)
- mfd = mf.getMCField()
- self.assertTrue(mfd is None)
- self.assertEqual(mf.getName(), "") # name is reset
-
- mf.setMCField(f2)
- f22 = mf.getMCField()
- self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
-
- mf.setName("aa")
- mf2 = ICoCoMED_T_Field(mf) # copy ctor
- f22 = mf2.getMCField()
- self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
- self.assertEqual(mf2.getName(), "aa")
-
- mf2 = mf # assignement op
- f22 = mf2.getMCField()
- self.assertEqual(f2.getHiddenCppPointer(), f22.getHiddenCppPointer()) # strictly the same
- self.assertEqual(mf2.getName(), "aa")
-
- mf2.setMCField(None)
- self.assertEqual(mf2.getName(), "")
-
-if __name__ == '__main__':
- unittest.main()
#endif
%include "MEDCouplingCommon.i"
-%include "ICoCoMEDField.i"
%pythoncode %{
def MEDCouplingDataArrayDoubleIadd(self,*args):
MEDCouplingExamplesTest.py
MEDCouplingRemapperTest.py
UsersGuideExamplesTest.py
- ICoCoMEDFieldTest.py
)
# if numpy is used
)
ADD_LIBRARY(paramedmem ${paramedmem_SOURCES})
-TARGET_LINK_LIBRARIES(paramedmem medcouplingcpp ${MPI_LIBRARIES})
+TARGET_LINK_LIBRARIES(paramedmem medcouplingcpp medicoco ${MPI_LIBRARIES})
INSTALL(TARGETS paramedmem EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
FILE(GLOB paramedmem_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
)
IF(WIN32)
- SET(medcoupling_LIB_dependancies ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingremapper)
+ SET(medcoupling_LIB_dependancies ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingremapper medicoco)
ELSE(WIN32)
# ${PYTHON_LIBRARIES} not needed see https://www.python.org/dev/peps/pep-0513/#libpythonx-y-so-1
- SET(medcoupling_LIB_dependancies ${PLATFORM_LIBS} medcouplingremapper)
+ SET(medcoupling_LIB_dependancies ${PLATFORM_LIBS} medcouplingremapper medicoco)
ENDIF(WIN32)
IF(NOT MEDCOUPLING_MICROMED)