Salome HOME
Merge from V7_3_BR branch 18/12/2013
authorvsr <vsr@opencascade.com>
Wed, 18 Dec 2013 15:06:54 +0000 (15:06 +0000)
committervsr <vsr@opencascade.com>
Wed, 18 Dec 2013 15:06:54 +0000 (15:06 +0000)
65 files changed:
CMakeLists.txt
adm_local/cmake_files/FindSalomeXDR.cmake
adm_local/cmake_files/FindXDR.cmake
adm_local_without_kernel/cmake_files/FindGraphviz.cmake
adm_local_without_kernel/cmake_files/FindSalomePython.cmake
adm_local_without_kernel/cmake_files/SalomeMacros.cmake
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DBounds.hxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.hxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.hxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DElementaryEdge.cxx
src/INTERP_KERNELTest/CMakeLists.txt
src/MEDCoupling/MEDCoupling1GTUMesh.cxx
src/MEDCoupling/MEDCoupling1GTUMesh.hxx
src/MEDCoupling/MEDCouplingExtrudedMesh.cxx
src/MEDCoupling/MEDCouplingMemArray.cxx
src/MEDCoupling/MEDCouplingMemArray.hxx
src/MEDCoupling/MEDCouplingPointSet.hxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx
src/MEDCoupling_Swig/CMakeLists.txt
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/MEDCoupling_Swig/MEDCouplingMemArray.i
src/MEDGUI/MEDGUIDataBaseDockWidget.cxx
src/MEDGUI/MED_msg_ja.ts
src/MEDLoader/MEDFileField.cxx
src/MEDLoader/MEDFileField.hxx
src/MEDLoader/MEDFileFieldOverView.cxx
src/MEDLoader/MEDFileFieldOverView.hxx
src/MEDLoader/MEDFileMesh.cxx
src/MEDLoader/MEDFileMesh.hxx
src/MEDLoader/MEDFileMeshLL.cxx
src/MEDLoader/MEDFileMeshLL.hxx
src/MEDLoader/MEDLoader.cxx
src/MEDLoader/MEDLoader.hxx
src/MEDLoader/SauvMedConvertor.cxx
src/MEDLoader/SauvReader.cxx
src/MEDLoader/SauvReader.hxx
src/MEDLoader/SauvWriter.cxx
src/MEDLoader/SauvWriter.hxx
src/MEDLoader/Swig/CMakeLists.txt
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/MEDLoaderCouplingTrainingSession.py
src/MEDLoader/Swig/MEDLoaderDataForTest.py
src/MEDLoader/Swig/MEDLoaderExamplesTest.py
src/MEDLoader/Swig/MEDLoaderTest.py
src/MEDLoader/Swig/MEDLoaderTest3.py
src/MEDLoader/Swig/MEDLoaderTest4.py
src/MEDLoader/Swig/SauvLoaderTest.py
src/MEDLoader/Test/CMakeLists.txt
src/MEDOP/doc/sphinx/conf.py.in
src/MEDOP/gui/MEDOP_msg_fr.ts
src/MEDOP/gui/MEDOP_msg_ja.ts
src/MEDOP/gui/MED_msg_ja.ts
src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx
src/MEDPartitioner/Test/CMakeLists.txt
src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx
src/ParaMEDMEMTest/ParaMEDMEMTest_MEDLoader.cxx
src/RENUMBER_Swig/CMakeLists.txt

index e43611172c966ec1c86af2331bffe4e3e3b0beac..d2acb80b3e7d9a86962743b9283cb8dc700c7532 100644 (file)
@@ -29,7 +29,7 @@ CMAKE_POLICY(SET CMP0003 NEW)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
index 2db53e88f43075e51fe8d8e12cc34c165ded63c1..50fef653f13514f724be1f70d0623f183a4d57a2 100644 (file)
@@ -24,7 +24,7 @@
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
 
-SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(XDR XDR_FOUND 1)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(XDR XDR_INCLUDE_DIRS 1)
 #MARK_AS_ADVANCED()
 
 #IF(XDR_FOUND) # useless here because XDR is used only in CXX of MEDLoader
index 11a9cb7c9a2b00d12657498bb5ed4dde17981f80..8b39fda0fc88c55625efd651101f15409a161a79 100644 (file)
@@ -27,11 +27,10 @@ ENDIF(XDR_ROOT_DIR)
 FIND_LIBRARY(XDR_LIBRARIES xdr)
 FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h)
 SET(XDR_DEFINITIONS "-DHAS_XDR")
-SET(XDR_FOUND 1)
 
 IF(WIN32)
   LIST(APPEND XDR_INCLUDE_DIRS "${XDR_ROOT_DIR}/include/src/msvc")
 ENDIF(WIN32)
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_FOUND)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS)
index 6eb1e5a71767dde06bb1fcac0053cc285629a88f..d25cffe6330423fc61081303eaca21cab8cffb2e 100644 (file)
@@ -35,19 +35,23 @@ FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h)
 SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz)
 
 FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY      NAMES cdt PATH_SUFFIXES bin)
-FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
 FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph PATH_SUFFIXES bin)
 FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc PATH_SUFFIXES bin)
 FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
 
 SET(GRAPHVIZ_LIBRARIES 
   ${GRAPHVIZ_cdt_LIBRARY}
-  ${GRAPHVIZ_cgraph_LIBRARY} 
   ${GRAPHVIZ_graph_LIBRARY} 
   ${GRAPHVIZ_gvc_LIBRARY}
   ${GRAPHVIZ_pathplan_LIBRARY}
   )
 
+## Don't detect cgraph on Windows
+#IF(NOT WIN32)
+#  FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
+#  SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_cgraph_LIBRARY})
+#ENDIF()
+
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS 
index 680f862a582704c0fd8923a80f8ec70600fe3ea7..9fa592048266be5e52432d58d08a8a613f0a9cd9 100644 (file)
@@ -74,6 +74,10 @@ SET(_found1 ${PYTHONINTERP_FOUND})
 IF (PYTHONINTERP_FOUND)
   # Now ensure we find the Python libraries matching the interpreter:
   # This uses the variable PYTHON_EXECUTABLE
+
+  GET_FILENAME_COMPONENT(_python_bin "${PYTHON_EXECUTABLE}" NAME )
+  SET(PYTHONBIN "${_python_bin}" CACHE STRING "Name of Python interpreter")
+
   GET_FILENAME_COMPONENT(_python_dir "${PYTHON_EXECUTABLE}" PATH)
   GET_FILENAME_COMPONENT(CMAKE_INCLUDE_PATH "${_python_dir}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
   GET_FILENAME_COMPONENT(CMAKE_LIBRARY_PATH "${_python_dir}/../lib" ABSOLUTE)
index a402d661b5f7a78c259128008b641d3fe8f864b5..f79dbcf526898a47c762a4f11d3d23f87306d168 100755 (executable)
@@ -801,32 +801,56 @@ ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT)
 # and puts this variable into <output> argument.
 #
 MACRO(SALOME_GENERATE_TESTS_ENVIRONMENT output)
-  SET(_env)
-  SET(_WIN_LD_LIBRARY OFF)
-  FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
-    IF(${_item} STREQUAL "LD_LIBRARY_PATH")
-      SET(_WIN_LD_LIBRARY ON)
-    ENDIF()
-    SET(_env_${_item})
-    FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
-      IF(WIN32)
-        SET(_env_${_item} "${_val};${_env_${_item}}")
-      ELSE()
-        SET(_env_${_item} "${_val}:${_env_${_item}}")
-      ENDIF()
-    ENDFOREACH()
-  ENDFOREACH()
+ SET(_env)
+ SET(_WIN_LD_LIBRARY OFF)
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+   IF(${_item} STREQUAL "LD_LIBRARY_PATH")
+     SET(_WIN_LD_LIBRARY ON)
+   ENDIF()
+   SET(_env_${_item})
+   FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
+     IF(WIN32)
+       STRING(REPLACE "/" "\\" _val "${_val}")
+       SET(_env_${_item} "${_val};${_env_${_item}}")
+     ELSE()
+       SET(_env_${_item} "${_val}:${_env_${_item}}")
+     ENDIF()
+   ENDFOREACH()
+ ENDFOREACH()
+
+ IF(_WIN_LD_LIBRARY AND WIN32)
+   SET(_env_PATH "${_env_PATH}$ENV{LD_LIBRARY_PATH};${_env_LD_LIBRARY_PATH}")
+ ENDIF()
+
+ IF(WIN32)
+   SET(sep ",")
+ ELSE()
+   SET(sep ";")
+ ENDIF()
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+   IF(WIN32)
+     IF(NOT ${_item} STREQUAL "LD_LIBRARY_PATH")
+       SET(_env "${_item}=$ENV{${_item}};${_env_${_item}}${sep}${_env}")
+     ENDIF()
+   ELSE()
+     SET(_env "${_item}=$ENV{${_item}}:${_env_${_item}}${sep}${_env}")
+   ENDIF()
+ ENDFOREACH()
+
+ # Get module name as substring of "Salome<ModuleName>"
+ STRING(SUBSTRING "${PROJECT_NAME}" 6 -1 PRNAME) 
+ SET(_env "${PRNAME}_ROOT_DIR=${CMAKE_INSTALL_PREFIX}${sep}${_env}")
+  
+ # Creating follow string for Windows environement:
+ # "VAR1_ENV=1\;2\;3\;...\;...\;...;VAR2_ENV=1\;2\;3\;...\;...\;...;VAR3_ENV=1\;2\;3\;...\;...\;...;..."
+ IF(WIN32)
+   STRING(REGEX REPLACE "\\\\*;" "\\\\;" _env "${_env}")
+   STRING(REGEX REPLACE "\\\\*;*," ";" _env "${_env}")
+ ENDIF()
 
-  IF(_WIN_LD_LIBRARY AND WIN32)
-    SET(_env_PATH "${_env_PATH} ${_env_LD_LIBRARY_PATH}")
-  ENDIF()
+ SET(${output} "${_env}")
 
-  FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
-    IF(NOT(WIN32 AND ${_item} STREQUAL "LD_LIBRARY_PATH"))
-      SET(_env "${_item}=${_env_${_item}} ${_env}")
-    ENDIF()
-  ENDFOREACH()
-  SET(${output} ${_env})  
 ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT) 
 
 #########################################################################
@@ -847,7 +871,8 @@ MACRO(SALOME_APPEND_LIST_OF_LIST result element_list)
   SET(_tmp_res)
   STRING(REPLACE ";" "," _tmp_res "${${element_list}}")
 
-  LIST(LENGTH result _list_len)
+  # Yet another CMake stupidity - LIST(LENGTH ";" var) returns 0
+  STRING(LENGTH result _list_len)
   IF(NOT _list_len EQUAL 0)
     SET(${result} "${${result}}${_tmp_res};")  # LIST(APPEND ...) doesn't handle well empty elements!?
   ELSE()
index ed3c2f305a64b0c161e1c93ccd21bdedd5588583..be590241c3ca8ebf0cfb6e4e791f090dea0ae70a 100644 (file)
@@ -44,6 +44,10 @@ namespace INTERP_KERNEL
     Bounds():_x_min(0.),_x_max(0.),_y_min(0.),_y_max(0.) { }
     double &operator[](int i);
     const double& operator[](int i) const;
+    double getXMin() const { return _x_min; }
+    double getXMax() const { return _x_max; }
+    double getYMin() const { return _y_min; }
+    double getYMax() const { return _y_max; }
     double getDiagonal() const;
     void getBarycenter(double& xBary, double& yBary) const;
     void applySimilarity(double xBary, double yBary, double dimChar);
index 464702dd02ed7ddd6d173946a8929de30da8edaa..bc3c20662547cf22eadcfdc9e75746867f8c0e47 100644 (file)
@@ -250,6 +250,17 @@ void ComposedEdge::getBarycenterGeneral(double *bary) const
   _sub_edges.back()->getBarycenter(bary,w);
 }
 
+double ComposedEdge::normalizeMe(double& xBary, double& yBary)
+{
+  Bounds b;
+  b.prepareForAggregation();
+  fillBounds(b);
+  double dimChar=b.getCaracteristicDim();
+  b.getBarycenter(xBary,yBary);
+  applyGlobalSimilarity(xBary,yBary,dimChar);
+  return dimChar;
+}
+
 double ComposedEdge::normalize(ComposedEdge *other, double& xBary, double& yBary)
 {
   Bounds b;
@@ -419,10 +430,59 @@ void ComposedEdge::getBarycenter(double *bary, double& weigh) const
   bary[1]/=weigh;
 }
 
-/**
- * Detect if the node is in the Polygon (ComposedEdge or not)
+/*!
+ * \sa ComposedEdge::isInOrOut2
  */
 bool ComposedEdge::isInOrOut(Node *nodeToTest) const
+{
+  std::set< IntersectElement > inOutSwitch;
+  double ref(isInOrOutAlg(nodeToTest,inOutSwitch));
+  bool ret=false;
+  for(std::set< IntersectElement >::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++)
+    {
+      if((*iter4).getVal1()<ref)
+        {
+          if((*iter4).getNodeOnly()->getLoc()==ON_1)
+            ret=!ret;
+        }
+      else
+        break;
+    }
+  return ret;
+}
+
+/*!
+ * This method is close to ComposedEdge::isInOrOut behaviour except that here EPSILON is taken into account to detect if it is IN or OUT.
+ * If \a nodeToTest is close to an edge in \a this, true will be returned even if it is outside informatically from \a this.
+ * This method makes the hypothesis that 
+ *
+ * \sa ComposedEdge::isInOrOut
+ */
+bool ComposedEdge::isInOrOut2(Node *nodeToTest) const
+{
+  std::set< IntersectElement > inOutSwitch;
+  double ref(isInOrOutAlg(nodeToTest,inOutSwitch));
+  bool ret=false;
+  for(std::set< IntersectElement >::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++)
+    {
+      double val((*iter4).getVal1());
+      if(fabs(val-ref)>=QUADRATIC_PLANAR::_precision)
+        {
+          if(val<ref)
+            {
+              if((*iter4).getNodeOnly()->getLoc()==ON_1)
+                ret=!ret;
+            }
+          else
+            break;
+        }
+      else
+        return true;
+    }
+  return ret;
+}
+
+double ComposedEdge::isInOrOutAlg(Node *nodeToTest, std::set< IntersectElement >& inOutSwitch) const
 {
   Bounds b; b.prepareForAggregation();
   fillBounds(b);
@@ -447,7 +507,6 @@ bool ComposedEdge::isInOrOut(Node *nodeToTest) const
   // ok for e1 - Let's go.
   EdgeInfLin *e1=new EdgeInfLin(nodeToTest,radialDistrib[i]+radialDistrib3[i]/2.);
   double ref=e1->getCharactValue(*nodeToTest);
-  std::set< IntersectElement > inOutSwitch;
   for(std::list<ElementaryEdge *>::const_iterator iter4=_sub_edges.begin();iter4!=_sub_edges.end();iter4++)
     {
       ElementaryEdge *val=(*iter4);
@@ -471,21 +530,10 @@ bool ComposedEdge::isInOrOut(Node *nodeToTest) const
           //if overlapped we can forget
         }
       else
-        throw Exception("Invalid use of ComposedEdge::isInOrOut : only one level supported !");
+        throw Exception("Invalid use of ComposedEdge::isInOrOutAlg : only one level supported !");
     }
   e1->decrRef();
-  bool ret=false;
-  for(std::set< IntersectElement >::iterator iter4=inOutSwitch.begin();iter4!=inOutSwitch.end();iter4++)
-    {
-      if((*iter4).getVal1()<ref)
-        {
-          if((*iter4).getNodeOnly()->getLoc()==ON_1)
-            ret=!ret;
-        }
-      else
-        break;
-    }
-  return ret;
+  return ref;
 }
 
 /*bool ComposedEdge::isInOrOut(Node *aNodeOn, Node *nodeToTest) const
index 206a7017ed68070d3ae21562159f6909baf4c01b..3e5221ee3adc3d3a1efe0174a6b71fe16ecaa061 100644 (file)
@@ -22,6 +22,7 @@
 #define __INTERPKERNELGEO2DCOMPOSEDNODE_HXX__
 
 #include "INTERPKERNELDefines.hxx"
+#include "InterpKernelGeo2DEdge.hxx"
 
 #include <set>
 #include <list>
@@ -58,6 +59,7 @@ namespace INTERP_KERNEL
     INTERPKERNEL_EXPORT double getHydraulicDiameter() const;
     INTERPKERNEL_EXPORT void getBarycenter(double *bary) const;
     INTERPKERNEL_EXPORT void getBarycenterGeneral(double *bary) const;
+    INTERPKERNEL_EXPORT double normalizeMe(double& xBary, double& yBary);
     INTERPKERNEL_EXPORT double normalize(ComposedEdge *other, double& xBary, double& yBary);
     INTERPKERNEL_EXPORT double normalizeExt(ComposedEdge *other, double& xBary, double& yBary);
     INTERPKERNEL_EXPORT void unApplyGlobalSimilarityExt(ComposedEdge& other, double xBary, double yBary, double fact);
@@ -89,10 +91,12 @@ namespace INTERP_KERNEL
     INTERPKERNEL_EXPORT bool changeStartNodeWith(Node *node) const;
     INTERPKERNEL_EXPORT void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
     INTERPKERNEL_EXPORT bool isInOrOut(Node *nodeToTest) const;
+    INTERPKERNEL_EXPORT bool isInOrOut2(Node *nodeToTest) const;
     INTERPKERNEL_EXPORT bool getDirection() const;
     INTERPKERNEL_EXPORT bool intresincEqCoarse(const Edge *other) const;
   private:
     std::list<ElementaryEdge *>* getListBehind() { return &_sub_edges; }
+    double isInOrOutAlg(Node *nodeToTest, std::set< IntersectElement >& inOutSwitch) const;
   protected:
     ~ComposedEdge();
   private:
index 12fbbee7f6c56e80f69fec9f0970b4e1833f8876..8a00bee6ee52ab13890f2485bbf617bcf3314291 100644 (file)
@@ -23,6 +23,7 @@
 #include "InterpKernelGeo2DEdgeInfLin.hxx"
 //#include "EdgeParabol.hxx"
 #include "InterpKernelGeo2DEdgeArcCircle.hxx"
+#include "InterpKernelGeo2DComposedEdge.hxx"
 #include "InterpKernelException.hxx"
 
 #include <algorithm>
index 4076f70b2b540dad4b4829c5343ca2d0189ffcbe..aa0164d7fddf275a7c23d9ea8722b139d6db6d1b 100644 (file)
@@ -22,7 +22,6 @@
 #define __INTERPKERNELGEO2DEDGE_HXX__
 
 #include "INTERPKERNELDefines.hxx"
-#include "InterpKernelGeo2DComposedEdge.hxx"
 #include "InterpKernelException.hxx"
 #include "InterpKernelGeo2DBounds.hxx"
 #include "InterpKernelGeo2DNode.hxx"
@@ -94,6 +93,8 @@ namespace INTERP_KERNEL
     unsigned _ass2End2    : 1;
   };
 
+  class Edge;
+  class ComposedEdge;
   /*!
    * This class is in charge to store an intersection point as result of \b non oververlapping edge intersection.
    * This class manages the cases when intersect element is one of the extrimities of edge1 and/or edge2.
index 43e13b4de1ec895ca3fb512ef0ff7a013a137d74..4d161d7fcca04690a509a9f2c793a45a74e446c7 100644 (file)
@@ -21,6 +21,7 @@
 #include "InterpKernelGeo2DElementaryEdge.hxx"
 #include "InterpKernelException.hxx"
 #include "InterpKernelGeo2DEdge.hxx"
+#include "InterpKernelGeo2DComposedEdge.hxx"
 
 using namespace INTERP_KERNEL;
 
index 1132085623274a261438620b949357a22207a306..6d3bb0e077ac44856f63baf9809ed24cf09606e9 100644 (file)
@@ -80,6 +80,8 @@ TARGET_LINK_LIBRARIES(InterpKernelTest medloader medcoupling interpkernel ${CPPU
 ADD_EXECUTABLE(TestINTERP_KERNEL ${TestINTERP_KERNEL_SOURCES})
 TARGET_LINK_LIBRARIES(TestINTERP_KERNEL InterpKernelTest ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
 ADD_TEST(TestINTERP_KERNEL TestINTERP_KERNEL)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+SET_TESTS_PROPERTIES(TestINTERP_KERNEL PROPERTIES ENVIRONMENT "${tests_env}")
 
 INSTALL(TARGETS TestINTERP_KERNEL DESTINATION ${SALOME_INSTALL_BINS})
 INSTALL(TARGETS InterpKernelTest DESTINATION ${SALOME_INSTALL_LIBS})
index 3ad0c08d4838603a29cb634d307f19917a9aa259..ca92e2fa09a7705d8683bee975ebd47159153356 100644 (file)
@@ -1960,12 +1960,14 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh2D() const
 /*!
  * This method aggregate the bbox of each cell and put it into bbox 
  *
+ * \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
+ *                         For all other cases this input parameter is ignored.
  * \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
  * 
  * \throw If \a this is not fully set (coordinates and connectivity).
  * \throw If a cell in \a this has no valid nodeId.
  */
-DataArrayDouble *MEDCoupling1SGTUMesh::getBoundingBoxForBBTree() const
+DataArrayDouble *MEDCoupling1SGTUMesh::getBoundingBoxForBBTree(double arcDetEps) const
 {
   int spaceDim(getSpaceDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes()),nbOfNodesPerCell(getNumberOfNodesPerCell());
   MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
@@ -3352,12 +3354,14 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::buildSetInstanceFromThis(int spaceDi
 /*!
  * This method aggregate the bbox of each cell and put it into bbox parameter.
  * 
+ * \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
+ *                         For all other cases this input parameter is ignored.
  * \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
  * 
  * \throw If \a this is not fully set (coordinates and connectivity).
  * \throw If a cell in \a this has no valid nodeId.
  */
-DataArrayDouble *MEDCoupling1DGTUMesh::getBoundingBoxForBBTree() const
+DataArrayDouble *MEDCoupling1DGTUMesh::getBoundingBoxForBBTree(double arcDetEps) const
 {
   checkFullyDefined();
   int spaceDim(getSpaceDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
index 93ba77249f3eadcd8139b89fb5c5dc2c32325720..805ba002d0155d9b50f8b4ffd3d13d7cc67f0eb5 100644 (file)
@@ -130,7 +130,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void renumberNodesInConn(const int *newNodeNumbersO2N);
     MEDCOUPLING_EXPORT void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const;
     MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const;
-    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree() const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
     // overload of MEDCoupling1GTUMesh
     MEDCOUPLING_EXPORT void checkCoherencyOfConnectivity() const;
     MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0);
@@ -219,7 +219,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void renumberNodesInConn(const int *newNodeNumbersO2N);
     MEDCOUPLING_EXPORT void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const;
     MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const;
-    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree() const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
     // overload of MEDCoupling1GTUMesh
     MEDCOUPLING_EXPORT void checkCoherencyOfConnectivity() const;
     MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0);
index a76eea12873b2166609e7cde45f911ff71a430f0..3658b43bee4b276b6ffa30d407909fa5501e97d1 100644 (file)
@@ -250,7 +250,7 @@ INTERP_KERNEL::NormalizedCellType MEDCouplingExtrudedMesh::getTypeOfCell(int cel
 
 std::set<INTERP_KERNEL::NormalizedCellType> MEDCouplingExtrudedMesh::getAllGeoTypes() const
 {
-  const std::set<INTERP_KERNEL::NormalizedCellType>& ret2D=_mesh2D->getAllTypes();
+  std::set<INTERP_KERNEL::NormalizedCellType> ret2D(_mesh2D->getAllGeoTypes());
   std::set<INTERP_KERNEL::NormalizedCellType> ret;
   for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=ret2D.begin();it!=ret2D.end();it++)
     ret.insert(INTERP_KERNEL::CellModel::GetCellModel(*it).getExtrudedType());
index 88390fc3aff06eaee63d1a270f2c807e6b1c593e..ff071afa6900e094d3a01acf462312d08df7ede6 100644 (file)
@@ -4595,6 +4595,8 @@ DataArrayDouble *DataArrayDouble::Aggregate(const DataArrayDouble *a1, const Dat
  * the number of component in the result array is same as that of each of given arrays.
  * Info on components is copied from the first of the given arrays. Number of components
  * in the given arrays must be  the same.
+ * If the number of non null of elements in \a arr is equal to one the returned object is a copy of it
+ * not the object itself.
  *  \param [in] arr - a sequence of arrays to include in the result array.
  *  \return DataArrayDouble * - the new instance of DataArrayDouble.
  *          The caller is to delete this result array using decrRef() as it is no more
@@ -8393,13 +8395,14 @@ DataArrayIntIterator *DataArrayInt::iterator()
  *          array using decrRef() as it is no more needed.
  *  \throw If \a this is not allocated.
  *  \throw If \a this->getNumberOfComponents() != 1.
+ *  \sa DataArrayInt::getIdsEqualTuple
  */
 DataArrayInt *DataArrayInt::getIdsEqual(int val) const
 {
   checkAllocated();
   if(getNumberOfComponents()!=1)
     throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqual : the array must have only one component, you can call 'rearrange' method before !");
-  const int *cptr=getConstPointer();
+  const int *cptr(getConstPointer());
   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
   int nbOfTuples=getNumberOfTuples();
   for(int i=0;i<nbOfTuples;i++,cptr++)
@@ -8422,7 +8425,7 @@ DataArrayInt *DataArrayInt::getIdsNotEqual(int val) const
   checkAllocated();
   if(getNumberOfComponents()!=1)
     throw INTERP_KERNEL::Exception("DataArrayInt::getIdsNotEqual : the array must have only one component, you can call 'rearrange' method before !");
-  const int *cptr=getConstPointer();
+  const int *cptr(getConstPointer());
   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
   int nbOfTuples=getNumberOfTuples();
   for(int i=0;i<nbOfTuples;i++,cptr++)
@@ -8431,6 +8434,45 @@ DataArrayInt *DataArrayInt::getIdsNotEqual(int val) const
   return ret.retn();
 }
 
+/*!
+ * Creates a new DataArrayInt containing IDs (indices) of tuples holding tuple equal to those defined by [ \a tupleBg , \a tupleEnd )
+ * This method is an extension of  DataArrayInt::getIdsEqual method.
+ *
+ *  \param [in] tupleBg - the begin (included) of the input tuple to find within \a this.
+ *  \param [in] tupleEnd - the end (excluded) of the input tuple to find within \a this.
+ *  \return DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this
+ *          array using decrRef() as it is no more needed.
+ *  \throw If \a this is not allocated.
+ *  \throw If \a this->getNumberOfComponents() != std::distance(tupleBg,tupleEnd).
+ * \throw If \a this->getNumberOfComponents() is equal to 0.
+ * \sa DataArrayInt::getIdsEqual
+ */
+DataArrayInt *DataArrayInt::getIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const
+{
+  std::size_t nbOfCompoExp(std::distance(tupleBg,tupleEnd));
+  checkAllocated();
+  if(getNumberOfComponents()!=(int)nbOfCompoExp)
+    {
+      std::ostringstream oss; oss << "DataArrayInt::getIdsEqualTuple : mismatch of number of components. Input tuple has " << nbOfCompoExp << " whereas this array has " << getNumberOfComponents() << " components !";
+      throw INTERP_KERNEL::Exception(oss.str().c_str());
+    }
+  if(nbOfCompoExp==0)
+    throw INTERP_KERNEL::Exception("DataArrayInt::getIdsEqualTuple : number of components should be > 0 !");
+  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret(DataArrayInt::New()); ret->alloc(0,1);
+  const int *bg(begin()),*end2(end()),*work(begin());
+  while(work!=end2)
+    {
+      work=std::search(work,end2,tupleBg,tupleEnd);
+      if(work!=end2)
+        {
+          std::size_t pos(std::distance(bg,work));
+          if(pos%nbOfCompoExp==0)
+            ret->pushBackSilent(pos/nbOfCompoExp);
+          work++;
+        }
+    }
+  return ret.retn();
+}
 
 /*!
  * Assigns \a newValue to all elements holding \a oldValue within \a this
@@ -8800,6 +8842,8 @@ DataArrayInt *DataArrayInt::Aggregate(const DataArrayInt *a1, const DataArrayInt
  * the number of component in the result array is same as that of each of given arrays.
  * Info on components is copied from the first of the given arrays. Number of components
  * in the given arrays must be  the same.
+ * If the number of non null of elements in \a arr is equal to one the returned object is a copy of it
+ * not the object itself.
  *  \param [in] arr - a sequence of arrays to include in the result array.
  *  \return DataArrayInt * - the new instance of DataArrayInt.
  *          The caller is to delete this result array using decrRef() as it is no more
index af0e9b255144a1456b1ecc90cd67e7d8d4d4a6d9..3f6e38a893276ab311b8c314b1dfca25c12358bd 100644 (file)
@@ -534,6 +534,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqual(int val) const;
     MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualList(const int *valsBg, const int *valsEnd) const;
     MEDCOUPLING_EXPORT DataArrayInt *getIdsNotEqualList(const int *valsBg, const int *valsEnd) const;
+    MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualTuple(const int *tupleBg, const int *tupleEnd) const;
     MEDCOUPLING_EXPORT int changeValue(int oldValue, int newValue);
     MEDCOUPLING_EXPORT int locateTuple(const std::vector<int>& tupl) const;
     MEDCOUPLING_EXPORT int locateValue(int value) const;
index 412d83c7bb09c99d96524f1471a8d8b4256a1004..aa5622b19b926eddfab5bfe2de5c7727141b8580 100644 (file)
@@ -131,7 +131,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
     MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                                             const std::vector<std::string>& littleStrings);
-    MEDCOUPLING_EXPORT virtual DataArrayDouble *getBoundingBoxForBBTree() const = 0;
+    MEDCOUPLING_EXPORT virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const = 0;
     MEDCOUPLING_EXPORT virtual DataArrayInt *getCellsInBoundingBox(const double *bbox, double eps) const = 0;
     MEDCOUPLING_EXPORT virtual DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps) = 0;
     MEDCOUPLING_EXPORT virtual DataArrayInt *zipCoordsTraducer();
index 44c34fd200c13cfa679631162e68f44e0cc61d23..70e17c9c1c3fd65177d7d89f102d771834e05bba 100644 (file)
@@ -419,12 +419,39 @@ MEDCouplingUMeshCellByTypeEntry *MEDCouplingUMesh::cellsByType()
  * Returns a set of all cell types available in \a this mesh.
  * \return std::set<INTERP_KERNEL::NormalizedCellType> - the set of cell types.
  * \warning this method does not throw any exception even if \a this is not defined.
+ * \sa MEDCouplingUMesh::getAllGeoTypesSorted
  */
 std::set<INTERP_KERNEL::NormalizedCellType> MEDCouplingUMesh::getAllGeoTypes() const
 {
   return _types;
 }
 
+/*!
+ * This method returns the sorted list of geometric types in \a this.
+ * Sorted means in the same order than the cells in \a this. A single entry in return vector means the maximal chunk of consecutive cells in \a this
+ * having the same geometric type. So a same geometric type can appear more than once if the cells are not sorted per geometric type.
+ *
+ * \throw if connectivity in \a this is not correctly defined.
+ *  
+ * \sa MEDCouplingMesh::getAllGeoTypes
+ */
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDCouplingUMesh::getAllGeoTypesSorted() const
+{
+  std::vector<INTERP_KERNEL::NormalizedCellType> ret;
+  checkConnectivityFullyDefined();
+  int nbOfCells(getNumberOfCells());
+  if(nbOfCells==0)
+    return ret;
+  if(getMeshLength()<1)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getAllGeoTypesSorted : the connectivity in this seems invalid !");
+  const int *c(_nodal_connec->begin()),*ci(_nodal_connec_index->begin());
+  ret.push_back((INTERP_KERNEL::NormalizedCellType)c[*ci++]);
+  for(int i=1;i<nbOfCells;i++,ci++)
+    if(ret.back()!=((INTERP_KERNEL::NormalizedCellType)c[*ci]))
+      ret.push_back((INTERP_KERNEL::NormalizedCellType)c[*ci]);
+  return ret;
+}
+
 /*!
  * This method is a method that compares \a this and \a other.
  * This method compares \b all attributes, even names and component names.
@@ -2910,7 +2937,7 @@ int MEDCouplingUMesh::getNumberOfNodesInCell(int cellId) const
  *         describing the cell types. 
  *  \throw If the coordinates array is not set.
  *  \throw If the nodal connectivity of cells is not defined.
- *  \sa getAllTypes()
+ *  \sa getAllGeoTypes()
  */
 std::set<INTERP_KERNEL::NormalizedCellType> MEDCouplingUMesh::getTypesOfPart(const int *begin, const int *end) const
 {
@@ -3994,6 +4021,9 @@ void MEDCouplingUMesh::DistanceToPoint2DCurveAlg(const double *pt, const int *ce
 
 /*!
  * Finds cells in contact with a ball (i.e. a point with precision). 
+ * For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT.
+ * If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.
+ *
  * \warning This method is suitable if the caller intends to evaluate only one
  *          point, for more points getCellsContainingPoints() is recommended as it is
  *          faster. 
@@ -4015,6 +4045,8 @@ int MEDCouplingUMesh::getCellContainingPoint(const double *pos, double eps) cons
 
 /*!
  * Finds cells in contact with a ball (i.e. a point with precision).
+ * For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT.
+ * If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.
  * \warning This method is suitable if the caller intends to evaluate only one
  *          point, for more points getCellsContainingPoints() is recommended as it is
  *          faster. 
@@ -4172,7 +4204,7 @@ void MEDCouplingUMesh::getCellsContainingPointsAlg(const double *coords, const d
 {
   elts=DataArrayInt::New(); eltsIndex=DataArrayInt::New(); eltsIndex->alloc(nbOfPoints+1,1); eltsIndex->setIJ(0,0,0); elts->alloc(0,1);
   int *eltsIndexPtr(eltsIndex->getPointer());
-  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bboxArr(getBoundingBoxForBBTree());
+  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bboxArr(getBoundingBoxForBBTree(eps));
   const double *bbox(bboxArr->begin());
   int nbOfCells=getNumberOfCells();
   const int *conn=_nodal_connec->getConstPointer();
@@ -4191,10 +4223,35 @@ void MEDCouplingUMesh::getCellsContainingPointsAlg(const double *coords, const d
       myTree.getIntersectingElems(bb,candidates);
       for(std::vector<int>::const_iterator iter=candidates.begin();iter!=candidates.end();iter++)
         {
-          int sz=connI[(*iter)+1]-connI[*iter]-1;
-          if(INTERP_KERNEL::PointLocatorAlgos<DummyClsMCUG<SPACEDIM> >::isElementContainsPoint(pos+i*SPACEDIM,
-                                                                                               (INTERP_KERNEL::NormalizedCellType)conn[connI[*iter]],
-                                                                                               coords,conn+connI[*iter]+1,sz,eps))
+          int sz(connI[(*iter)+1]-connI[*iter]-1);
+          INTERP_KERNEL::NormalizedCellType ct((INTERP_KERNEL::NormalizedCellType)conn[connI[*iter]]);
+          bool status(false);
+          if(ct!=INTERP_KERNEL::NORM_POLYGON && ct!=INTERP_KERNEL::NORM_QPOLYG)
+            status=INTERP_KERNEL::PointLocatorAlgos<DummyClsMCUG<SPACEDIM> >::isElementContainsPoint(pos+i*SPACEDIM,ct,coords,conn+connI[*iter]+1,sz,eps);
+          else
+            {
+              if(SPACEDIM!=2)
+                throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getCellsContainingPointsAlg : not implemented yet for POLYGON and QPOLYGON in spaceDim 3 !");
+              INTERP_KERNEL::QUADRATIC_PLANAR::_precision=eps;
+              INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=eps;
+              std::vector<INTERP_KERNEL::Node *> nodes(sz);
+              INTERP_KERNEL::QuadraticPolygon *pol(0);
+              for(int j=0;j<sz;j++)
+                {
+                  int nodeId(conn[connI[*iter]+1+j]);
+                  nodes[j]=new INTERP_KERNEL::Node(coords[nodeId*SPACEDIM],coords[nodeId*SPACEDIM+1]);
+                }
+              if(!INTERP_KERNEL::CellModel::GetCellModel(ct).isQuadratic())
+                pol=INTERP_KERNEL::QuadraticPolygon::BuildLinearPolygon(nodes);
+              else
+                pol=INTERP_KERNEL::QuadraticPolygon::BuildArcCirclePolygon(nodes);
+              INTERP_KERNEL::Node *n(new INTERP_KERNEL::Node(pos[i*SPACEDIM],pos[i*SPACEDIM+1]));
+              double a(0.),b(0.),c(0.);
+              a=pol->normalizeMe(b,c); n->applySimilarity(b,c,a);
+              status=pol->isInOrOut2(n);
+              delete pol; n->decrRef();
+            }
+          if(status)
             {
               eltsIndexPtr[i+1]++;
               elts->pushBackSilent(*iter);
@@ -4206,6 +4263,8 @@ void MEDCouplingUMesh::getCellsContainingPointsAlg(const double *coords, const d
  * Finds cells in contact with several balls (i.e. points with precision).
  * This method is an extension of getCellContainingPoint() and
  * getCellsContainingPoint() for the case of multiple points.
+ * For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT.
+ * If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.
  *  \param [in] pos - an array of coordinates of points in full interlace mode :
  *         X0,Y0,Z0,X1,Y1,Z1,... Size of the array must be \a
  *         this->getSpaceDimension() * \a nbOfPoints 
@@ -6202,12 +6261,45 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getSkewField() const
 /*!
  * This method aggregate the bbox of each cell and put it into bbox parameter.
  * 
+ * \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
+ *                         For all other cases this input parameter is ignored.
  * \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
  * 
  * \throw If \a this is not fully set (coordinates and connectivity).
  * \throw If a cell in \a this has no valid nodeId.
+ * \sa MEDCouplingUMesh::getBoundingBoxForBBTreeFast, MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic
  */
-DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTree() const
+DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTree(double arcDetEps) const
+{
+  int mDim(getMeshDimension()),sDim(getSpaceDimension());
+  if(mDim!=2 || sDim!=2)
+    return getBoundingBoxForBBTreeFast();
+  else
+    {
+      bool presenceOfQuadratic(false);
+      for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator it=_types.begin();it!=_types.end();it++)
+        {
+          const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(*it));
+          if(cm.isQuadratic())
+            presenceOfQuadratic=true;
+        }
+      if(presenceOfQuadratic)
+        return getBoundingBoxForBBTree2DQuadratic(arcDetEps);
+      else
+        return getBoundingBoxForBBTreeFast();
+    }
+}
+
+/*!
+ * This method aggregate the bbox of each cell only considering the nodes constituting each cell and put it into bbox parameter.
+ * So meshes having quadratic cells the computed bounding boxes can be invalid !
+ * 
+ * \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
+ * 
+ * \throw If \a this is not fully set (coordinates and connectivity).
+ * \throw If a cell in \a this has no valid nodeId.
+ */
+DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTreeFast() const
 {
   checkFullyDefined();
   int spaceDim(getSpaceDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
@@ -6246,6 +6338,48 @@ DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTree() const
   return ret.retn();
 }
 
+/*!
+ * This method aggregate the bbox regarding foreach 2D cell in \a this the whole shape. So this method is particulary useful for 2D meshes having quadratic cells
+ * because for this type of cells getBoundingBoxForBBTreeFast method may return invalid bounding boxes.
+ * 
+ * \param [in] arcDetEps - a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
+ * \return DataArrayDouble * - newly created object (to be managed by the caller) \a this number of cells tuples and 2*spacedim components.
+ * \throw If \a this is not fully defined.
+ * \throw If \a this is not a mesh with meshDimension equal to 2.
+ * \throw If \a this is not a mesh with spaceDimension equal to 2.
+ */
+DataArrayDouble *MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic(double arcDetEps) const
+{
+  checkFullyDefined();
+  int spaceDim(getSpaceDimension()),mDim(getMeshDimension()),nbOfCells(getNumberOfCells()),nbOfNodes(getNumberOfNodes());
+  if(mDim!=2 || spaceDim!=2)
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic : This method should be applied on mesh with mesh dimension equal to 2 and space dimension also equal to 2!");
+  MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> ret(DataArrayDouble::New()); ret->alloc(nbOfCells,2*spaceDim);
+  double *bbox(ret->getPointer());
+  const double *coords(_coords->getConstPointer());
+  const int *conn(_nodal_connec->getConstPointer()),*connI(_nodal_connec_index->getConstPointer());
+  for(int i=0;i<nbOfCells;i++,bbox+=4,connI++)
+    {
+      const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[*connI]));
+      int sz(connI[1]-connI[0]-1);
+      INTERP_KERNEL::QUADRATIC_PLANAR::_arc_detection_precision=1e-12;
+      std::vector<INTERP_KERNEL::Node *> nodes(sz);
+      INTERP_KERNEL::QuadraticPolygon *pol(0);
+      for(int j=0;j<sz;j++)
+        {
+          int nodeId(conn[*connI+1+j]);
+          nodes[j]=new INTERP_KERNEL::Node(coords[nodeId*2],coords[nodeId*2+1]);
+        }
+      if(!cm.isQuadratic())
+        pol=INTERP_KERNEL::QuadraticPolygon::BuildLinearPolygon(nodes);
+      else
+        pol=INTERP_KERNEL::QuadraticPolygon::BuildArcCirclePolygon(nodes);
+      INTERP_KERNEL::Bounds b; pol->fillBounds(b); delete pol;
+      bbox[0]=b.getXMin(); bbox[1]=b.getXMax(); bbox[2]=b.getYMin(); bbox[3]=b.getYMax(); 
+    }
+  return ret.retn();
+}
+
 /// @cond INTERNAL
 
 namespace ParaMEDMEMImpl
@@ -6288,7 +6422,7 @@ std::vector<int> MEDCouplingUMesh::getDistributionOfTypes() const
   const int *connI=_nodal_connec_index->getConstPointer();
   const int *work=connI;
   int nbOfCells=getNumberOfCells();
-  std::size_t n=getAllTypes().size();
+  std::size_t n=getAllGeoTypes().size();
   std::vector<int> ret(3*n,-1); //ret[3*k+2]==-1 because it has no sense here
   std::set<INTERP_KERNEL::NormalizedCellType> types;
   for(std::size_t i=0;work!=connI+nbOfCells;i++)
@@ -6959,7 +7093,7 @@ DataArrayInt *MEDCouplingUMesh::convertCellArrayPerGeoType(const DataArrayInt *d
   const int *conn=_nodal_connec->getConstPointer();
   const int *connI=_nodal_connec_index->getConstPointer();
   int nbOfCells=getNumberOfCells();
-  std::set<INTERP_KERNEL::NormalizedCellType> types=getAllTypes();
+  std::set<INTERP_KERNEL::NormalizedCellType> types(getAllGeoTypes());
   int *tmp=new int[nbOfCells];
   for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iter=types.begin();iter!=types.end();iter++)
     {
@@ -8150,7 +8284,7 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData
   int nbOfCells=getNumberOfCells();
   if(nbOfCells<=0)
     throw INTERP_KERNEL::Exception("MEDCouplingUMesh::writeVTK : the unstructured mesh has no cells !");
-  static const int PARAMEDMEM2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,-1,4};
+  static const int PARAMEDMEM2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]={1,3,21,5,9,7,22,34,23,28,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,29,-1,-1,25,42,36,4};
   ofs << "  <" << getVTKDataSetType() << ">\n";
   ofs << "    <Piece NumberOfPoints=\"" << getNumberOfNodes() << "\" NumberOfCells=\"" << nbOfCells << "\">\n";
   ofs << "      <PointData>\n" << pointData << std::endl;
index fea05ddeea14b51de5d7fe82d25aa5addd6401b3..56eb0193ae0ab0aee7691589dc47dbee413c5942 100644 (file)
@@ -61,8 +61,8 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void finishInsertingCells();
     MEDCOUPLING_EXPORT MEDCouplingUMeshCellIterator *cellIterator();
     MEDCOUPLING_EXPORT MEDCouplingUMeshCellByTypeEntry *cellsByType();
-    MEDCOUPLING_EXPORT const std::set<INTERP_KERNEL::NormalizedCellType>& getAllTypes() const { return _types; }
     MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
+    MEDCOUPLING_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getAllGeoTypesSorted() const;
     MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getTypesOfPart(const int *begin, const int *end) const;
     MEDCOUPLING_EXPORT void setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true);
     MEDCOUPLING_EXPORT const DataArrayInt *getNodalConnectivity() const { return _nodal_connec; }
@@ -164,7 +164,9 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT DataArrayInt *convexEnvelop2D();
     MEDCOUPLING_EXPORT DataArrayInt *findAndCorrectBadOriented3DExtrudedCells();
     MEDCOUPLING_EXPORT DataArrayInt *findAndCorrectBadOriented3DCells();
-    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree() const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTreeFast() const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
     MEDCOUPLING_EXPORT bool isFullyQuadratic() const;
     MEDCOUPLING_EXPORT bool isPresenceOfQuadratic() const;
index fc06ef5a3b80687316bed8a358b63bb8b4ea60c7..9f05e9a11516ec892e90e09a2e685d8ae32bccf6 100644 (file)
@@ -591,11 +591,11 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelf()
   MEDCouplingUMesh *subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshSimple);
   CPPUNIT_ASSERT(subMesh);
   std::string name(subMesh->getName());
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*mesh->getAllTypes().begin());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(mesh->getAllTypes().begin())));
-  CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllTypes().size());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*mesh->getAllGeoTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(mesh->getAllGeoTypes().begin())));
+  CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllGeoTypes().size());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
   CPPUNIT_ASSERT(name=="Toto");
   CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords());
   CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells());
@@ -611,9 +611,9 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelf()
   subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshSimple);
   CPPUNIT_ASSERT(subMesh);
   name=subMesh->getName();
-  CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllTypes().size());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllTypes().begin());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(subMesh->getAllTypes().begin())));
+  CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllGeoTypes().size());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllGeoTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(subMesh->getAllGeoTypes().begin())));
   CPPUNIT_ASSERT(name=="Toto");
   CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords());
   CPPUNIT_ASSERT_EQUAL(3,subMesh->getNumberOfCells());
@@ -640,8 +640,8 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelfNode()
   MEDCouplingPointSet *subMeshSimple=mesh->buildPartOfMySelfNode(tab1,tab1+4,true);
   MEDCouplingUMesh *subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshSimple);
   CPPUNIT_ASSERT(subMesh);
-  CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllTypes().size());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllGeoTypes().size());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
   CPPUNIT_ASSERT_EQUAL(1,subMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL((std::size_t)5,subMesh->getNodalConnectivity()->getNbOfElems());
   CPPUNIT_ASSERT_EQUAL((std::size_t)2,subMesh->getNodalConnectivityIndex()->getNbOfElems());
@@ -655,9 +655,9 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelfNode()
   subMeshSimple=mesh->buildPartOfMySelfNode(tab1,tab1+2,false);
   subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshSimple);
   CPPUNIT_ASSERT(subMesh);
-  CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllTypes().size());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllTypes().begin());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllTypes().begin()));
+  CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllGeoTypes().size());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllGeoTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllGeoTypes().begin()));
   CPPUNIT_ASSERT_EQUAL(3,subMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL((std::size_t)14,subMesh->getNodalConnectivity()->getNbOfElems());
   CPPUNIT_ASSERT_EQUAL((std::size_t)4,subMesh->getNodalConnectivityIndex()->getNbOfElems());
@@ -672,9 +672,9 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelfNode()
   subMeshSimple=mesh->buildPartOfMySelfNode(tab2,tab2+7,true);
   subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshSimple);
   CPPUNIT_ASSERT(subMesh);
-  CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllTypes().size());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllTypes().begin());
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllTypes().begin()));
+  CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllGeoTypes().size());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllGeoTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllGeoTypes().begin()));
   CPPUNIT_ASSERT_EQUAL(3,subMesh->getNumberOfCells());
   subMeshSimple->decrRef();
   //
@@ -684,7 +684,7 @@ void MEDCouplingBasicsTest1::testBuildPartOfMySelfNode()
 void MEDCouplingBasicsTest1::testZipCoords()
 {
   MEDCouplingUMesh *mesh=build2DTargetMesh_1();
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
   CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension());
   CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes());
   CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
@@ -695,7 +695,7 @@ void MEDCouplingBasicsTest1::testZipCoords()
   DataArrayDouble *oldCoords=mesh->getCoords();
   oldCoords->incrRef();
   mesh->zipCoords();
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
   CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension());
   CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes());
   CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
@@ -713,7 +713,7 @@ void MEDCouplingBasicsTest1::testZipCoords()
   const int expectedTraducer[9]={0,1,-1,2,3,4,-1,5,6};
   CPPUNIT_ASSERT(std::equal(expectedTraducer,expectedTraducer+9,traducer->getPointer()));
   traducer->decrRef();
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
   CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells());
   const int subConn[10]={4,0,2,3,1,4,5,6,4,3};
   const int subConnIndex[3]={0,5,10};
@@ -727,7 +727,7 @@ void MEDCouplingBasicsTest1::testZipCoords()
   subMeshPtSet=mesh->buildPartOfMySelf(tab1,tab1+2,false);
   subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshPtSet);
   CPPUNIT_ASSERT(subMesh);
-  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllTypes().begin());
+  CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
   CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(7,subMesh->getNumberOfNodes());
   CPPUNIT_ASSERT_EQUAL((std::size_t)10,subMesh->getNodalConnectivity()->getNbOfElems());
index d1482a26835aba6e2244f2ef1df8cf2112cdae4c..79b232f4a5c71ceacbb2a695ac94f3d06edec272 100644 (file)
@@ -747,7 +747,7 @@ void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear()
 {
   MEDCouplingUMesh *mesh=build2DTargetMesh_3();
   mesh->checkCoherency();
-  const std::set<INTERP_KERNEL::NormalizedCellType>& types=mesh->getAllTypes();
+  std::set<INTERP_KERNEL::NormalizedCellType> types=mesh->getAllGeoTypes();
   CPPUNIT_ASSERT_EQUAL(5,(int)types.size());
   INTERP_KERNEL::NormalizedCellType expected1[5]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QUAD8};
   std::set<INTERP_KERNEL::NormalizedCellType> expected1Bis(expected1,expected1+5);
@@ -763,8 +763,8 @@ void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear()
   MEDCouplingFieldDouble *f2=mesh->getMeasureField(false);
   CPPUNIT_ASSERT(f1->getArray()->isEqual(*f2->getArray(),1e-12));
   CPPUNIT_ASSERT_EQUAL(48,mesh->getMeshLength());
-  const std::set<INTERP_KERNEL::NormalizedCellType>& types2=mesh->getAllTypes();
-  CPPUNIT_ASSERT_EQUAL(3,(int)types.size());
+  std::set<INTERP_KERNEL::NormalizedCellType> types2=mesh->getAllGeoTypes();
+  CPPUNIT_ASSERT_EQUAL(3,(int)types2.size());
   INTERP_KERNEL::NormalizedCellType expected2[3]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4};
   std::set<INTERP_KERNEL::NormalizedCellType> expected2Bis(expected2,expected2+3);
   CPPUNIT_ASSERT(expected2Bis==types2);
index 762f4709c196c0582e6105c1641d89cdd0f2a1d3..a7db7454e58163bfff9f9ba837dd629f19f3dd72 100644 (file)
@@ -1573,7 +1573,7 @@ void MEDCouplingBasicsTest3::testSimplexize1()
   MEDCouplingFieldDouble *f=m->getMeasureField(false);
   for(int i=0;i<7;i++)
     CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i]*sqrt(2.),f->getIJ(i,0),1e-10);
-  std::set<INTERP_KERNEL::NormalizedCellType> types=m->getAllTypes();
+  std::set<INTERP_KERNEL::NormalizedCellType> types=m->getAllGeoTypes();
   CPPUNIT_ASSERT_EQUAL(2,(int)types.size());
   CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*(types.begin()));
   CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POLYGON,*(++(types.begin())));
@@ -1590,7 +1590,7 @@ void MEDCouplingBasicsTest3::testSimplexize1()
   for(int i=0;i<7;i++)
     CPPUNIT_ASSERT_EQUAL(expected2[i],da->getIJ(i,0));
   m->checkCoherency();
-  types=m->getAllTypes();
+  types=m->getAllGeoTypes();
   CPPUNIT_ASSERT_EQUAL(2,(int)types.size());
   CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*(types.begin()));
   CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POLYGON,*(++(types.begin())));
@@ -2449,7 +2449,7 @@ void MEDCouplingBasicsTest3::testBuild0DMeshFromCoords1()
   CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(3,m->getSpaceDimension());
   CPPUNIT_ASSERT_EQUAL(0,m->getMeshDimension());
-  const std::set<INTERP_KERNEL::NormalizedCellType>& types=m->getAllTypes();
+  std::set<INTERP_KERNEL::NormalizedCellType> types=m->getAllGeoTypes();
   CPPUNIT_ASSERT_EQUAL(1,(int)types.size());
   CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POINT1,*types.begin());
   for(int i=0;i<4;i++)
index 85da2eccefe8ac0278c880b22b007193bd1f65c5..fb039d01587a6b55799f8943a324c7d9c7c91ea1 100644 (file)
@@ -1403,7 +1403,7 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2()
   // resize with explicit ids list
   MEDCouplingUMesh *m=build2DTargetMesh_1();
   std::set<INTERP_KERNEL::NormalizedCellType> s; s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   const int ids1[3]={0,3,4};
   MEDCouplingUMesh *part=static_cast<MEDCouplingUMesh *>(m->buildPartOfMySelf(ids1,ids1+3,true));
   part->simplexize(0)->decrRef();
@@ -1417,7 +1417,7 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2()
   CPPUNIT_ASSERT(std::equal(expected2,expected2+6,m->getNodalConnectivityIndex()->getConstPointer()));
   CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems());
   s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   m->decrRef(); part->decrRef(); part2->decrRef();
   // no resize with explicit ids list
   m=build2DTargetMesh_1();
@@ -1431,7 +1431,7 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2()
   CPPUNIT_ASSERT(std::equal(expected4,expected4+6,m->getNodalConnectivityIndex()->getConstPointer()));
   CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems());
   s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); s.insert(INTERP_KERNEL::NORM_POLYGON);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   m->decrRef(); part->decrRef();
   // resize with range ids
   m=build2DTargetMesh_1();
@@ -1444,7 +1444,7 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2()
   CPPUNIT_ASSERT(std::equal(expected6,expected6+6,m->getNodalConnectivityIndex()->getConstPointer()));
   CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems());
   s.clear(); s.insert(INTERP_KERNEL::NORM_QUAD4);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   m->decrRef(); part->decrRef();
   // no resize with range ids
   m=build2DTargetMesh_1();
@@ -1458,7 +1458,7 @@ void MEDCouplingBasicsTest5::testUMeshSetPartOfMySelf2()
   CPPUNIT_ASSERT(std::equal(expected8,expected8+6,m->getNodalConnectivityIndex()->getConstPointer()));
   CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems());
 s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); s.insert(INTERP_KERNEL::NORM_POLYGON);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   m->decrRef(); part->decrRef();
   // no resize with range ids negative direction
   m=build2DTargetMesh_1();
@@ -1472,7 +1472,7 @@ s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD
   CPPUNIT_ASSERT(std::equal(expected10,expected10+6,m->getNodalConnectivityIndex()->getConstPointer()));
   CPPUNIT_ASSERT_EQUAL((std::size_t)6,m->getNodalConnectivityIndex()->getNbOfElems());
   s.clear(); s.insert(INTERP_KERNEL::NORM_TRI3); s.insert(INTERP_KERNEL::NORM_QUAD4); s.insert(INTERP_KERNEL::NORM_POLYGON);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   part->decrRef();
   m->decrRef();
 }
@@ -1500,7 +1500,7 @@ void MEDCouplingBasicsTest5::testUnPolyze3()
   m->unPolyze();
   CPPUNIT_ASSERT_EQUAL(1,m->getNumberOfCells());
   std::set<INTERP_KERNEL::NormalizedCellType> s; s.insert(INTERP_KERNEL::NORM_PENTA6);
-  CPPUNIT_ASSERT(s==m->getAllTypes());
+  CPPUNIT_ASSERT(s==m->getAllGeoTypes());
   //
   const int expected1[2]={0,7};
   const int expected2[7]={16,0,2,1,3,5,4};
index d136337d2fcc93b1244db3e92b2d320630d1a5cd..29b0934aabd71d840d6add61621e2790a2bd9c5a 100644 (file)
@@ -78,13 +78,16 @@ INSTALL(FILES MEDCoupling.i MEDCouplingCommon.i MEDCouplingRefCountObject.i MEDC
 INSTALL(FILES MEDCouplingBasicsTest.py MEDCouplingRemapperTest.py MEDCouplingDataForTest.py MEDCouplingNumPyTest.py DESTINATION ${SALOME_INSTALL_SCRIPT_PYTHON})
 INSTALL(FILES MEDCouplingExamplesTest.py DESTINATION ${SALOME_INSTALL_SCRIPT_PYTHON})
 
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
 ADD_TEST(MEDCouplingBasicsTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest.py)
+SET_TESTS_PROPERTIES(MEDCouplingBasicsTest PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(MEDCouplingExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingExamplesTest.py)
+SET_TESTS_PROPERTIES(MEDCouplingExamplesTest PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(MEDCouplingRemapperTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingRemapperTest.py)
-SET_TESTS_PROPERTIES(MEDCouplingBasicsTest MEDCouplingExamplesTest MEDCouplingRemapperTest
-                     PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}:$ENV{LD_LIBRARY_PATH}")
+SET_TESTS_PROPERTIES(MEDCouplingRemapperTest PROPERTIES ENVIRONMENT "${tests_env}")
+
 IF(NUMPY_FOUND)
   ADD_TEST(MEDCouplingNumPyTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingNumPyTest.py)
-  SET_TESTS_PROPERTIES(MEDCouplingNumPyTest
-                       PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}:$ENV{LD_LIBRARY_PATH}")
+  SET_TESTS_PROPERTIES(MEDCouplingNumPyTest PROPERTIES ENVIRONMENT "${tests_env}")
 ENDIF(NUMPY_FOUND)
index 18ae38854fb1a770630612b4de86c8eb98f71ab2..f4e4e111bdfc65eeaca106e1f3014cb9e31251ce 100644 (file)
@@ -123,7 +123,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertTrue(myCoords.getIJ(3,2)==-0.305)
         mesh.setCoords(myCoords);
         mesh.checkCoherency();
-        self.assertTrue(mesh.getAllTypes()==[4])
+        self.assertTrue(mesh.getAllGeoTypes()==[4])
         myFalseConn=DataArrayInt.New()
         myFalseConn.setValues(tab4,6,4)
         self.assertTrue(myFalseConn.getIJ(1,1)==3)
@@ -385,11 +385,11 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         subMesh=mesh.buildPartOfMySelf(tab1,True);
         self.assertTrue(isinstance(subMesh,MEDCouplingUMesh))
         name=subMesh.getName();
-        self.assertEqual(2,len(mesh.getAllTypes()));
-        self.assertEqual(NORM_TRI3,mesh.getAllTypes()[0]);
-        self.assertEqual(NORM_QUAD4,mesh.getAllTypes()[1]);
-        self.assertEqual(1,len(subMesh.getAllTypes()));
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[0]);
+        self.assertEqual(2,len(mesh.getAllGeoTypes()));
+        self.assertEqual(NORM_TRI3,mesh.getAllGeoTypes()[0]);
+        self.assertEqual(NORM_QUAD4,mesh.getAllGeoTypes()[1]);
+        self.assertEqual(1,len(subMesh.getAllGeoTypes()));
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[0]);
         self.assertEqual(name,"Toto");
         self.assertEqual(2,subMesh.getNumberOfCells());
         subConn=[4,0,3,4,1,4,7,8,5,4];
@@ -402,9 +402,9 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         subMesh=mesh.buildPartOfMySelf(tab2[0:3],True);
         self.assertTrue(isinstance(subMesh,MEDCouplingUMesh));
         name=subMesh.getName();
-        self.assertEqual(2,len(subMesh.getAllTypes()));
-        self.assertEqual(NORM_TRI3,subMesh.getAllTypes()[0]);
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[1]);
+        self.assertEqual(2,len(subMesh.getAllGeoTypes()));
+        self.assertEqual(NORM_TRI3,subMesh.getAllGeoTypes()[0]);
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[1]);
         self.assertEqual(name,"Toto");
         self.assertEqual(3,subMesh.getNumberOfCells());
         subConn2=[4,0,3,4,1,3,4,5,2,4,6,7,4,3]
@@ -426,8 +426,8 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         tab1=[5,7,8,4]
         subMesh=mesh.buildPartOfMySelfNode(tab1[0:4],True);
         self.assertTrue(isinstance(subMesh,MEDCouplingUMesh))
-        self.assertEqual(1,len(subMesh.getAllTypes()));
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[0]);
+        self.assertEqual(1,len(subMesh.getAllGeoTypes()));
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[0]);
         self.assertEqual(1,subMesh.getNumberOfCells());
         self.assertEqual(5,subMesh.getNodalConnectivity().getNbOfElems());
         self.assertEqual(2,subMesh.getNodalConnectivityIndex().getNbOfElems());
@@ -442,9 +442,9 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         subMesh=mesh.buildPartOfMySelfNode(ddd,False);
         self.assertEqual("ddd",subMesh.getName())
         self.assertTrue(isinstance(subMesh,MEDCouplingUMesh))
-        self.assertEqual(2,len(subMesh.getAllTypes()));
-        self.assertEqual(NORM_TRI3,subMesh.getAllTypes()[0]);
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[1]);
+        self.assertEqual(2,len(subMesh.getAllGeoTypes()));
+        self.assertEqual(NORM_TRI3,subMesh.getAllGeoTypes()[0]);
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[1]);
         self.assertEqual(3,subMesh.getNumberOfCells());
         self.assertEqual(14,subMesh.getNodalConnectivity().getNbOfElems());
         self.assertEqual(4,subMesh.getNodalConnectivityIndex().getNbOfElems());
@@ -456,15 +456,15 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         tab2=[0,3,2,1,4,5,6]
         subMesh=mesh.buildPartOfMySelfNode(tab2[0:7],True);
         self.assertTrue(isinstance(subMesh,MEDCouplingUMesh))
-        self.assertEqual(2,len(subMesh.getAllTypes()));
-        self.assertEqual(NORM_TRI3,subMesh.getAllTypes()[0]);
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[1]);
+        self.assertEqual(2,len(subMesh.getAllGeoTypes()));
+        self.assertEqual(NORM_TRI3,subMesh.getAllGeoTypes()[0]);
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[1]);
         self.assertEqual(3,subMesh.getNumberOfCells());
         pass
     
     def testZipCoords(self):
         mesh=MEDCouplingDataForTest.build2DTargetMesh_1();
-        self.assertEqual(2,len(mesh.getAllTypes()));
+        self.assertEqual(2,len(mesh.getAllGeoTypes()));
         self.assertEqual(2,mesh.getSpaceDimension());
         self.assertEqual(9,mesh.getNumberOfNodes());
         self.assertEqual(5,mesh.getNumberOfCells());
@@ -472,7 +472,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         oldConnIndex=mesh.getNodalConnectivityIndex().getValues()[0:mesh.getNumberOfCells()+1]
         oldCoords=mesh.getCoords();
         mesh.zipCoords();
-        self.assertEqual(2,len(mesh.getAllTypes()));
+        self.assertEqual(2,len(mesh.getAllGeoTypes()));
         self.assertEqual(2,mesh.getSpaceDimension());
         self.assertEqual(9,mesh.getNumberOfNodes());
         self.assertEqual(5,mesh.getNumberOfCells());
@@ -486,7 +486,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         traducer=subMesh.zipCoordsTraducer();
         expectedTraducer=[0, 1, -1, 2, 3, 4, -1, 5, 6]
         self.assertEqual(expectedTraducer,list(traducer.getValues()));
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[0]);
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[0]);
         self.assertEqual(2,subMesh.getNumberOfCells());
         subConn=[4,0,2,3,1,4,5,6,4,3]
         subConnIndex=[0,5,10]
@@ -498,7 +498,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         #
         subMesh=mesh.buildPartOfMySelf(tab1,False);
         self.assertTrue(isinstance(subMesh,MEDCouplingUMesh))
-        self.assertEqual(NORM_QUAD4,subMesh.getAllTypes()[0]);
+        self.assertEqual(NORM_QUAD4,subMesh.getAllGeoTypes()[0]);
         self.assertEqual(2,subMesh.getNumberOfCells());
         self.assertEqual(7,subMesh.getNumberOfNodes());
         self.assertEqual(10,subMesh.getNodalConnectivity().getNbOfElems());
@@ -2619,7 +2619,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
     def testConvertQuadraticCellsToLinear(self):
         mesh=MEDCouplingDataForTest.build2DTargetMesh_3();
         mesh.checkCoherency();
-        types=mesh.getAllTypes();
+        types=mesh.getAllGeoTypes();
         types.sort()
         self.assertEqual(5,len(types));
         expected1=[NORM_POLYGON, NORM_TRI3, NORM_QUAD4, NORM_TRI6, NORM_QUAD8]
@@ -2636,7 +2636,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         f2=mesh.getMeasureField(False);
         self.assertTrue(f1.getArray().isEqual(f2.getArray(),1e-12));
         self.assertEqual(48,mesh.getMeshLength());
-        types2=mesh.getAllTypes();
+        types2=mesh.getAllGeoTypes();
         types2.sort()
         self.assertEqual(3,len(types2));
         expected2=[NORM_POLYGON, NORM_TRI3, NORM_QUAD4]
@@ -5195,7 +5195,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         for i in xrange(7):
             self.assertAlmostEqual(expected1[i]*sqrt(2.),f.getIJ(i,0),10);
             pass
-        types=m.getAllTypes();
+        types=m.getAllGeoTypes();
         self.assertEqual([NORM_TRI3,NORM_POLYGON],types);
         #
         m=MEDCouplingDataForTest.build3DSurfTargetMesh_1();
@@ -5207,7 +5207,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
             self.assertEqual(expected2[i],da.getIJ(i,0));
             pass
         m.checkCoherency();
-        types=m.getAllTypes();
+        types=m.getAllGeoTypes();
         self.assertEqual([NORM_TRI3,NORM_POLYGON],types);
         self.assertEqual(7,m.getNumberOfCells());
         self.assertEqual(NORM_TRI3,m.getTypeOfCell(0));
@@ -6630,7 +6630,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertEqual(4,m.getNumberOfCells());
         self.assertEqual(3,m.getSpaceDimension());
         self.assertEqual(0,m.getMeshDimension());
-        types1=m.getAllTypes();
+        types1=m.getAllGeoTypes();
         self.assertEqual([NORM_POINT1],types1);
         for i in xrange(4):
             conn=m.getNodeIdsOfCell(i);
@@ -10150,14 +10150,14 @@ class MEDCouplingBasicsTest(unittest.TestCase):
     def testUMeshSetPartOfMySelf2(self):
         # resize with explicit ids list
         m=MEDCouplingDataForTest.build2DTargetMesh_1()
-        self.assertEqual([3,4],m.getAllTypes())
+        self.assertEqual([3,4],m.getAllGeoTypes())
         part=m[[0,3,4]]
         part.simplexize(0)
         part2=part[[1,2,5]]
         m[[0,3,4]]=part2
         self.assertEqual([3,0,4,1,3,1,4,2,3,4,5,2,3,6,7,4,3,7,5,4],m.getNodalConnectivity().getValues())
         self.assertEqual([0,4,8,12,16,20],m.getNodalConnectivityIndex().getValues())
-        self.assertEqual([3],m.getAllTypes())
+        self.assertEqual([3],m.getAllGeoTypes())
         # no resize with explicit ids list
         m=MEDCouplingDataForTest.build2DTargetMesh_1()
         part=m[[0,3]]
@@ -10165,14 +10165,14 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         m[[3,4]]=part
         self.assertEqual([4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3],m.getNodalConnectivity().getValues())
         self.assertEqual([0,5,9,13,18,23],m.getNodalConnectivityIndex().getValues())
-        self.assertEqual([3,4,5],m.getAllTypes())
+        self.assertEqual([3,4,5],m.getAllGeoTypes())
         # resize with range ids
         m=MEDCouplingDataForTest.build2DTargetMesh_1()
         part=m[3:]
         m[1:3]=part
         self.assertEqual([4,0,3,4,1,4,6,7,4,3,4,7,8,5,4,4,6,7,4,3,4,7,8,5,4],m.getNodalConnectivity().getValues())
         self.assertEqual([0,5,10,15,20,25],m.getNodalConnectivityIndex().getValues())
-        self.assertEqual([4],m.getAllTypes())
+        self.assertEqual([4],m.getAllGeoTypes())
         # no resize with range ids
         m=MEDCouplingDataForTest.build2DTargetMesh_1()
         part=m[0::3]
@@ -10180,7 +10180,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         m[3:]=part
         self.assertEqual([4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3],m.getNodalConnectivity().getValues())
         self.assertEqual([0,5,9,13,18,23],m.getNodalConnectivityIndex().getValues())
-        self.assertEqual([3,4,5],m.getAllTypes())
+        self.assertEqual([3,4,5],m.getAllGeoTypes())
         # no resize with range ids negative direction
         m=MEDCouplingDataForTest.build2DTargetMesh_1()
         part=m[3::-3]
@@ -10188,7 +10188,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         m[:-3:-1]=part
         self.assertEqual([4,0,3,4,1,3,1,4,2,3,4,5,2,5,0,3,4,1,5,6,7,4,3],m.getNodalConnectivity().getValues())
         self.assertEqual([0,5,9,13,18,23],m.getNodalConnectivityIndex().getValues())
-        self.assertEqual([3,4,5],m.getAllTypes())
+        self.assertEqual([3,4,5],m.getAllGeoTypes())
         pass
 
     def testUnPolyze3(self):
@@ -10208,7 +10208,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         #
         m.unPolyze();
         #
-        self.assertEqual([NORM_PENTA6],m.getAllTypes())
+        self.assertEqual([NORM_PENTA6],m.getAllGeoTypes())
         self.assertTrue(DataArrayInt([0,7]).isEqual(m.getNodalConnectivityIndex()))
         self.assertTrue(DataArrayInt([16,0,2,1,3,5,4]).isEqual(m.getNodalConnectivity()))
         #
@@ -11046,9 +11046,13 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         m=MEDCouplingUMesh("toto",3)
         m.allocateCells(0)
         m.insertNextCell(NORM_TETRA4,[0,1,2,3])
+        self.assertEqual([NORM_TETRA4],m.getAllGeoTypesSorted())
         m.insertNextCell(NORM_HEXA8,[4,5,6,7,8,9,10,11])
+        self.assertEqual([NORM_TETRA4,NORM_HEXA8],m.getAllGeoTypesSorted())
         m.insertNextCell(NORM_HEXA8,[12,13,14,15,16,17,18,19])
+        self.assertEqual([NORM_TETRA4,NORM_HEXA8],m.getAllGeoTypesSorted())
         m.insertNextCell(NORM_TETRA4,[20,21,22,23])
+        self.assertEqual([NORM_TETRA4,NORM_HEXA8,NORM_TETRA4],m.getAllGeoTypesSorted())
         c1=DataArrayDouble([0.,0.,0.,0.,1.,0.,1.,0.,0.,0.,0.,1.],4,3)
         c2=DataArrayDouble([0.,0.,0.,0.,1.,0.,1.,1.,0.,1.,0.,0., 0.,0.,1.,0.,1.,1.,1.,1.,1.,1.,0.,1.],8,3) ; c2+=[2.,0.,0.]
         c3=c2+[2.,0.,0.]
@@ -11884,7 +11888,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         m.getNodalConnectivity().setIJ(87,0,21)# put again 21 as at the beginning
         #
         self.assertTrue(m.unPolyze())
-        self.assertEqual([NORM_HEXGP12],m.getAllTypes())
+        self.assertEqual([NORM_HEXGP12],m.getAllGeoTypes())
         self.assertTrue(m.computeIsoBarycenterOfNodesPerCell().isEqual(dReference,1e-12))
         m.getNodalConnectivity().setIJ(25,0,24)
         self.assertRaises(InterpKernelException,m.computeIsoBarycenterOfNodesPerCell)
@@ -13334,7 +13338,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertTrue(isinstance(mcpy0,MEDCouplingUMesh))
         self.assertTrue(mcpy0.getNodalConnectivity().isEqual(DataArrayInt([31,3,2,8,9,31,1,0,6,7,-1,7,6,1,31,2,1,7,8,-1,2,1,-1,8,-1,7,31,5,4,10,11,-1,11,10,-1,5,31,4,3,9,10,-1,5,3,9])))
         self.assertTrue(mcpy0.getNodalConnectivityIndex().isEqual(DataArrayInt([0,5,14,26,36,45])))
-        self.assertEqual(mcpy0.getAllTypes(),[NORM_POLYHED])
+        self.assertEqual(mcpy0.getAllGeoTypes(),[NORM_POLYHED])
         mcpy0.checkCoherency()
         mcpy0.checkCoherency2()
         mcpy1=mcpy0.convertIntoSingleGeoTypeMesh()
@@ -13996,6 +14000,45 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertEqual([3,12,5,6,14,16,23,100,23,1,0,6],d0i.getValues())
         pass
 
+    def testSwig2GetCellsContainingPointsForNonConvexPolygon1(self):
+        coo=DataArrayDouble([-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,0.,-0.5,0.,0.,0.5,0.,],7,2)
+        m=MEDCouplingUMesh("Intersect2D",2) ; m.setCoords(coo) ; m.allocateCells()
+        m.insertNextCell(NORM_POLYGON,[6,3,4,5])
+        m.insertNextCell(NORM_POLYGON,[4,0,1,2,6,5])
+        m.checkCoherency2()
+        #
+        self.assertTrue(m.getCellsContainingPoint((0.4,-0.4),1e-12).isEqual(DataArrayInt([0])))
+        self.assertTrue(m.getCellsContainingPoint((-0.4,-0.4),1e-12).isEqual(DataArrayInt([1])))
+        self.assertTrue(m.getCellsContainingPoint((0.,-0.4),1e-12).isEqual(DataArrayInt([0,1])))
+        pass
+    
+    def testSwig2GetCellsContainingPointsForNonConvexPolygon2(self):
+        coo=DataArrayDouble([-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5,-0.5,-2.0816681711721685e-17,-2.0816681711721685e-17,-0.17677669529663687,0.1767766952966369,0.,0.5,0.5,0.,0.17677669529663684,-0.17677669529663692,0.17677669529663692,0.17677669529663684,-0.17677669529663692,-0.17677669529663687,0.,-0.5,-0.5,0.,0.33838834764831843,-0.3383883476483185,-0.33838834764831843,0.33838834764831843,-0.21213203435596423,0.21213203435596426,0.2121320343559642,-0.2121320343559643,0.21213203435596426,0.2121320343559642,-0.21213203435596423,-0.21213203435596428,0.3560660171779821,-0.35606601717798214,-0.35606601717798214,0.35606601717798214,0.19445436482630052,-0.19445436482630063,-0.19445436482630055,0.19445436482630057,0.,0.27],24,2)
+        m=MEDCouplingUMesh("mesh",2) ; m.setCoords(coo) ; m.allocateCells()
+        m.insertNextCell(NORM_QPOLYG,[8,5,4,9])
+        m.insertNextCell(NORM_QPOLYG,[5,8,4,10])
+        m.insertNextCell(NORM_QPOLYG,[16,8,5,15,21,9,22,17])
+        m.insertNextCell(NORM_QPOLYG,[15,1,2,3,16,20,6,7,19,17])
+        m.insertNextCell(NORM_QPOLYG,[15,5,8,16,22,10,21,18])
+        m.insertNextCell(NORM_QPOLYG,[16,3,0,1,15,19,11,12,20,18])
+        m.checkCoherency2()
+        self.assertTrue(m.getCellsContainingPoint([0.,0.27],1e-12).isEqual(DataArrayInt([2])))
+        pass
+
+    def testSwig2DAIGetIdsEqualTuple1(self):
+        da=DataArrayInt([0,7,1,2,4,1,2,1,1,2,0,1,2,1,5,1,1,2],9,2)
+        self.assertTrue(da.getIdsEqualTuple([1,2]).isEqual(DataArrayInt([1,4,8])))
+        self.assertTrue(da.getIdsEqualTuple((1,2)).isEqual(DataArrayInt([1,4,8])))
+        self.assertTrue(da.getIdsEqualTuple(DataArrayInt([1,2])).isEqual(DataArrayInt([1,4,8])))
+        da.rearrange(3)
+        self.assertRaises(InterpKernelException,da.getIdsEqualTuple,[1,2])# mismatch nb of compo (3) and nb of elts in input tuple (2)
+        self.assertTrue(da.getIdsEqualTuple([2,0,1]).isEqual(DataArrayInt([3])))
+        self.assertTrue(da.getIdsEqualTuple([2,0,7]).isEqual(DataArrayInt([])))
+        da.rearrange(1)
+        self.assertTrue(da.getIdsEqualTuple(2).isEqual(DataArrayInt([3,6,9,12,17])))
+        self.assertTrue(da.getIdsEqualTuple(2).isEqual(da.getIdsEqual(2)))
+        pass
+
     def setUp(self):
         pass
     pass
index 4362b1c8a9a33e320c403e25fcac2f600efe4a37..9845712543dc131491904492896d70440473d09d 100644 (file)
@@ -267,6 +267,8 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::MEDCouplingUMesh::ComputeRangesFromTypeDistribution;
 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf2DMesh;
 %newobject ParaMEDMEM::MEDCouplingUMesh::buildUnionOf3DMesh;
+%newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTreeFast;
+%newobject ParaMEDMEM::MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic;
 %newobject ParaMEDMEM::MEDCouplingUMeshCellByTypeEntry::__iter__;
 %newobject ParaMEDMEM::MEDCouplingUMeshCellEntry::__iter__;
 %newobject ParaMEDMEM::MEDCoupling1GTUMesh::New;
@@ -917,7 +919,7 @@ namespace ParaMEDMEM
       virtual void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const throw(INTERP_KERNEL::Exception);
       virtual MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
-      virtual DataArrayDouble *getBoundingBoxForBBTree() const throw(INTERP_KERNEL::Exception);
+      virtual DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
       %extend 
          {
            std::string __str__() const throw(INTERP_KERNEL::Exception)
@@ -1534,6 +1536,8 @@ namespace ParaMEDMEM
     DataArrayInt *convertNodalConnectivityToStaticGeoTypeMesh() const throw(INTERP_KERNEL::Exception);
     DataArrayInt *buildUnionOf2DMesh() const throw(INTERP_KERNEL::Exception);
     DataArrayInt *buildUnionOf3DMesh() const throw(INTERP_KERNEL::Exception);
+    DataArrayDouble *getBoundingBoxForBBTreeFast() const throw(INTERP_KERNEL::Exception);
+    DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const throw(INTERP_KERNEL::Exception);
     static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da) throw(INTERP_KERNEL::Exception);
     static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
     static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception);
@@ -1566,6 +1570,16 @@ namespace ParaMEDMEM
       {
         return self->cellIterator();
       }
+
+      PyObject *getAllGeoTypesSorted() const throw(INTERP_KERNEL::Exception)
+      {
+        std::vector<INTERP_KERNEL::NormalizedCellType> result=self->getAllGeoTypesSorted();
+        std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
+        PyObject *res=PyList_New(result.size());
+        for(int i=0;iL!=result.end(); i++, iL++)
+          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+        return res;
+      }
       
       void setPartOfMySelf(PyObject *li, const MEDCouplingUMesh& otherOnSameCoordsThanThis) throw(INTERP_KERNEL::Exception)
       {
@@ -1723,15 +1737,6 @@ namespace ParaMEDMEM
           ret->incrRef();
         return ret;
       }
-      PyObject *getAllTypes() const throw(INTERP_KERNEL::Exception)
-      {
-        std::set<INTERP_KERNEL::NormalizedCellType> result=self->getAllTypes();
-        std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
-        PyObject *res = PyList_New(result.size());
-        for (int i=0;iL!=result.end(); i++, iL++)
-          PyList_SetItem(res,i,PyInt_FromLong(*iL));
-        return res;
-      }
       
       static PyObject *ComputeSpreadZoneGraduallyFromSeed(PyObject *seed, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling=-1) throw(INTERP_KERNEL::Exception)
       {
index 248cd2028a8f30c6144be5c9af2d4e04634d1e23..d664d08944f865fd35caa312b85337ce675987e0 100644 (file)
@@ -67,6 +67,7 @@
 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqual;
 %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList;
 %newobject ParaMEDMEM::DataArrayInt::getIdsNotEqualList;
+%newobject ParaMEDMEM::DataArrayInt::getIdsEqualTuple;
 %newobject ParaMEDMEM::DataArrayInt::sumPerTuple;
 %newobject ParaMEDMEM::DataArrayInt::negate;
 %newobject ParaMEDMEM::DataArrayInt::computeAbs;
@@ -2753,6 +2754,14 @@ namespace ParaMEDMEM
         return self->accumulatePerChunck(bg,bg+sz);
       }
 
+      DataArrayInt *getIdsEqualTuple(PyObject *inputTuple) const throw(INTERP_KERNEL::Exception)
+      {
+        int sw,sz,val;
+        std::vector<int> val2;
+        const int *bg(convertObjToPossibleCpp1_Safe(inputTuple,sw,sz,val,val2));
+        return self->getIdsEqualTuple(bg,bg+sz);
+      }
+
       PyObject *splitInBalancedSlices(int nbOfSlices) const throw(INTERP_KERNEL::Exception)
       {
         std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
index d14c0679daed1840acb55e4c41ecc7fc99155cdb..e1c36448f207a262403b5a7e6ccc12daa7737220 100644 (file)
@@ -29,6 +29,7 @@
 MEDGUIDataBaseDockWidget::MEDGUIDataBaseDockWidget(CAM_Application *app, QWidget * parent):QDockWidget(parent),_app(app)
 {
   setWindowTitle("MEDUtils DataBase");
+  setObjectName("MEDUtils DataBase");
   setMinimumWidth(270);
   setMinimumHeight(300);
   QWidget *content = new QWidget;
index f869a536dcacb9564b4eb1edbfa690c5d9dadb1b..4844a1c8436fd7195865356285f8098ba6f92efe 100644 (file)
@@ -9,19 +9,19 @@
     </message>
     <message>
       <source>MED_INF_FIELDNAME</source>
-      <translation>読ã\81¿å\8f\96ã\82\8aã\81\99ã\82\8bã\83\95ã\82£ã\83¼ã\83«ã\83\89ã\81®å\90\8då\89\8dã\82\92æ\8c\87å®\9aã\81\97ã\81¦ä¸\8bã\81\95ã\81\84</translation>
+      <translation>読ã\81¿å\8f\96ã\82\8bã\83\95ã\82£ã\83¼ã\83«ã\83\89ã\81®å\90\8då\89\8dã\82\92å\85¥å\8a\9bã\81\97ã\81¦ã\81\8fã\81 ã\81\95ã\81\84ã\80\82</translation>
     </message>
     <message>
       <source>MED_INF_MESHNAME</source>
-      <translation>読み取りするメッシュの名前を指定して下さい</translation>
+      <translation>読みたいメッシュの名前を入力してください。</translation>
     </message>
     <message>
       <source>MED_INF_NOIOR</source>
-      <translation>オブジェクトは、IOR を持たない</translation>
+      <translation>Object has no IOR</translation>
     </message>
     <message>
       <source>MED_INF_NOTIMPL</source>
-      <translation>このオブジェクトは実装されない</translation>
+      <translation>Not Implemented for this Object</translation>
     </message>
     <message>
       <source>MED_WRN_WARNING</source>
     </message>
     <message>
       <source>MEN_DUMPMESH</source>
-      <translation>メッシュリスト</translation>
+      <translation>Dump Mesh</translation>
     </message>
     <message>
       <source>MEN_DUMPSUBMESH</source>
-      <translation>サブメッシュリスト</translation>
+      <translation>Dump SubMesh</translation>
     </message>
     <message>
       <source>MEN_HIDE</source>
@@ -45,7 +45,7 @@
     </message>
     <message>
       <source>MEN_EXPLORE</source>
-      <translation>MED ファイルを探索</translation>
+      <translation>Explore Med File</translation>
     </message>
     <message>
       <source>MEN_FIELDSEL</source>
@@ -57,7 +57,7 @@
     </message>
     <message>
       <source>MEN_POPUPTEST</source>
-      <translation>ポップアップテスト</translation>
+      <translation>Popup Test</translation>
     </message>
     <message>
       <source>STB_SHOW</source>
     </message>
     <message>
       <source>STB_DUMPMESH</source>
-      <translation>メッシュリスト</translation>
+      <translation>dump Mesh</translation>
     </message>
     <message>
       <source>STB_DUMPSUBMESH</source>
-      <translation>メッシュリスト</translation>
+      <translation>dump Mesh</translation>
     </message>
     <message>
       <source>STB_HIDE</source>
-      <translation>非表示</translation>
+      <translation>Hide</translation>
     </message>
     <message>
       <source>STB_EXPLORE</source>
-      <translation>MED ファイルを探索</translation>
+      <translation>Explore Med File</translation>
     </message>
     <message>
       <source>STB_FIELDSEL</source>
-      <translation>フィールドを読み取り</translation>
+      <translation>Read a field</translation>
     </message>
     <message>
       <source>STB_MESHSEL</source>
-      <translation>メッシュ読み込み</translation>
+      <translation>Read a mesh</translation>
     </message>
     <message>
       <source>STB_POPUPTEST</source>
-      <translation>ポップアップテスト</translation>
+      <translation>Popup test</translation>
     </message>
     <message>
       <source>TB_MED</source>
     </message>
     <message>
       <source>TOP_DUMPMESH</source>
-      <translation>メッシュリスト</translation>
+      <translation>Dump Mesh</translation>
     </message>
     <message>
       <source>TOP_DUMPSUBMESH</source>
-      <translation>サブメッシュリスト</translation>
+      <translation>Dump SubMesh</translation>
     </message>
     <message>
       <source>TOP_HIDE</source>
     </message>
     <message>
       <source>TOP_EXPLORE</source>
-      <translation>MED ファイルを探索</translation>
+      <translation>Explore Med File</translation>
     </message>
     <message>
       <source>TOP_FIELDSEL</source>
     </message>
     <message>
       <source>TOP_MESHSEL</source>
-      <translation>メッシュの選択</translation>
+      <translation>Mesh selection</translation>
     </message>
     <message>
       <source>TOP_POPUPTEST</source>
-      <translation>ポップアップテスト</translation>
+      <translation>Popup test</translation>
     </message>
   </context>
 </TS>
index 278c7168fa0fbbb9ebf304a03ef5f744eadb230d..b68147e4b6a5395066f665ef6f0a2489d3f59e5a 100644 (file)
@@ -4137,6 +4137,8 @@ void MEDFileAnyTypeField1TSWithoutSDA::updateData(int newLgth, const std::vector
         throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::updateData : internal error 1 !");
       MEDCouplingAutoRefCountObjectPtr<DataArray> newArr=createNewEmptyDataArrayInstance();
       newArr->alloc(newLgth,getNumberOfComponents());
+      if(oldArr)
+        newArr->copyStringInfoFrom(*oldArr);
       int pos=0;
       for(std::vector< std::pair<int,int> >::const_iterator it=oldStartStops.begin();it!=oldStartStops.end();it++)
         {
index 0ff3e041bd3d67831ba122ee5bbb0d90018216f2..3da4614aa518e102b4375c84be465bfcd1a75b6e 100644 (file)
@@ -50,26 +50,27 @@ namespace ParaMEDMEM
   class MEDFileFieldLoc : public RefCountObject
   {
   public:
-    void MEDLOADER_EXPORT simpleRepr(std::ostream& oss) const;
-    std::string MEDLOADER_EXPORT getName() const { return _name; }
-    void MEDLOADER_EXPORT setName(const char *name);
+    MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const;
+    MEDLOADER_EXPORT std::string getName() const { return _name; }
+    MEDLOADER_EXPORT void setName(const char *name);
     static MEDFileFieldLoc *New(med_idt fid, const char *locName);
     static MEDFileFieldLoc *New(med_idt fid, int id);
     static MEDFileFieldLoc *New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
     std::size_t getHeapMemorySizeWithoutChildren() const;
     std::vector<const BigMemoryObject *> getDirectChildren() const;
     MEDFileFieldLoc *deepCpy() const;
-    int MEDLOADER_EXPORT getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
-    void MEDLOADER_EXPORT writeLL(med_idt fid) const;
-    std::string MEDLOADER_EXPORT repr() const;
-    bool MEDLOADER_EXPORT isName(const char *name) const { return _name==name; }
-    int MEDLOADER_EXPORT getDimension() const { return _dim; }
-    int MEDLOADER_EXPORT getNumberOfGaussPoints() const { return _nb_gauss_pt; }
-    int MEDLOADER_EXPORT getNumberOfPointsInCells() const { return _nb_node_per_cell; }
-    const MEDLOADER_EXPORT std::vector<double>& getRefCoords() const { return _ref_coo; }
-    const MEDLOADER_EXPORT std::vector<double>& getGaussCoords() const { return _gs_coo; }
-    const MEDLOADER_EXPORT std::vector<double>& getGaussWeights() const { return _w; }
-    bool MEDLOADER_EXPORT isEqual(const MEDFileFieldLoc& other, double eps) const;
+    MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
+    MEDLOADER_EXPORT void writeLL(med_idt fid) const;
+    MEDLOADER_EXPORT std::string repr() const;
+    MEDLOADER_EXPORT bool isName(const char *name) const { return _name==name; }
+    MEDLOADER_EXPORT int getDimension() const { return _dim; }
+    MEDLOADER_EXPORT int getNumberOfGaussPoints() const { return _nb_gauss_pt; }
+    MEDLOADER_EXPORT int getNumberOfPointsInCells() const { return _nb_node_per_cell; }
+    MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
+    MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
+    MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
+    MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _geo_type; }
+    MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
   private:
     MEDFileFieldLoc(med_idt fid, const char *locName);
     MEDFileFieldLoc(med_idt fid, int id);
index c9c047ef69d32ead4d6d94cc445b32765b145b05..6d9da01659b9e4b58c16256c919c359ce413e8d4 100644 (file)
@@ -27,7 +27,7 @@
 using namespace ParaMEDMEM;
 
 const unsigned char MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE[MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH]=
-  {1,3,21,5,9,7,22,34,23,28,255,255,255,255,10,14,13,255,12,255,24,255,16,27,255,26,255,29,255,255,25,42,255,4};
+  {1,3,21,5,9,7,22,34,23,28,255,255,255,255,10,14,13,255,12,255,24,255,16,27,255,26,255,29,255,255,25,42,36,4};
 
 const char MEDFileField1TSStructItem2::NEWLY_CREATED_PFL_NAME[]="???";
 
@@ -206,6 +206,168 @@ DataArray *MEDMeshMultiLev::buildDataArray(const MEDFileField1TSStructItem& fst,
     return constructDataArray(fst,globs,vals);
 }
 
+/*!
+ * \param [out] famIds - Can be null. If not null the instance has to be dealt by the caller (decrRef).
+ * \param [out] isWithoutCopy - When true the returned instance \a famIds if not null is directly those in the data structure.
+ */
+void MEDMeshMultiLev::retrieveFamilyIdsOnCells(DataArrayInt *& famIds, bool& isWithoutCopy) const
+{
+  const DataArrayInt *fids(_cell_fam_ids);
+  if(!fids)
+    { famIds=0; isWithoutCopy=true; return ; }
+  std::size_t sz(_geo_types.size());
+  bool presenceOfPfls(false);
+  for(std::size_t i=0;i<sz && !presenceOfPfls;i++)
+    {
+      const DataArrayInt *pfl(_pfls[i]);
+      if(pfl)
+        presenceOfPfls=true;
+    }
+  if(!presenceOfPfls)
+    { famIds=const_cast<DataArrayInt *>(fids); famIds->incrRef(); isWithoutCopy=_cell_fam_ids_nocpy; return ; }
+  //bad luck the slowest part
+  isWithoutCopy=false;
+  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > retSafe(sz);
+  std::vector< const DataArrayInt *> ret(sz);
+  int start(0);
+  for(std::size_t i=0;i<sz;i++)
+    {
+      const DataArrayInt *pfl(_pfls[i]);
+      int lgth(_nb_entities[i]);
+      if(pfl)
+        {
+          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(fids->selectByTupleId2(start,start+lgth,1));
+          retSafe[i]=tmp->selectByTupleIdSafe(pfl->begin(),pfl->end());
+        }
+      else
+        {
+          retSafe[i]=fids->selectByTupleId2(start,start+lgth,1);
+        }
+      ret[i]=retSafe[i];
+      start+=lgth;
+    }
+  famIds=DataArrayInt::Aggregate(ret);
+}
+
+/*!
+ * \param [out] numIds - Can be null. If not null the instance has to be dealt by the caller (decrRef).
+ * \param [out] isWithoutCopy - When true the returned instance \a numIds if not null is directly those in the data structure.
+ */
+void MEDMeshMultiLev::retrieveNumberIdsOnCells(DataArrayInt *& numIds, bool& isWithoutCopy) const
+{
+  const DataArrayInt *nids(_cell_num_ids);
+  if(!nids)
+    { numIds=0; isWithoutCopy=true; return ; }
+  std::size_t sz(_geo_types.size());
+  bool presenceOfPfls(false);
+  for(std::size_t i=0;i<sz && !presenceOfPfls;i++)
+    {
+      const DataArrayInt *pfl(_pfls[i]);
+      if(pfl)
+        presenceOfPfls=true;
+    }
+  if(!presenceOfPfls)
+    { numIds=const_cast<DataArrayInt *>(nids); numIds->incrRef(); isWithoutCopy=_cell_num_ids_nocpy; return ; }
+  //bad luck the slowest part
+  isWithoutCopy=false;
+  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > retSafe(sz);
+  std::vector< const DataArrayInt *> ret(sz);
+  int start(0);
+  for(std::size_t i=0;i<sz;i++)
+    {
+      const DataArrayInt *pfl(_pfls[i]);
+      int lgth(_nb_entities[i]);
+      if(pfl)
+        {
+          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(nids->selectByTupleId2(start,start+lgth,1));
+          retSafe[i]=tmp->selectByTupleIdSafe(pfl->begin(),pfl->end());
+        }
+      else
+        {
+          retSafe[i]=nids->selectByTupleId2(start,start+lgth,1);
+        }
+      ret[i]=retSafe[i];
+      start+=lgth;
+    }
+  numIds=DataArrayInt::Aggregate(ret);
+}
+
+/*!
+ * \param [out] famIds - Can be null. If not null the instance has to be dealt by the caller (decrRef).
+ * \param [out] isWithoutCopy - When true the returned instance \a famIds if not null is directly those in the data structure.
+ */
+void MEDMeshMultiLev::retrieveFamilyIdsOnNodes(DataArrayInt *& famIds, bool& isWithoutCopy) const
+{
+  const DataArrayInt *fids(_node_fam_ids);
+  if(!fids)
+    { famIds=0; isWithoutCopy=true; return ; }
+  const DataArrayInt *nr(_node_reduction);
+  if(nr)
+    {
+      isWithoutCopy=false;
+      famIds=fids->selectByTupleIdSafe(nr->begin(),nr->end());
+    }
+  else
+    {
+      isWithoutCopy=_node_fam_ids_nocpy;
+      famIds=const_cast<DataArrayInt *>(fids); famIds->incrRef();
+    }
+}
+
+/*!
+ * \param [out] numIds - Can be null. If not null the instance has to be dealt by the caller (decrRef).
+ * \param [out] isWithoutCopy - When true the returned instance \a numIds if not null is directly those in the data structure.
+ */
+void MEDMeshMultiLev::retrieveNumberIdsOnNodes(DataArrayInt *& numIds, bool& isWithoutCopy) const
+{
+  const DataArrayInt *fids(_node_num_ids);
+  if(!fids)
+    { numIds=0; isWithoutCopy=true; return ; }
+  const DataArrayInt *nr(_node_reduction);
+  if(nr)
+    {
+      isWithoutCopy=false;
+      numIds=fids->selectByTupleIdSafe(nr->begin(),nr->end());
+    }
+  else
+    {
+      isWithoutCopy=_node_num_ids_nocpy;
+      numIds=const_cast<DataArrayInt *>(fids); numIds->incrRef();
+    }
+}
+
+void MEDMeshMultiLev::setFamilyIdsOnCells(DataArrayInt *famIds, bool isNoCopy)
+{
+  _cell_fam_ids=famIds;
+  if(famIds)
+    famIds->incrRef();
+  _cell_fam_ids_nocpy=isNoCopy;
+}
+
+void MEDMeshMultiLev::setNumberIdsOnCells(DataArrayInt *numIds, bool isNoCopy)
+{
+  _cell_num_ids=numIds;
+  if(numIds)
+    numIds->incrRef();
+  _cell_num_ids_nocpy=isNoCopy;
+}
+
+void MEDMeshMultiLev::setFamilyIdsOnNodes(DataArrayInt *famIds, bool isNoCopy)
+{
+  _node_fam_ids=famIds;
+  if(famIds)
+    famIds->incrRef();
+  _node_fam_ids_nocpy=isNoCopy;
+}
+
+void MEDMeshMultiLev::setNumberIdsOnNodes(DataArrayInt *numIds, bool isNoCopy)
+{
+  _node_num_ids=numIds;
+  if(numIds)
+    numIds->incrRef();
+  _node_num_ids_nocpy=isNoCopy;
+}
+
 std::string MEDMeshMultiLev::getPflNameOfId(int id) const
 {
   std::size_t sz(_pfls.size());
@@ -382,11 +544,11 @@ DataArray *MEDMeshMultiLev::constructDataArray(const MEDFileField1TSStructItem&
     }
 }
 
-MEDMeshMultiLev::MEDMeshMultiLev()
+MEDMeshMultiLev::MEDMeshMultiLev():_nb_nodes(0),_cell_fam_ids_nocpy(false)
 {
 }
 
-MEDMeshMultiLev::MEDMeshMultiLev(int nbNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):_geo_types(gts),_nb_entities(nbEntities),_nb_nodes(nbNodes)
+MEDMeshMultiLev::MEDMeshMultiLev(int nbNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):_geo_types(gts),_nb_entities(nbEntities),_nb_nodes(nbNodes),_cell_fam_ids_nocpy(false),_cell_num_ids_nocpy(false),_node_fam_ids_nocpy(false),_node_num_ids_nocpy(false)
 {
   std::size_t sz(_geo_types.size());
   if(sz!=pfls.size() || sz!=nbEntities.size())
@@ -400,7 +562,7 @@ MEDMeshMultiLev::MEDMeshMultiLev(int nbNodes, const std::vector<INTERP_KERNEL::N
     }
 }
 
-MEDMeshMultiLev::MEDMeshMultiLev(const MEDMeshMultiLev& other):RefCountObject(other),_pfls(other._pfls),_geo_types(other._geo_types),_nb_entities(other._nb_entities),_node_reduction(other._node_reduction),_nb_nodes(other._nb_nodes)
+MEDMeshMultiLev::MEDMeshMultiLev(const MEDMeshMultiLev& other):RefCountObject(other),_pfls(other._pfls),_geo_types(other._geo_types),_nb_entities(other._nb_entities),_node_reduction(other._node_reduction),_nb_nodes(other._nb_nodes),_cell_fam_ids(other._cell_fam_ids),_cell_fam_ids_nocpy(other._cell_fam_ids_nocpy),_cell_num_ids(other._cell_num_ids),_cell_num_ids_nocpy(other._cell_num_ids_nocpy),_node_fam_ids(other._node_fam_ids),_node_fam_ids_nocpy(other._node_fam_ids_nocpy),_node_num_ids(other._node_num_ids),_node_num_ids_nocpy(other._node_num_ids_nocpy)
 {
 }
 
@@ -425,6 +587,7 @@ MEDUMeshMultiLev::MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<int>
   _parts.resize(sz);
   _pfls.resize(sz);
   _geo_types.resize(sz);
+  _nb_entities.resize(sz);
   for(std::size_t i=0;i<sz;i++)
     {
       MEDCoupling1GTUMesh *obj(v[i]);
@@ -434,7 +597,74 @@ MEDUMeshMultiLev::MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<int>
         throw INTERP_KERNEL::Exception("MEDUMeshMultiLev constructor : presence of a null pointer !");
       _parts[i]=obj;
       _geo_types[i]=obj->getCellModelEnum();
+      _nb_entities[i]=obj->getNumberOfCells();
+    }
+  // ids fields management
+  _cell_fam_ids_nocpy=(levs.size()==1);
+  if(_cell_fam_ids_nocpy)
+    {
+      const DataArrayInt *tmp(m->getFamilyFieldAtLevel(levs[0]));
+      if(tmp)
+        {
+          tmp->incrRef();
+          _cell_fam_ids=(const_cast<DataArrayInt *>(tmp));
+        }
+    }
+  else
+    {
+      std::vector<const DataArrayInt *> tmps(levs.size());
+      bool f(true);
+      for(std::size_t i=0;i<levs.size();i++)
+        {
+          tmps[i]=m->getFamilyFieldAtLevel(levs[i]);
+          if(!tmps[i])
+            f=false;
+        }
+      if(f)
+        _cell_fam_ids=DataArrayInt::Aggregate(tmps);
+    }
+  _cell_num_ids_nocpy=(levs.size()==1);
+  if(_cell_num_ids_nocpy)
+    {
+      const DataArrayInt *tmp(m->getNumberFieldAtLevel(levs[0]));
+      if(tmp)
+        {
+          tmp->incrRef();
+          _cell_num_ids=(const_cast<DataArrayInt *>(tmp));
+        }
+    }
+  else
+    {
+      std::vector<const DataArrayInt *> tmps(levs.size());
+      bool n(true);
+      for(std::size_t i=0;i<levs.size();i++)
+        {
+          tmps[i]=m->getNumberFieldAtLevel(levs[i]);
+          if(!tmps[i])
+            n=false;
+        }
+      if(n)
+        _cell_num_ids=DataArrayInt::Aggregate(tmps);
     }
+  // node part
+  _node_fam_ids_nocpy=true;
+  {
+    const DataArrayInt *tmp(m->getFamilyFieldAtLevel(1));
+    if(tmp)
+      {
+        tmp->incrRef();
+        _node_fam_ids=(const_cast<DataArrayInt *>(tmp));
+      }
+  }
+  _node_num_ids_nocpy=true;
+  {
+    const DataArrayInt *tmp(m->getNumberFieldAtLevel(1));
+    if(tmp)
+      {
+        tmp->incrRef();
+        _node_num_ids=(const_cast<DataArrayInt *>(tmp));
+      }
+  }
 }
 
 MEDUMeshMultiLev *MEDUMeshMultiLev::New(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities)
@@ -445,14 +675,80 @@ MEDUMeshMultiLev *MEDUMeshMultiLev::New(const MEDFileUMesh *m, const std::vector
 MEDUMeshMultiLev::MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(m->getNumberOfNodes(),gts,pfls,nbEntities)
 {
   std::size_t sz(gts.size());
+  if(sz<1)
+    throw INTERP_KERNEL::Exception("constructor of MEDUMeshMultiLev : number of different geo type must be >= 1 !");
+  unsigned dim(INTERP_KERNEL::CellModel::GetCellModel(gts[0]).getDimension());
   _parts.resize(sz);
+  bool isSameDim(true),isNoPfl(true);
   for(std::size_t i=0;i<sz;i++)
     {
       MEDCoupling1GTUMesh *elt(m->getDirectUndergroundSingleGeoTypeMesh(gts[i]));
+      if(INTERP_KERNEL::CellModel::GetCellModel(gts[i]).getDimension()!=dim)
+        isSameDim=false;
+      if(pfls[i])
+        isNoPfl=false;
       if(elt)
         elt->incrRef();
       _parts[i]=elt;
     }
+  // ids fields management
+  int lev((int)dim-m->getMeshDimension());
+  if(isSameDim && isNoPfl && m->getGeoTypesAtLevel(lev)==gts)//optimized part
+    {
+      _cell_fam_ids_nocpy=true;
+      const DataArrayInt *famIds(m->getFamilyFieldAtLevel(lev));
+      if(famIds)
+        { _cell_fam_ids=const_cast<DataArrayInt*>(famIds); famIds->incrRef(); }
+      _cell_num_ids_nocpy=true;
+      const DataArrayInt *numIds(m->getNumberFieldAtLevel(lev));
+      if(numIds)
+        { _cell_num_ids=const_cast<DataArrayInt*>(numIds); numIds->incrRef(); }
+      _node_fam_ids_nocpy=true;
+      famIds=m->getFamilyFieldAtLevel(1);
+      if(famIds)
+        { _node_fam_ids=const_cast<DataArrayInt*>(famIds); famIds->incrRef(); }
+      _node_num_ids_nocpy=true;
+      numIds=m->getNumberFieldAtLevel(1);
+      if(numIds)
+        { _node_num_ids=const_cast<DataArrayInt*>(numIds); numIds->incrRef(); }
+      return ;
+    }
+  //
+  _cell_fam_ids_nocpy=false;
+  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > famIdsSafe(sz);
+  std::vector<const DataArrayInt *> famIds(sz);
+  bool f(true);
+  for(std::size_t i=0;i<sz;i++)
+    {
+      famIdsSafe[i]=m->extractFamilyFieldOnGeoType(gts[i]);
+      famIds[i]=famIdsSafe[i];
+      if(!famIds[i])
+        f=false;
+    }
+  if(f)
+    _cell_fam_ids=DataArrayInt::Aggregate(famIds);
+  _cell_num_ids_nocpy=false;
+  std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > numIdsSafe(sz);
+  std::vector<const DataArrayInt *> numIds(sz);
+  bool n(true);
+  for(std::size_t i=0;i<sz;i++)
+    {
+      numIdsSafe[i]=m->extractNumberFieldOnGeoType(gts[i]);
+      numIds[i]=numIdsSafe[i];
+      if(!numIds[i])
+        n=false;
+    }
+  if(n)
+    _cell_num_ids=DataArrayInt::Aggregate(numIds);
+  // node ids management
+  _node_fam_ids_nocpy=true;
+  const DataArrayInt *nodeFamIds(m->getFamilyFieldAtLevel(1));
+  if(nodeFamIds)
+    { _node_fam_ids=const_cast<DataArrayInt*>(nodeFamIds); nodeFamIds->incrRef(); }
+  _node_num_ids_nocpy=true;
+  const DataArrayInt *nodeNumIds(m->getNumberFieldAtLevel(1));
+  if(nodeNumIds)
+    { _node_num_ids=const_cast<DataArrayInt*>(nodeNumIds); nodeNumIds->incrRef(); }
 }
 
 void MEDUMeshMultiLev::selectPartOfNodes(const DataArrayInt *pflNodes)
@@ -585,7 +881,7 @@ bool MEDUMeshMultiLev::buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *
             {
               *dPtr++=nnpc;
               dPtr=std::copy(connPtr,connPtr+nnpc,dPtr);
-              *cPtr=k+nnpc; k=*cPtr++;
+              *cPtr++=k; k+=nnpc+1;
             }
           if(isPolyh)
             { std::fill(ePtr,ePtr+curNbCells,-1); ePtr+=curNbCells; }
@@ -599,7 +895,7 @@ bool MEDUMeshMultiLev::buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *
                 {
                   *dPtr++=connIPtr[1]-connIPtr[0];
                   dPtr=std::copy(connPtr+connIPtr[0],connPtr+connIPtr[1],dPtr);
-                  *cPtr=k+connIPtr[1]-connIPtr[0]; k=*cPtr++;
+                  *cPtr++=k; k+=connIPtr[1]-connIPtr[0];
                 }
             }
           else
@@ -609,7 +905,7 @@ bool MEDUMeshMultiLev::buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *
                   std::set<int> s(connPtr+connIPtr[0],connPtr+connIPtr[1]); s.erase(-1);
                   *dPtr++=(int)s.size();
                   dPtr=std::copy(s.begin(),s.end(),dPtr);
-                  *cPtr=k+(int)s.size(); k=*cPtr++;
+                  *cPtr++=k; k+=(int)s.size()+1;
                 }
             }
           if(isPolyh)
@@ -733,8 +1029,72 @@ MEDStructuredMeshMultiLev::MEDStructuredMeshMultiLev()
 {
 }
 
-MEDStructuredMeshMultiLev::MEDStructuredMeshMultiLev(int nbOfNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(nbOfNodes,gts,pfls,nbEntities)
+MEDStructuredMeshMultiLev::MEDStructuredMeshMultiLev(const MEDFileStructuredMesh *m, const std::vector<int>& lev)
 {
+  // ids fields management
+  _cell_fam_ids_nocpy=true; _cell_num_ids_nocpy=true;
+  const DataArrayInt *tmp(0);
+  tmp=m->getFamilyFieldAtLevel(0);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _cell_fam_ids=const_cast<DataArrayInt *>(tmp);
+    }
+  tmp=m->getNumberFieldAtLevel(0);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _cell_num_ids=const_cast<DataArrayInt *>(tmp);
+    }
+  //
+  _node_fam_ids_nocpy=true; _node_num_ids_nocpy=true;
+  tmp=0;
+  tmp=m->getFamilyFieldAtLevel(1);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _node_fam_ids=const_cast<DataArrayInt *>(tmp);
+    }
+  tmp=m->getNumberFieldAtLevel(1);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _node_num_ids=const_cast<DataArrayInt *>(tmp);
+    }
+}
+
+MEDStructuredMeshMultiLev::MEDStructuredMeshMultiLev(const MEDFileStructuredMesh *m, int nbOfNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(nbOfNodes,gts,pfls,nbEntities)
+{
+  // ids fields management
+  _cell_fam_ids_nocpy=true; _cell_num_ids_nocpy=true;
+  const DataArrayInt *tmp(0);
+  tmp=m->getFamilyFieldAtLevel(0);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _cell_fam_ids=const_cast<DataArrayInt *>(tmp);
+    }
+  tmp=m->getNumberFieldAtLevel(0);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _cell_num_ids=const_cast<DataArrayInt *>(tmp);
+    }
+  //
+  _node_fam_ids_nocpy=true; _node_num_ids_nocpy=true;
+  tmp=0;
+  tmp=m->getFamilyFieldAtLevel(1);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _node_fam_ids=const_cast<DataArrayInt *>(tmp);
+    }
+  tmp=m->getNumberFieldAtLevel(1);
+  if(tmp)
+    {
+      tmp->incrRef();
+      _node_num_ids=const_cast<DataArrayInt *>(tmp);
+    }
 }
 
 void MEDStructuredMeshMultiLev::selectPartOfNodes(const DataArrayInt *pflNodes)
@@ -778,7 +1138,7 @@ MEDCMeshMultiLev *MEDCMeshMultiLev::New(const MEDFileCMesh *m, const std::vector
   return new MEDCMeshMultiLev(m,gts,pfls,nbEntities);
 }
 
-MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<int>& levs)
+MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<int>& levs):MEDStructuredMeshMultiLev(m,levs)
 {
   if(!m)
     throw INTERP_KERNEL::Exception("MEDCMeshMultiLev constructor : null input pointer !");
@@ -795,7 +1155,7 @@ MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<int>
     }
 }
 
-MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDStructuredMeshMultiLev(m->getNumberOfNodes(),gts,pfls,nbEntities)
+MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDStructuredMeshMultiLev(m,m->getNumberOfNodes(),gts,pfls,nbEntities)
 {
   if(!m)
     throw INTERP_KERNEL::Exception("MEDCMeshMultiLev constructor 2 : null input pointer !");
@@ -837,6 +1197,7 @@ MEDMeshMultiLev *MEDCMeshMultiLev::prepare() const
   if(pfl)
     {
       std::vector< std::pair<int,int> > cellParts;
+      MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret2;
       if(MEDCouplingStructuredMesh::IsPartStructured(pfl->begin(),pfl->end(),cgs,cellParts))
         {
           MEDCouplingAutoRefCountObjectPtr<MEDCMeshMultiLev> ret(new MEDCMeshMultiLev(*this));
@@ -848,7 +1209,7 @@ MEDMeshMultiLev *MEDCMeshMultiLev::prepare() const
           for(std::size_t i=0;i<_coords.size();i++)
             coords[i]=_coords[i]->selectByTupleId2(cellParts[i].first,cellParts[i].second+1,1);
           ret->_coords=coords;
-          return ret.retn();
+          ret2=(MEDCMeshMultiLev *)ret; ret2->incrRef();
         }
       else
         {
@@ -860,8 +1221,21 @@ MEDMeshMultiLev *MEDCMeshMultiLev::prepare() const
           MEDCouplingAutoRefCountObjectPtr<MEDUMeshMultiLev> ret(new MEDUMeshMultiLev(*this,m3));
           if(nr)
             { m3->zipCoords(); nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
-          return ret.retn();
+          ret2=(MEDUMeshMultiLev *)ret; ret2->incrRef();
+        }
+      const DataArrayInt *famIds(_cell_fam_ids),*numIds(_cell_num_ids);
+      if(famIds)
+        {
+          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(famIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+          ret2->setFamilyIdsOnCells(tmp,false);
         }
+      if(numIds)
+        {
+          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(numIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+          ret2->setNumberIdsOnCells(tmp,false);
+        }
+      return ret2.retn();
+      
     }
   else
     {
@@ -896,7 +1270,7 @@ MEDCurveLinearMeshMultiLev *MEDCurveLinearMeshMultiLev::New(const MEDFileCurveLi
   return new MEDCurveLinearMeshMultiLev(m,gts,pfls,nbEntities);
 }
 
-MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs)
+MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs):MEDStructuredMeshMultiLev(m,levs)
 {
   if(!m)
     throw INTERP_KERNEL::Exception("MEDCurveLinearMeshMultiLev constructor : null input pointer !");
@@ -910,7 +1284,7 @@ MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearM
   _structure=m->getMesh()->getNodeGridStructure();
 }
 
-MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDStructuredMeshMultiLev(m->getNumberOfNodes(),gts,pfls,nbEntities)
+MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDStructuredMeshMultiLev(m,m->getNumberOfNodes(),gts,pfls,nbEntities)
 {
   if(!m)
     throw INTERP_KERNEL::Exception("MEDCurveLinearMeshMultiLev constructor 2 : null input pointer !");
@@ -946,6 +1320,7 @@ MEDMeshMultiLev *MEDCurveLinearMeshMultiLev::prepare() const
   if(pfl)
     {
       std::vector< std::pair<int,int> > cellParts,nodeParts;
+      MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret2;
       if(MEDCouplingStructuredMesh::IsPartStructured(pfl->begin(),pfl->end(),cgs,cellParts))
         {
           nodeParts=cellParts;
@@ -963,7 +1338,7 @@ MEDMeshMultiLev *MEDCurveLinearMeshMultiLev::prepare() const
           ret->_pfls[0]=0;
           ret->_coords=_coords->selectByTupleIdSafe(p->begin(),p->end());
           ret->_structure=st;
-          return ret.retn();
+          ret2=(MEDCurveLinearMeshMultiLev *)ret; ret2->incrRef();
         }
       else
         {
@@ -974,8 +1349,20 @@ MEDMeshMultiLev *MEDCurveLinearMeshMultiLev::prepare() const
           MEDCouplingAutoRefCountObjectPtr<MEDUMeshMultiLev> ret(new MEDUMeshMultiLev(*this,m3));
           if(nr)
             { m3->zipCoords(); nnr=nr->deepCpy(); nnr->sort(true); ret->setNodeReduction(nnr); }
-          return ret.retn();
+          ret2=(MEDUMeshMultiLev *)ret; ret2->incrRef();
+        }
+      const DataArrayInt *famIds(_cell_fam_ids),*numIds(_cell_num_ids);
+      if(famIds)
+        {
+          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(famIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+          ret2->setFamilyIdsOnCells(tmp,false);
+        }
+      if(numIds)
+        {
+          MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp(numIds->selectByTupleIdSafe(pfl->begin(),pfl->end()));
+          ret2->setNumberIdsOnCells(tmp,false);
         }
+      return ret2.retn();
     }
   else
     {
index ff4ce6c418c86bf30dbaaa3149e5dc2f74527c20..e8d13ebfe02ebdba61bc81aa63ae5480f3c24116 100644 (file)
@@ -39,6 +39,7 @@ namespace ParaMEDMEM
   class MEDFileMesh;
   class MEDFileUMesh;
   class MEDFileCMesh;
+  class MEDFileStructuredMesh;
   class MEDFileCurveLinearMesh;
   class MEDFileFieldGlobs;
   class MEDFileFieldGlobsReal;
@@ -80,6 +81,14 @@ namespace ParaMEDMEM
     void setNodeReduction(const DataArrayInt *nr);
     bool isFastlyTheSameStruct(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs) const;
     MEDLOADER_EXPORT DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const;
+    MEDLOADER_EXPORT void retrieveFamilyIdsOnCells(DataArrayInt *& famIds, bool& isWithoutCopy) const;
+    MEDLOADER_EXPORT void retrieveNumberIdsOnCells(DataArrayInt *& numIds, bool& isWithoutCopy) const;
+    MEDLOADER_EXPORT void retrieveFamilyIdsOnNodes(DataArrayInt *& famIds, bool& isWithoutCopy) const;
+    MEDLOADER_EXPORT void retrieveNumberIdsOnNodes(DataArrayInt *& numIds, bool& isWithoutCopy) const;
+    void setFamilyIdsOnCells(DataArrayInt *famIds, bool isNoCopy);
+    void setNumberIdsOnCells(DataArrayInt *numIds, bool isNoCopy);
+    void setFamilyIdsOnNodes(DataArrayInt *famIds, bool isNoCopy);
+    void setNumberIdsOnNodes(DataArrayInt *numIds, bool isNoCopy);
     virtual void selectPartOfNodes(const DataArrayInt *pflNodes) = 0;
     virtual MEDMeshMultiLev *prepare() const = 0;
     int getNumberOfCells(INTERP_KERNEL::NormalizedCellType t) const;
@@ -97,6 +106,15 @@ namespace ParaMEDMEM
     std::vector<int> _nb_entities;
     MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_reduction;
     int _nb_nodes;
+    //
+    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _cell_fam_ids;
+    bool _cell_fam_ids_nocpy;
+    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _cell_num_ids;
+    bool _cell_num_ids_nocpy;
+    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_fam_ids;
+    bool _node_fam_ids_nocpy;
+    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_num_ids;
+    bool _node_num_ids_nocpy;
   public:
     static const int PARAMEDMEM_2_VTKTYPE_LGTH=34;
     static const unsigned char PARAMEDMEM_2_VTKTYPE[PARAMEDMEM_2_VTKTYPE_LGTH];
@@ -131,7 +149,8 @@ namespace ParaMEDMEM
   protected:
     MEDStructuredMeshMultiLev();
     MEDStructuredMeshMultiLev(const MEDStructuredMeshMultiLev& other);
-    MEDStructuredMeshMultiLev(int nbOfNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
+    MEDStructuredMeshMultiLev(const MEDFileStructuredMesh *m, const std::vector<int>& lev);
+    MEDStructuredMeshMultiLev(const MEDFileStructuredMesh *m, int nbOfNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
   };
   
   class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
index a873bdfae3987c6570ea5ccebf2b647130673177..dd31d0a96efc5b31e474969a0f0203fe1d8f10fe 100644 (file)
@@ -274,6 +274,45 @@ void MEDFileMesh::copyFamGrpMapsFrom(const MEDFileMesh& other)
   _families=other._families;
 }
 
+
+/*!
+ * This method clear all the groups in the map.
+ * So this method does not operate at all on arrays.
+ * So this method can lead to orphan families.
+ * 
+ * \sa MEDFileMesh::clearFamMap, MEDFileMesh::clearFamGrpMaps
+ */
+void MEDFileMesh::clearGrpMap()
+{
+  _groups.clear();
+}
+
+/*!
+ * This method clear all the families in the map.
+ * So this method does not operate at all on arrays.
+ * WARNING ! if there are some groups lying on cleared families, those groups will be impacted !
+ *
+ * \sa MEDFileMesh::clearFamMap, MEDFileMesh::clearFamGrpMaps
+ */
+void MEDFileMesh::clearFamMap()
+{
+  _families.clear();
+}
+
+/*!
+ * This method clear all the families and groups in the map.
+ * So this method does not operate at all on arrays.
+ * As all groups and families entry will be removed after 
+ * the call of MEDFileMesh::setFamilyFieldArr method with 0 or None (python) in the 2nd parameter can be useful to reduce the size of the object.
+ *
+ * \sa MEDFileMesh::clearFamMap, MEDFileMesh::clearFamMap
+ */
+void MEDFileMesh::clearFamGrpMaps()
+{
+  clearGrpMap();
+  clearFamMap();
+}
+
 /*!
  * Returns names of families constituting a group.
  *  \param [in] name - the name of the group of interest.
@@ -2941,6 +2980,22 @@ MEDCouplingUMesh *MEDFileUMesh::getLevelM3Mesh(bool renum) const
   return getMeshAtLevel(-3,renum);
 }
 
+/*!
+ * This method is for advanced users. There is two storing strategy of mesh in \a this.
+ * Either MEDCouplingUMesh, or vector of MEDCoupling1GTUMesh instances.
+ * When assignement is done the first one is done, which is not optimal in write mode for MED file.
+ * This method allows to switch from MEDCouplingUMesh mode to MEDCoupling1GTUMesh mode.
+ */
+void MEDFileUMesh::forceComputationOfParts() const
+{
+  for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
+    {
+      const MEDFileUMeshSplitL1 *elt(*it);
+      if(elt)
+        elt->forceComputationOfParts();
+    }
+}
+
 /*!
  * This method returns a vector of mesh parts containing each exactly one geometric type.
  * This method will never launch an automatic computation of split by type (an INTERP_KERNEL::Exception will be then thrown).
@@ -2966,6 +3021,46 @@ MEDCoupling1GTUMesh *MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh(INTERP_
   return sp->getDirectUndergroundSingleGeoTypeMesh(gt);
 }
 
+/*!
+ * Given a relative level \a meshDimRelToMax it returns the sorted vector of geometric types present in \a this.
+ * \throw if the reqsuested \a meshDimRelToMax does not exist.
+ */
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileUMesh::getGeoTypesAtLevel(int meshDimRelToMax) const
+{
+  const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe(meshDimRelToMax));
+  return sp->getGeoTypes();
+}
+
+/*!
+ * This method extracts from whole family field ids the part relative to the input parameter \a gt.
+ * \param [in] gt - the geometric type for which the family field is asked.
+ * \return DataArrayInt * - a pointer to DataArrayInt that the caller is to
+ *          delete using decrRef() as it is no more needed.
+ * \sa MEDFileUMesh::extractNumberFieldOnGeoType
+ */
+DataArrayInt *MEDFileUMesh::extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const
+{
+  const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(gt);
+  int lev=(int)cm.getDimension()-getMeshDimension();
+  const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe(lev));
+  return sp->extractFamilyFieldOnGeoType(gt);
+}
+
+/*!
+ * This method extracts from whole number field ids the part relative to the input parameter \a gt.
+ * \param [in] gt - the geometric type for which the number field is asked.
+ * \return DataArrayInt * - a pointer to DataArrayInt that the caller is to
+ *          delete using decrRef() as it is no more needed.
+ * \sa MEDFileUMesh::extractFamilyFieldOnGeoType
+ */
+DataArrayInt *MEDFileUMesh::extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const
+{
+  const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(gt);
+  int lev=(int)cm.getDimension()-getMeshDimension();
+  const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe(lev));
+  return sp->extractNumberFieldOnGeoType(gt);
+}
+
 const MEDFileUMeshSplitL1 *MEDFileUMesh::getMeshAtLevSafe(int meshDimRelToMaxExt) const
 {
   if(meshDimRelToMaxExt==1)
index 87455300a39ab340c6139dc7e0c3023c048added..d5b544972a0c713acaa292710a4989eedf0f6f53 100644 (file)
@@ -92,6 +92,9 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT void setFamilyInfo(const std::map<std::string,int>& info);
     MEDLOADER_EXPORT void setGroupInfo(const std::map<std::string, std::vector<std::string> >&info);
     MEDLOADER_EXPORT void copyFamGrpMapsFrom(const MEDFileMesh& other);
+    MEDLOADER_EXPORT void clearGrpMap();
+    MEDLOADER_EXPORT void clearFamMap();
+    MEDLOADER_EXPORT void clearFamGrpMaps();
     MEDLOADER_EXPORT const std::map<std::string,int>& getFamilyInfo() const { return _families; }
     MEDLOADER_EXPORT const std::map<std::string, std::vector<std::string> >& getGroupInfo() const { return _groups; }
     MEDLOADER_EXPORT std::vector<std::string> getFamiliesOnGroup(const char *name) const;
@@ -214,6 +217,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const;
     MEDLOADER_EXPORT const DataArrayAsciiChar *getNameFieldAtLevel(int meshDimRelToMaxExt) const;
     MEDLOADER_EXPORT int getNumberOfNodes() const;
+    MEDLOADER_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypesAtLevel(int meshDimRelToMax) const;
     MEDLOADER_EXPORT void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector<bool>& nodesFetched) const;
     MEDLOADER_EXPORT std::vector<int> getNonEmptyLevels() const;
     MEDLOADER_EXPORT std::vector<int> getNonEmptyLevelsExt() const;
@@ -242,8 +246,11 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const;
     MEDLOADER_EXPORT MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const;
     MEDLOADER_EXPORT MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const;
+    MEDLOADER_EXPORT void forceComputationOfParts() const;
     MEDLOADER_EXPORT std::vector<MEDCoupling1GTUMesh *> getDirectUndergroundSingleGeoTypeMeshes(int meshDimRelToMax) const;
     MEDLOADER_EXPORT MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const;
+    MEDLOADER_EXPORT DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+    MEDLOADER_EXPORT DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
     //
     MEDLOADER_EXPORT void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
     MEDLOADER_EXPORT void setCoords(DataArrayDouble *coords);
index cbc4dc6e6c1a037280ecac40587f3ce4767fa49a..39c409025837cd97ad314850edcf0ff7f8ccc967 100644 (file)
@@ -535,13 +535,25 @@ MEDFileUMeshSplitL1::MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const char *m
     {
       for(int i=0;i<sz;i++)
         fams[i]=v[i]->getFam();
-      _fam=DataArrayInt::Aggregate(fams);
+      if(sz!=1)
+        _fam=DataArrayInt::Aggregate(fams);
+      else
+        {
+          fams[0]->incrRef();
+          _fam=const_cast<DataArrayInt *>(fams[0]);
+        }
     }
   if(l2.isNumDefinedOnLev(id))
     {
       for(int i=0;i<sz;i++)
         nums[i]=v[i]->getNum();
-      _num=DataArrayInt::Aggregate(nums);
+      if(sz!=1)
+        _num=DataArrayInt::Aggregate(nums);
+      else
+        {
+          nums[0]->incrRef();
+          _num=const_cast<DataArrayInt *>(nums[0]);
+        }
       computeRevNum();
     }
   if(l2.isNamesDefinedOnLev(id))
@@ -701,6 +713,11 @@ void MEDFileUMeshSplitL1::assignMesh(MEDCouplingUMesh *m, bool newOrOld)
   assignCommonPart();
 }
 
+void MEDFileUMeshSplitL1::forceComputationOfParts() const
+{
+  _m_by_types.forceComputationOfPartsFromUMesh();
+}
+
 void MEDFileUMeshSplitL1::assignParts(const std::vector< const MEDCoupling1GTUMesh * >& mParts)
 {
   _m_by_types.assignParts(mParts);
@@ -765,6 +782,11 @@ DataArrayInt *MEDFileUMeshSplitL1::getFamilyPartArr(const int *idsBg, const int
   return da.retn();
 }
 
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileUMeshSplitL1::getGeoTypes() const
+{
+  return _m_by_types.getGeoTypes();
+}
+
 MEDCouplingUMesh *MEDFileUMeshSplitL1::getWholeMesh(bool renum) const
 {
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp;
@@ -775,6 +797,26 @@ MEDCouplingUMesh *MEDFileUMeshSplitL1::getWholeMesh(bool renum) const
   return tmp.retn();
 }
 
+DataArrayInt *MEDFileUMeshSplitL1::extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const
+{
+  const DataArrayInt *fam(_fam);
+  if(!fam)
+    return 0;
+  int start(0),stop(0);
+  _m_by_types.getStartStopOfGeoTypeWithoutComputation(gt,start,stop);
+  return fam->selectByTupleId2(start,stop,1);
+}
+
+DataArrayInt *MEDFileUMeshSplitL1::extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const
+{
+  const DataArrayInt *num(_num);
+  if(!num)
+    return 0;
+  int start(0),stop(0);
+  _m_by_types.getStartStopOfGeoTypeWithoutComputation(gt,start,stop);
+  return num->selectByTupleId2(start,stop,1);
+}
+
 DataArrayInt *MEDFileUMeshSplitL1::getOrCreateAndGetFamilyField()
 {
   if((DataArrayInt *)_fam)
@@ -1009,6 +1051,20 @@ MEDCouplingUMesh *MEDFileUMeshAggregateCompute::getUmesh() const
   return _m;
 }
 
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileUMeshAggregateCompute::getGeoTypes() const
+{
+  if(_mp_time>=_m_time)
+    {
+      std::size_t sz(_m_parts.size());
+      std::vector<INTERP_KERNEL::NormalizedCellType> ret(sz);
+      for(std::size_t i=0;i<sz;i++)
+        ret[i]=_m_parts[i]->getCellModelEnum();
+      return ret;
+    }
+  else
+    return _m->getAllGeoTypesSorted();
+}
+
 std::vector<MEDCoupling1GTUMesh *> MEDFileUMeshAggregateCompute::getPartsWithoutComputation() const
 {
   if(_mp_time<_m_time)
@@ -1044,6 +1100,27 @@ MEDCoupling1GTUMesh *MEDFileUMeshAggregateCompute::getPartWithoutComputation(INT
   throw INTERP_KERNEL::Exception("MEDFileUMeshAggregateCompute::getPartWithoutComputation : the geometric type is not existing !");
 }
 
+void MEDFileUMeshAggregateCompute::getStartStopOfGeoTypeWithoutComputation(INTERP_KERNEL::NormalizedCellType gt, int& start, int& stop) const
+{
+  start=0; stop=0;
+  std::vector<MEDCoupling1GTUMesh *> v(getPartsWithoutComputation());
+  std::size_t sz(v.size());
+  for(std::size_t i=0;i<sz;i++)
+    {
+      if(v[i])
+        {
+          if(v[i]->getCellModelEnum()==gt)
+            {
+              stop=start+v[i]->getNumberOfCells();
+              return;
+            }
+          else
+            start+=v[i]->getNumberOfCells();
+        }
+    }
+  throw INTERP_KERNEL::Exception("MEDFileUMeshAggregateCompute::getStartStopOfGeoTypeWithoutComputation : the geometric type is not existing !");
+}
+
 void MEDFileUMeshAggregateCompute::forceComputationOfPartsFromUMesh() const
 {
   const MEDCouplingUMesh *m(_m);
index 172b9c8d51f069c7b6a66623a30c9abacd148778..eb1d37adc3dbec5757ee0fe29e6fda68241ff1b0 100644 (file)
@@ -145,8 +145,10 @@ namespace ParaMEDMEM
     void assignUMesh(MEDCouplingUMesh *m);
     MEDCouplingUMesh *getUmesh() const;
     std::vector<MEDCoupling1GTUMesh *> getParts() const;
+    std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypes() const;
     std::vector<MEDCoupling1GTUMesh *> getPartsWithoutComputation() const;
     MEDCoupling1GTUMesh *getPartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const;
+    void getStartStopOfGeoTypeWithoutComputation(INTERP_KERNEL::NormalizedCellType gt, int& start, int& stop) const;
     std::size_t getTimeOfThis() const;
     std::size_t getHeapMemorySizeWithoutChildren() const;
     std::vector<const BigMemoryObject *> getDirectChildren() const;
@@ -159,8 +161,8 @@ namespace ParaMEDMEM
     std::vector<int> getDistributionOfTypes() const;
     int getSize() const;
     void setCoords(DataArrayDouble *coords);
-  private:
     void forceComputationOfPartsFromUMesh() const;
+  private:
     std::size_t getTimeOfParts() const;
     std::size_t getTimeOfUMesh() const;
   private:
@@ -188,6 +190,7 @@ namespace ParaMEDMEM
     void synchronizeTinyInfo(const MEDFileMesh& master) const;
     void assignMesh(MEDCouplingUMesh *m, bool newOrOld);
     void assignParts(const std::vector< const MEDCoupling1GTUMesh * >& mParts);
+    void forceComputationOfParts() const;
     bool empty() const;
     bool presenceOfOneFams(const std::vector<int>& ids) const;
     int getMeshDimension() const;
@@ -196,8 +199,11 @@ namespace ParaMEDMEM
     MEDCouplingUMesh *getFamilyPart(const int *idsBg, const int *idsEnd, bool renum) const;
     DataArrayInt *getFamilyPartArr(const int *idsBg, const int *idsEnd, bool renum) const;
     MEDCouplingUMesh *getWholeMesh(bool renum) const;
+    std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypes() const;
     std::vector<MEDCoupling1GTUMesh *> getDirectUndergroundSingleGeoTypeMeshes() const { return _m_by_types.getPartsWithoutComputation(); }
     MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { return _m_by_types.getPartWithoutComputation(gt); }
+    DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+    DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
     std::vector<int> getDistributionOfTypes() const { return _m_by_types.getDistributionOfTypes(); }
     DataArrayInt *getOrCreateAndGetFamilyField();
     const DataArrayInt *getFamilyField() const;
index f14e17a152833858b9415a9582f24c854815dd3f..75c9acc1a3a38f31d6012e8b00fe798c4625d402 100644 (file)
@@ -284,6 +284,11 @@ void MEDLoaderNS::dispatchElems(int nbOfElemCell, int nbOfElemFace, int& nbOfEle
 
 /// @endcond
 
+void MEDLoader::AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj)
+{
+  obj.setTooLongStrPolicy(_TOO_LONG_STR);
+}
+
 bool MEDLoader::HasXDR()
 {
 #ifdef HAS_XDR
@@ -1063,7 +1068,7 @@ std::vector< std::pair<int,int> > MEDLoader::GetNodeFieldIterations(const char *
 ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax)
 {
   CheckFileForRead(fileName);
-  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
+  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
   MEDFileMesh *mmPtr(mm);
   MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
   if(mmuPtr)
@@ -1087,7 +1092,7 @@ ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const char *fileName, c
 ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const char *fileName, int meshDimRelToMax)
 {
   CheckFileForRead(fileName);
-  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName);
+  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName));
   MEDFileMesh *mmPtr(mm);
   MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
   if(mmuPtr)
@@ -1111,7 +1116,7 @@ ParaMEDMEM::MEDCouplingMesh *MEDLoader::ReadMeshFromFile(const char *fileName, i
 ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax)
 {
   CheckFileForRead(fileName);
-  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
+  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
   MEDFileMesh *mmPtr(mm);
   MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
   if(!mmuPtr)
@@ -1125,7 +1130,7 @@ ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const char *fileName,
 ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFile(const char *fileName, int meshDimRelToMax)
 {
   CheckFileForRead(fileName);
-  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName);
+  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName));
   MEDFileMesh *mmPtr(mm);
   MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
   if(!mmuPtr)
@@ -1146,7 +1151,7 @@ int MEDLoader::ReadUMeshDimFromFile(const char *fileName, const char *meshName)
 ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromFamilies(const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector<std::string>& fams)
 {
   CheckFileForRead(fileName);
-  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,meshName);
+  MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,meshName));
   MEDFileMesh *mmPtr(mm);
   MEDFileUMesh *mmuPtr=dynamic_cast<MEDFileUMesh *>(mmPtr);
   if(!mmuPtr)
@@ -1357,7 +1362,8 @@ void MEDLoader::WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMes
   const MEDCoupling1GTUMesh *um2(dynamic_cast<const MEDCoupling1GTUMesh *>(mesh));
   if(um2)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu=MEDFileUMesh::New();
+      MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu(MEDFileUMesh::New());
+      AssignStaticWritePropertiesTo(*mmu);
       mmu->setMeshAtLevel(0,const_cast<MEDCoupling1GTUMesh *>(um2));
       mmu->write(fileName,mod);
       return ;
@@ -1365,7 +1371,8 @@ void MEDLoader::WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMes
   const MEDCouplingCMesh *um3(dynamic_cast<const MEDCouplingCMesh *>(mesh));
   if(um3)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> mmc=MEDFileCMesh::New();
+      MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> mmc(MEDFileCMesh::New());
+      AssignStaticWritePropertiesTo(*mmc);
       mmc->setMesh(const_cast<MEDCouplingCMesh *>(um3));
       mmc->write(fileName,mod);
       return ;
@@ -1373,7 +1380,8 @@ void MEDLoader::WriteMesh(const char *fileName, const ParaMEDMEM::MEDCouplingMes
   const MEDCouplingCurveLinearMesh *um4(dynamic_cast<const MEDCouplingCurveLinearMesh *>(mesh));
   if(um4)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> mmc=MEDFileCurveLinearMesh::New();
+      MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> mmc(MEDFileCurveLinearMesh::New());
+      AssignStaticWritePropertiesTo(*mmc);
       mmc->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(um4));
       mmc->write(fileName,mod);
       return ;
@@ -1386,7 +1394,8 @@ void MEDLoader::WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUM
   if(!mesh)
     throw INTERP_KERNEL::Exception("MEDLoader::WriteUMesh : input mesh is null !");
   int mod=writeFromScratch?2:0;
-  MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m=MEDFileUMesh::New();
+  MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
+  AssignStaticWritePropertiesTo(*m);
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mcpy(static_cast<MEDCouplingUMesh *>(mesh->deepCpy()));
   m->setMeshAtLevel(0,mcpy,true);
   m->write(fileName,mod);
@@ -1408,7 +1417,8 @@ void MEDLoader::WriteUMeshesPartition(const char *fileName, const char *meshName
       std::ostringstream oss; oss << "File with name \'" << fileName << "\' has not valid permissions !";
       throw INTERP_KERNEL::Exception(oss.str().c_str());
     }
-  MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m=MEDFileUMesh::New();
+  MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
+  AssignStaticWritePropertiesTo(*m);
   m->setGroupsFromScratch(0,meshes,true);
   m->setName(meshNameC);
   int mod=writeFromScratch?2:0;
@@ -1423,14 +1433,16 @@ void MEDLoader::WriteUMeshesPartitionDep(const char *fileName, const char *meshN
 void MEDLoader::WriteUMeshes(const char *fileName, const std::vector<const ParaMEDMEM::MEDCouplingUMesh *>& meshes, bool writeFromScratch)
 {
   int mod=writeFromScratch?2:0;
-  MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m=MEDFileUMesh::New();
+  MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> m(MEDFileUMesh::New());
+  AssignStaticWritePropertiesTo(*m);
   m->setMeshes(meshes,true);
   m->write(fileName,mod);
 }
 
 void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch)
 {
-  MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff=MEDFileField1TS::New();
+  MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ff(MEDFileField1TS::New());
+  MEDLoader::AssignStaticWritePropertiesTo(*ff);
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> f2(f->deepCpy());
   const MEDCouplingMesh *m(f2->getMesh());
   const MEDCouplingUMesh *um(dynamic_cast<const MEDCouplingUMesh *>(m));
@@ -1441,9 +1453,10 @@ void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const char *fil
   int mod=writeFromScratch?2:0;
   if(um)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu=MEDFileUMesh::New();
-      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=um->getRenumArrForMEDFileFrmt();
-      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o=o2n->invertArrayO2N2N2O(o2n->getNumberOfTuples());
+      MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu(MEDFileUMesh::New());
+      MEDLoader::AssignStaticWritePropertiesTo(*mmu);
+      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n(um->getRenumArrForMEDFileFrmt());
+      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> n2o(o2n->invertArrayO2N2N2O(o2n->getNumberOfTuples()));
       f2->renumberCells(o2n->begin(),false);
       mmu->setMeshAtLevel(0,const_cast<MEDCouplingUMesh *>(static_cast<const MEDCouplingUMesh *>(f2->getMesh())));
       mmu->setRenumFieldArr(0,n2o);
@@ -1452,21 +1465,24 @@ void MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(const char *fil
     }
   else if(um2)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu=MEDFileUMesh::New();
+      MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> mmu(MEDFileUMesh::New());
+      MEDLoader::AssignStaticWritePropertiesTo(*mmu);
       mmu->setMeshAtLevel(0,const_cast<MEDCoupling1GTUMesh *>(um2));
       ff->setFieldNoProfileSBT(f2);
       mmu->write(fileName,mod);
     }
   else if(um3)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> mmc=MEDFileCMesh::New();
+      MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> mmc(MEDFileCMesh::New());
+      MEDLoader::AssignStaticWritePropertiesTo(*mmc);
       mmc->setMesh(const_cast<MEDCouplingCMesh *>(um3));
       ff->setFieldNoProfileSBT(f2);
       mmc->write(fileName,mod);
     }
   else if(um4)
     {
-      MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> mmc=MEDFileCurveLinearMesh::New();
+      MEDCouplingAutoRefCountObjectPtr<MEDFileCurveLinearMesh> mmc(MEDFileCurveLinearMesh::New());
+      MEDLoader::AssignStaticWritePropertiesTo(*mmc);
       mmc->setMesh(const_cast<MEDCouplingCurveLinearMesh *>(um4));
       ff->setFieldNoProfileSBT(f2);
       mmc->write(fileName,mod);
@@ -1501,7 +1517,8 @@ void MEDLoader::WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFi
         MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(fileName,f,false);
       else
         {
-          MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,f->getMesh()->getName().c_str());
+          MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm(MEDFileMesh::New(fileName,f->getMesh()->getName().c_str()));
+          AssignStaticWritePropertiesTo(*mm);
           const MEDFileMesh *mmPtr(mm);
           const MEDFileUMesh *mmuPtr=dynamic_cast<const MEDFileUMesh *>(mmPtr);
           if(!mmuPtr)
@@ -1525,7 +1542,8 @@ void MEDLoader::WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFi
                   std::ostringstream oss; oss << "MEDLoader::WriteField : The file \""<< fileName << "\" already contains a mesh named \""<< f->getMesh()->getName() << "\" and this mesh in the file is not compatible (a subpart) with the mesh you intend to write ! This is maybe due to a too strict policy ! Try with to lease it by calling SetCompPolicyForCell !";
                   throw INTERP_KERNEL::Exception(oss.str().c_str());
                 }
-              MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts=MEDFileField1TS::New();
+              MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts(MEDFileField1TS::New());
+              AssignStaticWritePropertiesTo(*f1ts);
               if(part->isIdentity() && part->getNumberOfTuples()==mread->getNumberOfCells())
                 f1ts->setFieldNoProfileSBT(f2);
               else
@@ -1546,7 +1564,8 @@ void MEDLoader::WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFi
                   std::ostringstream oss; oss << "MEDLoader::WriteField : The file \""<< fileName << "\" already contains a mesh named \""<< f->getMesh()->getName() << "\" and this mesh in the file is not compatible (a subpart regarding nodes) with the mesh you intend to write ! This is maybe due to a too strict epsilon ! Try with to lease it by calling SetEpsilonForNodeComp !";
                   throw INTERP_KERNEL::Exception(oss.str().c_str());
                 }
-              MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts=MEDFileField1TS::New();
+              MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts(MEDFileField1TS::New());
+              AssignStaticWritePropertiesTo(*f1ts);
               if(part->isIdentity() && part->getNumberOfTuples()==mread->getNumberOfNodes())
                 f1ts->setFieldNoProfileSBT(f2);
               else
@@ -1576,7 +1595,8 @@ void MEDLoader::WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const Pa
       std::ostringstream oss; oss << "File with name \'" << fileName << "\' has not valid permissions or not exists !";
       throw INTERP_KERNEL::Exception(oss.str().c_str());
     }
-  MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts=MEDFileField1TS::New();
+  MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> f1ts(MEDFileField1TS::New());
+  AssignStaticWritePropertiesTo(*f1ts);
   MEDCouplingUMesh *m=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f->getMesh()));
   if(!m)
     throw INTERP_KERNEL::Exception("MEDLoader::WriteFieldUsingAlreadyWrittenMesh : only umesh in input field supported !");
index 5e7187a195924badd9285b1223eefdde592c686f..1f0a7b1305021d5cea2be91333ec99726b2dfc80 100644 (file)
@@ -35,6 +35,7 @@ namespace ParaMEDMEM
   class MEDCouplingMesh;
   class MEDCouplingUMesh;
   class MEDCouplingFieldDouble;
+  class MEDFileWritable;
 }
 
 class MEDLOADER_EXPORT MEDLoader
@@ -97,6 +98,8 @@ class MEDLOADER_EXPORT MEDLoader
   static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
   static void WriteFieldDep(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch);
   static void WriteFieldUsingAlreadyWrittenMesh(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f);
+ public:
+  static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj);
  private:
   MEDLoader();
  public:
index 8578ffb7a8e755379cfcc4a8b41f6942aa15b988..ad16d610ac9d417793b4ba475246dc2430b750c1 100644 (file)
@@ -3274,7 +3274,7 @@ void IntermediateMED::setFields( SauvUtilities::DoubleField* fld,
                                  ParaMEDMEM::MEDFileFields*  medFields,
                                  ParaMEDMEM::MEDFileUMesh*   mesh,
                                  const TID                   castemID,
-                                 std::set< std::string >&              usedFieldNames)
+                                 std::set< std::string >&    usedFieldNames)
 {
   bool sameNbGauss = true;
   if ( !fld || !fld->isMedCompatible( sameNbGauss )) return;
index 428658fc2cae707f48c8103f3d340056f3903230..7c76e36cb53991f0b233e3051ecda1da142ab820 100644 (file)
@@ -642,7 +642,8 @@ void SauvReader::read_PILE_COORDONNEES (const int nbObjects, std::vector<std::st
  */
 //================================================================================
 
-SauvUtilities::Group* SauvReader::getFieldSupport(const vector<SauvUtilities::Group*>& supports)
+void SauvReader::setFieldSupport(const vector<SauvUtilities::Group*>& supports,
+                                 SauvUtilities::DoubleField*          field)
 {
   SauvUtilities::Group* group = NULL;
   set<SauvUtilities::Group*> sup_set( supports.begin(), supports.end() );
@@ -652,19 +653,31 @@ SauvUtilities::Group* SauvReader::getFieldSupport(const vector<SauvUtilities::Gr
     }
   else
     {
-      // try to find an existing composite group with the same sub-groups
-      for ( size_t i = 0; i < _iMed->_groups.size() && !group; ++i )
+      // check if sub-components are on cells of different types
+      map<int,int> nbGaussByCellType;
+      for ( size_t i = 0; i < supports.size(); ++i )
         {
-          Group & grp = _iMed->_groups[i];
-          if (sup_set.size() == grp._groups.size())
-            {
-              bool sameOrder = true;
-              for ( size_t j = 0; j < supports.size() && sameOrder; ++j )
-                sameOrder = ( supports[j] == grp._groups[ j % grp._groups.size() ]);
-              if ( sameOrder )
-                group = & _iMed->_groups[i];
-            }
+          map<int,int>::iterator ct2ng = nbGaussByCellType.find( supports[i]->_cellType );
+          if ( ct2ng == nbGaussByCellType.end() )
+            nbGaussByCellType[ supports[i]->_cellType ] = field->_sub[i].nbGauss();
+          else if ( ct2ng->second != field->_sub[i].nbGauss() )
+            return;
         }
+      bool isSameCellType = ( nbGaussByCellType.size() == 1 );
+      // try to find an existing composite group with the same sub-groups
+      if ( isSameCellType )
+        for ( size_t i = 0; i < _iMed->_groups.size() && !group; ++i )
+          {
+            Group & grp = _iMed->_groups[i];
+            if (sup_set.size() == grp._groups.size())
+              {
+                bool sameOrder = true;
+                for ( size_t j = 0; j < supports.size() && sameOrder; ++j )
+                  sameOrder = ( supports[j] == grp._groups[ j % grp._groups.size() ]);
+                if ( sameOrder )
+                  group = & _iMed->_groups[i];
+              }
+          }
       if ( !group ) // no such a group, add a new one
         {
           vector<SauvUtilities::Group*> newGroups( supports.begin(),
@@ -680,15 +693,67 @@ SauvUtilities::Group* SauvReader::getFieldSupport(const vector<SauvUtilities::Gr
               group->_groups.swap( newGroups );
             }
         }
+      // sort field sub-components and supports by cell type
+      if ( group && !isSameCellType )
+        {
+          // sort groups
+          vector<SauvUtilities::Group*>& groups = group->_groups;
+          bool isModified = false, isSwapped = true;
+          while ( isSwapped )
+            {
+              isSwapped = false;
+              for ( size_t i = 1; i < groups.size(); ++i )
+                {
+                  int nbN1 = groups[i-1]->empty() ? 0 : groups[i-1]->_cells[0]->_nodes.size();
+                  int nbN2 = groups[i  ]->empty() ? 0 : groups[i  ]->_cells[0]->_nodes.size();
+                  if ( nbN1 > nbN2 )
+                    {
+                      isSwapped = isModified = true;
+                      std::swap( groups[i], groups[i-1] );
+                    }
+                }
+            }
+          // relocate sub-components according to a new order of groups
+          if ( isModified )
+            {
+              vector< DoubleField::_Sub_data > newSub( field->_sub.size() );
+              vector< vector< double > >       newValues( field->_comp_values.size() );
+              size_t iFromSub = 0, iNewSub = 0, iNewComp = 0;
+              for ( ; iFromSub < field->_sub.size(); iFromSub += groups.size() )
+                {
+                  size_t iFromComp = iNewComp;
+                  for ( size_t iG = 0; iG < groups.size(); ++iG )
+                    {
+                      size_t iComp = iFromComp;
+                      for ( size_t iSub = iFromSub; iSub < field->_sub.size(); ++iSub )
+                        if ( field->_sub[ iSub ]._support == groups[ iG ] )
+                          {
+                            newSub[ iNewSub++ ] = field->_sub[ iSub ];
+                            int iC = 0, nbC = field->_sub[ iSub ].nbComponents();
+                            for ( ; iC < nbC; ++iC )
+                              newValues[ iNewComp++ ].swap( field->_comp_values[ iComp++ ]);
+                            break;
+                          }
+                        else
+                          {
+                            iComp += field->_sub[ iSub ].nbComponents();
+                          }
+                    }
+                }
+              field->_sub.swap( newSub );
+              field->_comp_values.swap( newValues );
+            }
+        }
     }
   if ( group )
     group->_isProfile = true;
-  return group;
+
+  field->_group = group;
 }
 
 //================================================================================
 /*!
- * \brief set field names
+ * \brief Set field names
  */
 //================================================================================
 
@@ -813,7 +878,7 @@ void SauvReader::read_PILE_NODES_FIELD (const int                 nbObjects,
       // set a supporting group including all subs supports but only
       // if all subs have the same components
       if ( fdouble && fdouble->hasSameComponentsBySupport() )
-        fdouble->_group = getFieldSupport( supports );
+        setFieldSupport( supports, fdouble );
       else
         for ( i_sub = 0; i_sub < nb_sub; ++i_sub )
           fdouble->_sub[ i_sub ]._support->_isProfile = true;
@@ -983,7 +1048,7 @@ void SauvReader::read_PILE_FIELD (const int                 nbObjects,
       // set id of a group including all sub supports but only
       // if all subs have the same nb of components
       if ( fdouble && fdouble->hasSameComponentsBySupport() )
-        fdouble->_group = getFieldSupport( supports );
+        setFieldSupport( supports, fdouble );
       else
         for ( i_sub = 0; i_sub < nb_sub; ++i_sub )
           fdouble->_sub[ i_sub ]._support->_isProfile = true;
index abf232a05d3e741a518956216151ee1a024d8ed7..cb7b7e6b6e03e2de2039cf69aa28ee11ba20e1aa 100644 (file)
@@ -72,7 +72,8 @@ class SauvReader : public ParaMEDMEM::RefCountObject
   void read_PILE_MODL         (const int nbObjects, std::vector<std::string>& objectNames, std::vector<int>& nameIndices);
   void read_PILE_FIELD        (const int nbObjects, std::vector<std::string>& objectNames, std::vector<int>& nameIndices);
 
-  SauvUtilities::Group* getFieldSupport(const std::vector<SauvUtilities::Group*>& fieldSupports);
+  void setFieldSupport(const std::vector<SauvUtilities::Group*>& supports,
+                       SauvUtilities::DoubleField*               field);
   void setFieldNames(const std::vector<SauvUtilities::DoubleField*>& fields,
                      const std::vector<std::string>& objectNames,
                      const std::vector<int>& nameIndices);
index 697847bb6ac05c182b0ec5e941e455053ee61676..6478c2bbe9774dddb490819c64854b29e482a3e2 100644 (file)
@@ -212,11 +212,9 @@ namespace
   }
 }
 
-//================================================================================
-/*!
- * \brief Creates SauvWriter
- */
-//================================================================================
+SauvWriter::SauvWriter():_cpy_grp_if_on_single_family(false)
+{
+}
 
 SauvWriter* SauvWriter::New()
 {
@@ -233,6 +231,16 @@ std::vector<const BigMemoryObject *> SauvWriter::getDirectChildren() const
   return std::vector<const BigMemoryObject *>();
 }
 
+void SauvWriter::setCpyGrpIfOnASingleFamilyStatus(bool status)
+{
+  _cpy_grp_if_on_single_family=status;
+}
+
+bool SauvWriter::getCpyGrpIfOnASingleFamilyStatus() const
+{
+  return _cpy_grp_if_on_single_family;
+}
+
 //================================================================================
 /*!
  * \brief Fills own DS by MEDFileData
@@ -447,7 +455,23 @@ void SauvWriter::fillGroupSubMeshes()
       if (k != famNames.size())
           famSubMeshes.resize(k);
       SubMesh* grpSubMesh = addSubMesh( groupName, famSubMeshes[0]->_dimRelExt );
-      grpSubMesh->_subs.swap( famSubMeshes );
+      if(!_cpy_grp_if_on_single_family)
+        grpSubMesh->_subs.swap( famSubMeshes );
+      else
+        {
+          /* If a group sub mesh consists of only one family, the group is written as 
+           * a copy of this family. 
+           * A mesh composed of only one submesh may cause an issue with some Gibi operators.*/
+          if (famSubMeshes.size() == 1)
+            {
+              for(int i = 0; i < famSubMeshes[0]->cellIDsByTypeSize() ; i++)
+                {
+                  grpSubMesh->_cellIDsByType[i] = famSubMeshes[0]->_cellIDsByType[i];
+                }
+            }
+          else
+            grpSubMesh->_subs.swap( famSubMeshes );
+        }
     }
 }
 
index d6e732c1c17b2402b15008926933fa16a1948816..bbbdce98d277bb849f18239abfb5c08dc672bf18 100644 (file)
@@ -46,11 +46,13 @@ namespace ParaMEDMEM
   class SauvWriter : public ParaMEDMEM::RefCountObject
   {
   public:
-    MEDLOADER_EXPORT static SauvWriter * New();
+    MEDLOADER_EXPORT static SauvWriter *New();
     MEDLOADER_EXPORT void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0);
     MEDLOADER_EXPORT void write(const char* fileName);
-
+    MEDLOADER_EXPORT void setCpyGrpIfOnASingleFamilyStatus(bool status);
+    MEDLOADER_EXPORT bool getCpyGrpIfOnASingleFamilyStatus() const;
   private:
+    SauvWriter();
     std::size_t getHeapMemorySizeWithoutChildren() const;
     std::vector<const BigMemoryObject *> getDirectChildren() const;
     /*!
@@ -109,6 +111,7 @@ namespace ParaMEDMEM
     std::vector<SauvUtilities::nameGIBItoMED> _longNames[ LN_NB ];
 
     std::fstream*                             _sauvFile;
+    bool _cpy_grp_if_on_single_family;
   };
 }
 
index c011c3ce46175bcc4992a345d1a1b8005da33f93..2ee412614dd3ea8c6d925bea8e3752d32e59c284 100644 (file)
@@ -69,10 +69,22 @@ INSTALL(FILES sauv2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EX
 INSTALL(FILES case2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${SALOME_INSTALL_BINS} )
 INSTALL(FILES med2case PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${SALOME_INSTALL_BINS} )
 
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
 ADD_TEST(MEDLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(MEDLoaderTest2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest2.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest2 PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(MEDLoaderTest3 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest3.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest3 PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(MEDLoaderTest4 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest4.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest4 PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(MEDLoaderExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderExamplesTest.py)
+SET_TESTS_PROPERTIES(MEDLoaderExamplesTest PROPERTIES ENVIRONMENT "${tests_env}")
 ADD_TEST(SauvLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SauvLoaderTest.py)
-ADD_TEST(MEDLoaderCouplingTrainingSession ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderCouplingTrainingSession.py)
+SET_TESTS_PROPERTIES(SauvLoaderTest PROPERTIES ENVIRONMENT "${tests_env}")
+
+IF(NUMPY_FOUND)
+  ADD_TEST(MEDLoaderCouplingTrainingSession ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderCouplingTrainingSession.py)
+  SET_TESTS_PROPERTIES(MEDLoaderCouplingTrainingSession PROPERTIES ENVIRONMENT "${tests_env}")
+ENDIF(NUMPY_FOUND)
index 7d915e52a76d139e68ef0444aeb1626660bdbca6..06607db5edcd98a4f1004a22754c9ebba2838554 100644 (file)
@@ -105,6 +105,8 @@ using namespace ParaMEDMEM;
 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh;
 %newobject ParaMEDMEM::MEDFileUMesh::getLevelM3Mesh;
 %newobject ParaMEDMEM::MEDFileUMesh::getDirectUndergroundSingleGeoTypeMesh;
+%newobject ParaMEDMEM::MEDFileUMesh::extractFamilyFieldOnGeoType;
+%newobject ParaMEDMEM::MEDFileUMesh::extractNumberFieldOnGeoType;
 %newobject ParaMEDMEM::MEDFileUMesh::zipCoords;
 %newobject ParaMEDMEM::MEDFileCMesh::New;
 %newobject ParaMEDMEM::MEDFileCurveLinearMesh::New;
@@ -237,6 +239,7 @@ public:
   static std::vector<std::string> GetCellFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
   static std::vector<std::string> GetNodeFieldNamesOnMesh(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception);
   static double GetTimeAttachedOnFieldIteration(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
+  static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj) throw(INTERP_KERNEL::Exception);
   %extend
      {
        static PyObject *MEDFileVersion()
@@ -508,6 +511,9 @@ namespace ParaMEDMEM
     virtual void createGroupOnAll(int meshDimRelToMaxExt, const char *groupName) throw(INTERP_KERNEL::Exception);
     virtual bool keepFamIdsOnlyOnLevs(const std::vector<int>& famIds, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
     void copyFamGrpMapsFrom(const MEDFileMesh& other) throw(INTERP_KERNEL::Exception);
+    void clearGrpMap() throw(INTERP_KERNEL::Exception);
+    void clearFamMap() throw(INTERP_KERNEL::Exception);
+    void clearFamGrpMaps() throw(INTERP_KERNEL::Exception);
     const std::map<std::string,int>& getFamilyInfo() const throw(INTERP_KERNEL::Exception);
     const std::map<std::string, std::vector<std::string> >& getGroupInfo() const throw(INTERP_KERNEL::Exception);
     std::vector<std::string> getFamiliesOnGroup(const char *name) const throw(INTERP_KERNEL::Exception);
@@ -723,6 +729,7 @@ namespace ParaMEDMEM
     MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
     MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
     MEDCouplingUMesh *getLevelM3Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception);
+    void forceComputationOfParts() const throw(INTERP_KERNEL::Exception);
     //
     void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception);
     void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
@@ -734,6 +741,8 @@ namespace ParaMEDMEM
     void setMeshAtLevel(int meshDimRelToMax, MEDCouplingUMesh *m, bool newOrOld=false) throw(INTERP_KERNEL::Exception);
     void optimizeFamilies() throw(INTERP_KERNEL::Exception);
     DataArrayInt *zipCoords() throw(INTERP_KERNEL::Exception);
+    DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
+    DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
     %extend
        { 
          MEDFileUMesh(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception)
@@ -750,6 +759,16 @@ namespace ParaMEDMEM
          {
            return MEDFileUMesh::New();
          }
+
+         PyObject *getGeoTypesAtLevel(int meshDimRelToMax) const throw(INTERP_KERNEL::Exception)
+         {
+           std::vector<INTERP_KERNEL::NormalizedCellType> result(self->getGeoTypesAtLevel(meshDimRelToMax));
+           std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
+           PyObject *res=PyList_New(result.size());
+           for(int i=0;iL!=result.end(); i++, iL++)
+             PyList_SetItem(res,i,PyInt_FromLong(*iL));
+           return res;
+         }
          
          PyObject *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception)
          {
@@ -2800,6 +2819,13 @@ namespace ParaMEDMEM
   public:
     static SauvReader* New(const char *fileName) throw(INTERP_KERNEL::Exception);
     MEDFileData * loadInMEDFileDS() throw(INTERP_KERNEL::Exception);
+    %extend
+    {
+      SauvReader(const char *fileName) throw(INTERP_KERNEL::Exception)
+      {
+        return SauvReader::New(fileName);
+      }
+    }
   };
 
   class SauvWriter : public RefCountObject
@@ -2808,6 +2834,15 @@ namespace ParaMEDMEM
     static SauvWriter * New();
     void setMEDFileDS(const MEDFileData* medData, unsigned meshIndex = 0) throw(INTERP_KERNEL::Exception);
     void write(const char* fileName) throw(INTERP_KERNEL::Exception);
+    void setCpyGrpIfOnASingleFamilyStatus(bool status) throw(INTERP_KERNEL::Exception);
+    bool getCpyGrpIfOnASingleFamilyStatus() const throw(INTERP_KERNEL::Exception);
+    %extend
+    {
+      SauvWriter() throw(INTERP_KERNEL::Exception)
+      {
+        return SauvWriter::New();
+      }
+    }
   };
   
   ///////////////
@@ -2835,6 +2870,61 @@ namespace ParaMEDMEM
     DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const throw(INTERP_KERNEL::Exception);
   protected:
     ~MEDMeshMultiLev();
+  public:
+    %extend
+    {
+      PyObject *retrieveFamilyIdsOnCells() const throw(INTERP_KERNEL::Exception)
+      {
+        DataArrayInt *famIds(0);
+        bool isWithoutCopy(false);
+        self->retrieveFamilyIdsOnCells(famIds,isWithoutCopy);
+        PyObject *ret=PyTuple_New(2);
+        PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
+        Py_XINCREF(ret1Py);
+        PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,1,ret1Py);
+        return ret;
+      }
+
+      PyObject *retrieveNumberIdsOnCells() const throw(INTERP_KERNEL::Exception)
+      {
+        DataArrayInt *numIds(0);
+        bool isWithoutCopy(false);
+        self->retrieveNumberIdsOnCells(numIds,isWithoutCopy);
+        PyObject *ret=PyTuple_New(2);
+        PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
+        Py_XINCREF(ret1Py);
+        PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,1,ret1Py);
+        return ret;
+      }
+      
+      PyObject *retrieveFamilyIdsOnNodes() const throw(INTERP_KERNEL::Exception)
+      {
+        DataArrayInt *famIds(0);
+        bool isWithoutCopy(false);
+        self->retrieveFamilyIdsOnNodes(famIds,isWithoutCopy);
+        PyObject *ret=PyTuple_New(2);
+        PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
+        Py_XINCREF(ret1Py);
+        PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(famIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,1,ret1Py);
+        return ret;
+      }
+
+      PyObject *retrieveNumberIdsOnNodes() const throw(INTERP_KERNEL::Exception)
+      {
+        DataArrayInt *numIds(0);
+        bool isWithoutCopy(false);
+        self->retrieveNumberIdsOnNodes(numIds,isWithoutCopy);
+        PyObject *ret=PyTuple_New(2);
+        PyObject *ret1Py=isWithoutCopy?Py_True:Py_False;
+        Py_XINCREF(ret1Py);
+        PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(numIds),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+        PyTuple_SetItem(ret,1,ret1Py);
+        return ret;
+      }
+    }
   };
 
   class MEDUMeshMultiLev : public MEDMeshMultiLev
@@ -2847,14 +2937,17 @@ namespace ParaMEDMEM
        PyObject *buildVTUArrays() const throw(INTERP_KERNEL::Exception)
        {
          DataArrayDouble *coords(0); DataArrayByte *types(0); DataArrayInt *cellLocations(0),*cells(0),*faceLocations(0),*faces(0);
-         self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces);
-         PyObject *ret=PyTuple_New(6);
-         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
-         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
-         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+         bool ncc(self->buildVTUArrays(coords,types,cellLocations,cells,faceLocations,faces));
+         PyObject *ret0Py=ncc?Py_True:Py_False;
+         Py_XINCREF(ret0Py);
+         PyObject *ret=PyTuple_New(7);
+         PyTuple_SetItem(ret,0,ret0Py);
+         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(coords),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
+         PyTuple_SetItem(ret,2,SWIG_NewPointerObj(SWIG_as_voidptr(types),SWIGTYPE_p_ParaMEDMEM__DataArrayByte, SWIG_POINTER_OWN | 0 ));
+         PyTuple_SetItem(ret,3,SWIG_NewPointerObj(SWIG_as_voidptr(cellLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+         PyTuple_SetItem(ret,4,SWIG_NewPointerObj(SWIG_as_voidptr(cells),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+         PyTuple_SetItem(ret,5,SWIG_NewPointerObj(SWIG_as_voidptr(faceLocations),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+         PyTuple_SetItem(ret,6,SWIG_NewPointerObj(SWIG_as_voidptr(faces),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 ));
          return ret;
        }
      }
index 399e200dd5766204081c2c95c5947f93a3317c3a..6f219b438f7228be789d0a9b5122a533b13a5938 100644 (file)
@@ -21,7 +21,7 @@
 
 from MEDLoader import *
 from MEDCouplingRemapper import *
-import math
+import math, os
 
 d=DataArrayDouble.New(6,2)
 d[:,0]=3.
index 22e8cfc28b27994d7c0e7ca897a78ae02e6a4a8c..8a0aee21c8f4c31238d96967e01e6d3152e06309 100644 (file)
@@ -657,6 +657,55 @@ class MEDLoaderDataForTest:
         #
         data=MEDFileData() ; data.setMeshes(ms) ; data.setFields(fs)
         return data
+
+    def buildAMEDFileDataWithGroupOnOneFamilyForSauv(self):
+        # Coordinates
+        coords = [0.,0., 0.,1., 1.,1., 1.,0.]
+        # lvl 0 connectivity
+        conn2D   = [1,2,3,4]
+        # lvl -1 connectivity
+        conn1D   = [0,1, 1,2, 2,3, 4,1]
+        # lvl 0 mesh
+        mesh2D=MEDCouplingUMesh.New()
+        mesh2D.setMeshDimension(2)
+        mesh2D.allocateCells(1)
+        mesh2D.insertNextCell(NORM_QUAD4,4,conn2D)
+        mesh2D.finishInsertingCells()
+        # lvl -1 mesh
+        mesh1D=MEDCouplingUMesh.New()
+        mesh1D.setMeshDimension(1)
+        mesh1D.allocateCells(4)
+        mesh1D.insertNextCell(NORM_SEG2,2,conn1D[0:2])
+        mesh1D.insertNextCell(NORM_SEG2,2,conn1D[2:4])
+        mesh1D.insertNextCell(NORM_SEG2,2,conn1D[4:6])
+        mesh1D.insertNextCell(NORM_SEG2,2,conn1D[6:8])
+        mesh1D.finishInsertingCells()
+        # assigning coordinates
+        meshCoords=DataArrayDouble.New()
+        meshCoords.setValues(coords, 4, 2)
+        mesh2D.setCoords(meshCoords)
+        mesh1D.setCoords(meshCoords)
+        # Creating a multi level mesh
+        mm = MEDFileUMesh.New()
+        mm.setMeshAtLevel(0, mesh2D)
+        mm.setMeshAtLevel(-1, mesh1D)
+        mm.setName("carre")
+        # Creating groups
+        # Creating a group with an element on level -1
+        grp0_LM1 = DataArrayInt.New([0])
+        grp0_LM1.setName("grp0_LM1")
+        # Creating a group with all elements on level -1
+        grp1_LM1 = DataArrayInt.New([0,1,2,3])
+        grp1_LM1.setName("grp1_LM1")
+        #
+        mm.setGroupsAtLevel(-1,[grp0_LM1,grp1_LM1])
+        #
+        ms=MEDFileMeshes.New()
+        ms.setMeshAtPos(0,mm)
+        mfd=MEDFileData.New()
+        mfd.setMeshes(ms)
+        #
+        return mfd
     
     build1DMesh_1=classmethod(build1DMesh_1)
     build2DCurveMesh_1=classmethod(build2DCurveMesh_1)
@@ -675,4 +724,5 @@ class MEDLoaderDataForTest:
     buildVecFieldOnGauss_2_Simpler=classmethod(buildVecFieldOnGauss_2_Simpler)
     buildVecFieldOnGaussNE_1=classmethod(buildVecFieldOnGaussNE_1)
     buildACompleteMEDDataStructureWithFieldsOnCells_1=classmethod(buildACompleteMEDDataStructureWithFieldsOnCells_1)
+    buildAMEDFileDataWithGroupOnOneFamilyForSauv=classmethod(buildAMEDFileDataWithGroupOnOneFamilyForSauv)
     pass
index 861f614d14ee94dd177e944a798bfaf5c977cafa..bcf070846d0dbed5edf0123e0fa0d47cae3ab7e1 100644 (file)
@@ -21,6 +21,7 @@
 
 from MEDLoader import *
 import unittest
+import os
 
 class MEDLoaderBasicsTest(unittest.TestCase):
     def testExampleReadFieldOnAllEntity1(self):
index 3440231357fa0f289a016c8d4b9f443ee1ffea89..441ee661045fe59bf058109d26c6d446bde0fdb0 100644 (file)
@@ -658,6 +658,58 @@ class MEDLoaderTest(unittest.TestCase):
         self.assertTrue(m0.isEqual(mRead,1e-12))
         pass
 
+    def testChangeGroupName(self):
+        """ This test is a non regression test on MEDFileUMesh.changeGroupName thanks to Alliance.
+        """
+        mfd=MEDLoaderDataForTest.buildAMEDFileDataWithGroupOnOneFamilyForSauv()
+        mesh = mfd.getMeshes().getMeshAtPos(0)
+        mesh.changeGroupName("grp0_LM1", "xonall1")
+        self.assertTrue("xonall1" in mesh.getGroupsNames())
+        pass
+
+    def testFieldWithTooLongName(self):
+        """ This test is a non regression test, to check that in basic API the policies are taken into account.
+        """
+        fname="Pyfile75.med"
+        # Coordinates
+        coords = [0.,0., 0.,1., 1.,1., 1.,0.]
+        # lvl 0 connectivity
+        conn2D   = [1,2,3,4]
+        # lvl 0 mesh
+        m=MEDLoader.MEDCouplingUMesh.New("mesh",2)
+        m.allocateCells(1)
+        m.insertNextCell(MEDLoader.NORM_QUAD4,4,conn2D)
+        m.finishInsertingCells()
+        # assigning coordinates
+        meshCoords=MEDLoader.DataArrayDouble.New()
+        meshCoords.setValues(coords, 4, 2)
+        m.setCoords(meshCoords)
+        #
+        f=MEDLoader.MEDCouplingFieldDouble.New(MEDLoader.ON_CELLS,MEDLoader.ONE_TIME)
+        f.setMesh(m)
+        d=MEDLoader.DataArrayDouble.New()
+        d.alloc(1,1)
+        d.iota(1.)
+        # seting a long name
+       d.setInfoOnComponent(0,"CONCENTRATION of I129")
+        f.setArray(d)
+        f.setName("field")
+        #
+        mm=MEDLoader.MEDFileUMesh()
+        MEDLoader.MEDLoader.SetTooLongStrPolicy(2)
+        MEDLoader.MEDLoader.AssignStaticWritePropertiesTo(mm)
+        self.assertEqual(2,mm.getTooLongStrPolicy())
+        MEDLoader.MEDLoader.SetTooLongStrPolicy(0)
+        MEDLoader.MEDLoader.AssignStaticWritePropertiesTo(mm)
+        self.assertEqual(0,mm.getTooLongStrPolicy())
+        del mm
+        #
+        MEDLoader.MEDLoader.SetTooLongStrPolicy(2)
+        self.assertRaises(MEDLoader.InterpKernelException,MEDLoader.MEDLoader.WriteField,fname,f,True)# the component name is too long + policy 2 -> throw
+        f.getArray().setInfoOnComponent(0,'I129')
+        MEDLoader.MEDLoader.WriteField(fname,f,True)
+        pass
+
     pass
 
 unittest.main()
index 21654c9d07835090aa84a521adeb9d30e9510ad5..2d49e5ed318d51fe2d1586f845e8a795ac1d8715 100644 (file)
@@ -173,6 +173,9 @@ class MEDLoaderTest(unittest.TestCase):
         #
         mm=MEDFileMesh.New(outFileName)
         #
+        self.assertEqual([NORM_TRI3,NORM_QUAD4,NORM_POLYGON],mm.getGeoTypesAtLevel(0))
+        self.assertEqual([NORM_SEG2,NORM_SEG3],mm.getGeoTypesAtLevel(-1))
+        self.assertEqual([NORM_POINT1],mm.getGeoTypesAtLevel(-2))
         mm0=mm.getDirectUndergroundSingleGeoTypeMesh(NORM_POLYGON)
         self.assertTrue(isinstance(mm0,MEDCoupling1DGTUMesh))
         self.assertTrue(mm0.getNodalConnectivity().isEqual(DataArrayInt([6,7,4,3,7,8,5,4])))
index 71b025dd314e30b4e88d0146965a506c7c538fb1..f713058825b6a7d11ca3d3aa06da4ffc194580a0 100644 (file)
@@ -50,6 +50,10 @@ class MEDLoaderTest4(unittest.TestCase):
         m.setName("mesh") ; m.getCoords().setInfoOnComponents(["XX [m]","YYY [km]"])
         m1=m.buildDescendingConnectivity()[0]
         mm=MEDFileUMesh() ; mm.setMeshes([m,m1])
+        fam=DataArrayInt(9) ; fam.iota(0) ; mm.setFamilyFieldArr(0,fam)
+        fam=DataArrayInt(32) ; fam.iota(20) ; mm.setFamilyFieldArr(-1,fam) ; del fam
+        num=DataArrayInt(9) ; num.iota(100) ; mm.setRenumFieldArr(0,num)
+        num=DataArrayInt(32) ; num.iota(120) ; mm.setRenumFieldArr(-1,num) ; del num
         #
         fieldName="zeField"
         fs=MEDFileFieldMultiTS()
@@ -175,13 +179,20 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,5):
             self.assertTrue(fcscp.isDataSetSupportEqualToThePreviousOne(i,fields))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,67,70,73,76,80,84,88,92,96])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,100,104,108,112,117,122,127,132])))
         self.assertTrue(a3.isEqual(DataArrayInt([2,0,1,2,1,2,2,2,0,2,3,4,2,4,5,2,5,3,2,6,7,2,7,8,2,8,6,2,9,10,2,10,11,2,11,9,2,12,13,2,13,14,2,14,15,2,15,12,2,16,17,2,17,18,2,18,19,2,19,16,2,20,21,2,21,22,2,22,23,2,23,20,2,24,25,2,25,26,2,26,27,2,27,24,2,28,29,2,29,30,2,30,31,2,31,28,3,0,1,2,3,3,4,5,3,6,7,8,3,9,10,11,4,12,13,14,15,4,16,17,18,19,4,20,21,22,23,4,24,25,26,27,4,28,29,30,31])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,0,1,2,3,4,5,6,7,8])))
+        self.assertTrue(not a7)
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,100,101,102,103,104,105,106,107,108])))
+        self.assertTrue(not a9)
         for i in xrange(5):
             fsst=MEDFileField1TSStructItem.BuildItemFrom(fields[0][i],mst)
             fields[0][i].loadArraysIfNecessary()
@@ -380,10 +391,11 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,5):
             self.assertTrue(fcscp.isDataSetSupportEqualToThePreviousOne(i,fields))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,67,70,73,76,80,84,88,92,96])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,100,104,108,112,117,122,127,132])))
         self.assertTrue(a3.isEqual(DataArrayInt([2,0,1,2,1,2,2,2,0,2,3,4,2,4,5,2,5,3,2,6,7,2,7,8,2,8,6,2,9,10,2,10,11,2,11,9,2,12,13,2,13,14,2,14,15,2,15,12,2,16,17,2,17,18,2,18,19,2,19,16,2,20,21,2,21,22,2,22,23,2,23,20,2,24,25,2,25,26,2,26,27,2,27,24,2,28,29,2,29,30,2,30,31,2,31,28,3,0,1,2,3,3,4,5,3,6,7,8,3,9,10,11,4,12,13,14,15,4,16,17,18,19,4,20,21,22,23,4,24,25,26,27,4,28,29,30,31])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -538,10 +550,11 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,3):
             self.assertTrue(fcscp.isDataSetSupportEqualToThePreviousOne(i,fields))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,67,70,73,76,80,84,88,92,96])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,100,104,108,112,117,122,127,132])))
         self.assertTrue(a3.isEqual(DataArrayInt([2,0,1,2,1,2,2,2,0,2,3,4,2,4,5,2,5,3,2,6,7,2,7,8,2,8,6,2,9,10,2,10,11,2,11,9,2,12,13,2,13,14,2,14,15,2,15,12,2,16,17,2,17,18,2,18,19,2,19,16,2,20,21,2,21,22,2,22,23,2,23,20,2,24,25,2,25,26,2,26,27,2,27,24,2,28,29,2,29,30,2,30,31,2,31,28,3,0,1,2,3,3,4,5,3,6,7,8,3,9,10,11,4,12,13,14,15,4,16,17,18,19,4,20,21,22,23,4,24,25,26,27,4,28,29,30,31])))
         assert a4 is None
         assert a5 is None
@@ -567,10 +580,11 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,2):
             self.assertTrue(fcscp.isDataSetSupportEqualToThePreviousOne(i,fields))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,5,5,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,9,12,16,20,24,28,32])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,12,16,21,26,31,36])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,0,1,2,3,3,4,5,3,6,7,8,3,9,10,11,4,12,13,14,15,4,16,17,18,19,4,20,21,22,23,4,24,25,26,27,4,28,29,30,31])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -788,10 +802,11 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,5):
             self.assertTrue(fcscp.isDataSetSupportEqualToThePreviousOne(i,fields))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,5,5,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,9,12,16,20,24,28,32])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,12,16,21,26,31,36])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,0,1,2,3,3,4,5,3,6,7,8,3,9,10,11,4,12,13,14,15,4,16,17,18,19,4,20,21,22,23,4,24,25,26,27,4,28,29,30,31])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -845,6 +860,8 @@ class MEDLoaderTest4(unittest.TestCase):
         m.insertNextCell(NORM_QUAD4,[0,5,6,1]) ; m.insertNextCell(NORM_QUAD4,[1,6,7,2]) ; m.insertNextCell(NORM_QUAD4,[5,10,11,6]) ; m.insertNextCell(NORM_QUAD4,[6,11,12,7])
         m.insertNextCell(NORM_QUAD4,[12,13,8,7])
         mm=MEDFileUMesh() ; mm.setMeshes([m])
+        fam=DataArrayInt(11) ; fam.iota(0) ; mm.setFamilyFieldArr(0,fam) ; del fam
+        num=DataArrayInt(11) ; num.iota(100) ; mm.setRenumFieldArr(0,num) ; del num
         #
         fieldName1="zeField1" ; pfl1=DataArrayInt([0,1,2,3,4,5]) ; pfl1.setName("pfl1") # on cells
         fieldName2="zeField2" ; pfl2=DataArrayInt([2,3,4,7,8,9,13,14]) ; pfl2.setName("pfl2") # on nodes
@@ -911,13 +928,20 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,5):
             self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp[pfl2].changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,5,5,5,5])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,9,12,15,18])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,12,16,20])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,0,3,1,3,3,4,1,3,1,4,2,3,4,5,2,3,6,5,4,3,6,7,5])))
         assert a4 is None
         assert a5 is None
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,1,2,3,4,5])))
+        self.assertTrue(not a7)
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([100,101,102,103,104,105])))
+        self.assertTrue(not a9)
         for i in xrange(5):
             nbOfT=[6,8]
             fieldNames=[fieldName1,fieldName2]
@@ -941,13 +965,20 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,5):
             self.assertTrue(fcscp.isDataSetSupportEqualToThePreviousOne(i,fields))
             pass
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,5,5,5,5,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,9,12,15,18,22,26])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,12,16,20,24,29])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,2,7,3,3,7,8,3,3,3,8,4,3,8,9,4,3,13,9,8,3,13,14,9,4,6,11,12,7,4,12,13,8,7])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,1,2,3,4,5,9,10])))
+        self.assertTrue(not a7)
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([100,101,102,103,104,105,109,110])))
+        self.assertTrue(not a9)
         for i in xrange(5):
             f=allFMTSLeavesPerCommonSupport[1][0][0][i]
             fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
@@ -969,6 +1000,9 @@ class MEDLoaderTest4(unittest.TestCase):
         coordsY=DataArrayDouble([0,1.7,3.4]) ; coordsY.setInfoOnComponents(["YYY [km]"])
         m.setCoords(coordsX,coordsY)
         mm=MEDFileCMesh() ; mm.setMesh(m)
+        fam=DataArrayInt(8) ; fam.iota(0) ; mm.setFamilyFieldArr(0,fam) ; del fam
+        num=DataArrayInt(8) ; num.iota(100) ; mm.setRenumFieldArr(0,num) ; del num
+        num=DataArrayInt(15) ; num.iota(200) ; mm.setRenumFieldArr(1,num) ; del num
         #
         fieldName0="zeField0" ; # on cells
         fieldName1="zeField1" ; pfl1=DataArrayInt([2,3,6,7]) ; pfl1.setName("pfl1") # on cells
@@ -1059,6 +1093,15 @@ class MEDLoaderTest4(unittest.TestCase):
         for i in xrange(1,5):
             self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
             pass
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,1,2,3,4,5,6,7])))
+        self.assertTrue(a7) # True because no copy
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([100,101,102,103,104,105,106,107])))
+        self.assertTrue(a9) # True because no copy
+        a10,a11=mml2.retrieveNumberIdsOnNodes()
+        self.assertTrue(a10.isEqual(DataArrayInt([200,201,202,203,204,205,206,207,208,209,210,211,212,213,214])))
+        self.assertTrue(a11) # True because no copy
         for i in xrange(5):
             f=allFMTSLeavesPerCommonSupport[0][0][0][i]
             fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
@@ -1086,6 +1129,15 @@ class MEDLoaderTest4(unittest.TestCase):
         a,b=mml2.buildVTUArrays()
         self.assertTrue(a.isEqual(coordsX[[2,3,4]],1e-12))
         self.assertTrue(b.isEqual(coordsY,1e-12))
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([2,3,6,7])))
+        self.assertTrue(not a7) # False because copy
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([102,103,106,107])))
+        self.assertTrue(not a9) # False because copy
+        a10,a11=mml2.retrieveNumberIdsOnNodes()
+        self.assertTrue(a10.isEqual(DataArrayInt([202,203,204,207,208,209,212,213,214])))
+        self.assertTrue(not a11) # False because copy
         for i in xrange(1,5):
             self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
             pass
@@ -1113,15 +1165,22 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev)) # here the 3rd support is a part of CMesh but impossible to simplify more than a UMesh
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         a0Exp=DataArrayDouble([0.,0.,1.1,0.,2.2,0.,3.3,0.,4.4,0.,0.,1.7,1.1,1.7,2.2,1.7,3.3,1.7,4.4,1.7,0.,3.4,1.1,3.4,2.2,3.4,3.3,3.4,4.4,3.4],15,2)
         a0Exp.setInfoOnComponents(["XX [m]","YYY [km]"])
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([4,8,12,16])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15])))
         self.assertTrue(a3.isEqual(DataArrayInt([4,3,2,7,8,4,4,3,8,9,4,7,6,11,12,4,9,8,13,14])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([2,3,5,7])))
+        self.assertTrue(not a7) # False because copy
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([102,103,105,107])))
+        self.assertTrue(not a9) # False because copy
         for i in xrange(5):
             f=allFMTSLeavesPerCommonSupport[2][0][0][i]
             fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
@@ -1144,6 +1203,8 @@ class MEDLoaderTest4(unittest.TestCase):
         a0Exp.setInfoOnComponents(["XX [m]","YYY [km]"])
         m.setCoords(a0Exp)
         mm=MEDFileCurveLinearMesh() ; mm.setMesh(m)
+        fam=DataArrayInt(8) ; fam.iota(0) ; mm.setFamilyFieldArr(0,fam) ; del fam
+        num=DataArrayInt(8) ; num.iota(100) ; mm.setRenumFieldArr(0,num) ; del num
         #
         fieldName0="zeField0" ; # on cells
         fieldName1="zeField1" ; pfl1=DataArrayInt([2,3,6,7]) ; pfl1.setName("pfl1") # on cells
@@ -1231,6 +1292,12 @@ class MEDLoaderTest4(unittest.TestCase):
         a,b=mml2.buildVTUArrays()
         self.assertTrue(a.isEqual(a0Exp,1e-12))
         self.assertEqual(b,[5,3])
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,1,2,3,4,5,6,7])))
+        self.assertTrue(a7) # True because no copy
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([100,101,102,103,104,105,106,107])))
+        self.assertTrue(a9) # True because no copy
         for i in xrange(1,5):
             self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
             pass
@@ -1261,6 +1328,12 @@ class MEDLoaderTest4(unittest.TestCase):
         a,b=mml2.buildVTUArrays()
         self.assertTrue(a.isEqual(a0Exp[pfl2],1e-12))
         self.assertEqual(b,[3,3])
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([2,3,6,7])))
+        self.assertTrue(not a7) # False because copy
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([102,103,106,107])))
+        self.assertTrue(not a9) # False because copy
         for i in xrange(1,5):
             self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
             pass
@@ -1288,15 +1361,22 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev)) # here the 3rd support is a part of CMesh but impossible to simplify more than a UMesh
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         a0Exp=DataArrayDouble([0.,0.,1.1,0.,2.2,0.,3.3,0.,4.4,0.,0.,1.7,1.1,1.7,2.2,1.7,3.3,1.7,4.4,1.7,0.,3.4,1.1,3.4,2.2,3.4,3.3,3.4,4.4,3.4],15,2)
         a0Exp.setInfoOnComponents(["XX [m]","YYY [km]"])
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([4,8,12,16])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15])))
         self.assertTrue(a3.isEqual(DataArrayInt([4,3,2,7,8,4,4,3,8,9,4,7,6,11,12,4,9,8,13,14])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([2,3,5,7])))
+        self.assertTrue(not a7) # False because copy
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([102,103,105,107])))
+        self.assertTrue(not a9) # False because copy
         for i in xrange(5):
             f=allFMTSLeavesPerCommonSupport[2][0][0][i]
             fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
@@ -1399,10 +1479,11 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,5,5,5,5,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,9,12,15,18,22,26,30,34,38])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,12,16,20,24,29,34,39,44])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,2,7,3,3,7,8,3,3,3,8,4,3,8,9,4,3,13,9,8,3,13,14,9,4,0,5,6,1,4,1,6,7,2,4,5,10,11,6,4,6,11,12,7,4,12,13,8,7])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -1541,10 +1622,11 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp[pfl2].changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,10,14,18])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,13,18])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,1,4,2,3,4,5,2,4,0,3,4,1,4,3,6,7,4,4,7,8,5,4])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -1668,10 +1750,11 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp[pfl1].changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([5,5,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([3,6,10,14,18])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,4,8,13,18])))
         self.assertTrue(a3.isEqual(DataArrayInt([3,1,4,2,3,4,5,2,4,0,3,4,1,4,3,6,7,4,4,7,8,5,4])))
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -1765,10 +1848,11 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75])))
         self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,5,6,4,3,2,7,8,4,4,3,8,9,4,6,5,10,11,4,9,8,13,14,4,19,18,23,24,4,2,1,6,7,4,7,6,11,12,4,11,10,15,16,4,12,11,16,17,4,8,7,12,13,4,13,12,17,18,4,17,16,21,22,4,14,13,18,19,4,16,15,20,21,4,18,17,22,23]))) # <- here the mesh is renumbered : the mesh is equal to m[[0,2,3,4,7,15, 1,5,8,9, 6,10,13, 11,12,14]]
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -1854,10 +1938,11 @@ class MEDLoaderTest4(unittest.TestCase):
         mml=fcscp.buildFromScratchDataSetSupport(0,fields)
         mml2=mml.prepare()
         self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-        a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
         self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
         self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
-        self.assertTrue(a2.isEqual(DataArrayInt([4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75])))
         self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,5,6,4,2,1,6,7,4,3,2,7,8,4,4,3,8,9,4,6,5,10,11,4,7,6,11,12,4,8,7,12,13,4,9,8,13,14,4,11,10,15,16,4,12,11,16,17,4,13,12,17,18,4,14,13,18,19,4,16,15,20,21,4,17,16,21,22,4,18,17,22,23,4,19,18,23,24]))) # <- here the mesh is NOT renumbered : the mesh is equal to m
         self.assertTrue(a4 is None)
         self.assertTrue(a5 is None)
@@ -1967,10 +2052,11 @@ class MEDLoaderTest4(unittest.TestCase):
             mml=fcscp.buildFromScratchDataSetSupport(0,fields)
             mml2=mml.prepare()
             self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-            a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            self.assertTrue(ncc)
             self.assertTrue(a0.isEqual(a0Exp,1e-12))
             self.assertTrue(a1.isEqual(DataArrayByte([12,12,42,42,42])))
-            self.assertTrue(a2.isEqual(DataArrayInt([8,16,24,32,40])))
+            self.assertTrue(a2.isEqual(DataArrayInt([0,9,18,27,36])))
             self.assertTrue(a3.isEqual(DataArrayInt([8,1,0,6,7,13,12,18,19,8,2,1,7,8,14,13,19,20,8,2,3,8,9,14,15,20,21,8,3,4,9,10,15,16,21,22,8,4,5,10,11,16,17,22,23])))
             self.assertTrue(a4.isEqual(DataArrayInt([-1,-1,0,31,62])))
             self.assertTrue(a5.isEqual(DataArrayInt([6,4,3,2,8,9,4,15,21,20,14,4,3,15,14,2,4,2,14,20,8,4,8,20,21,9,4,9,21,15,3,6,4,4,3,9,10,4,16,22,21,15,4,4,16,15,3,4,3,15,21,9,4,9,21,22,10,4,10,22,16,4,6,4,5,4,10,11,4,17,23,22,16,4,5,17,16,4,4,4,16,22,10,4,10,22,23,11,4,11,23,17,5])))
@@ -2002,10 +2088,11 @@ class MEDLoaderTest4(unittest.TestCase):
             mml=fcscp.buildFromScratchDataSetSupport(0,fields)
             mml2=mml.prepare()
             self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-            a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            self.assertTrue(ncc)
             self.assertTrue(a0.isEqual(a0Exp,1e-12))
             self.assertTrue(a1.isEqual(DataArrayByte([42,42])))
-            self.assertTrue(a2.isEqual(DataArrayInt([8,16])))
+            self.assertTrue(a2.isEqual(DataArrayInt([0,9])))
             self.assertTrue(a3.isEqual(DataArrayInt([8,2,3,8,9,14,15,20,21,8,3,4,9,10,15,16,21,22])))
             self.assertTrue(a4.isEqual(DataArrayInt([0,31])))
             self.assertTrue(a5.isEqual(DataArrayInt([6,4,3,2,8,9,4,15,21,20,14,4,3,15,14,2,4,2,14,20,8,4,8,20,21,9,4,9,21,15,3,6,4,4,3,9,10,4,16,22,21,15,4,4,16,15,3,4,3,15,21,9,4,9,21,22,10,4,10,22,16,4])))
@@ -2028,10 +2115,11 @@ class MEDLoaderTest4(unittest.TestCase):
             mml=fcscp.buildFromScratchDataSetSupport(0,fields)
             mml2=mml.prepare()
             self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-            a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            self.assertTrue(ncc)
             self.assertTrue(a0.isEqual(a0Exp,1e-12))
             self.assertTrue(a1.isEqual(DataArrayByte([42,42,42])))
-            self.assertTrue(a2.isEqual(DataArrayInt([8,16,24])))
+            self.assertTrue(a2.isEqual(DataArrayInt([0,9,18])))
             self.assertTrue(a3.isEqual(DataArrayInt([8,2,3,8,9,14,15,20,21,8,3,4,9,10,15,16,21,22,8,4,5,10,11,16,17,22,23])))
             self.assertTrue(a4.isEqual(DataArrayInt([0,31,62])))
             self.assertTrue(a5.isEqual(DataArrayInt([6,4,3,2,8,9,4,15,21,20,14,4,3,15,14,2,4,2,14,20,8,4,8,20,21,9,4,9,21,15,3,6,4,4,3,9,10,4,16,22,21,15,4,4,16,15,3,4,3,15,21,9,4,9,21,22,10,4,10,22,16,4,6,4,5,4,10,11,4,17,23,22,16,4,5,17,16,4,4,4,16,22,10,4,10,22,23,11,4,11,23,17,5])))
@@ -2113,17 +2201,23 @@ class MEDLoaderTest4(unittest.TestCase):
             mml=fcscp.buildFromScratchDataSetSupport(0,fields)
             mml2=mml.prepare()
             self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
-            a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+            self.assertTrue(ncc)
             self.assertTrue(a0.isEqual(a0Exp,1e-12))
             self.assertTrue(a1.isEqual(DataArrayByte([42,42,42])))
-            self.assertTrue(a2.isEqual(DataArrayInt([8,16,24])))
+            self.assertTrue(a2.isEqual(DataArrayInt([0,9,18])))
             self.assertTrue(a3.isEqual(DataArrayInt([8,2,3,8,9,14,15,20,21,8,3,4,9,10,15,16,21,22,8,4,5,10,11,16,17,22,23])))
             self.assertTrue(a4.isEqual(DataArrayInt([0,31,62])))
             self.assertTrue(a5.isEqual(DataArrayInt([6,4,3,2,8,9,4,15,21,20,14,4,3,15,14,2,4,2,14,20,8,4,8,20,21,9,4,9,21,15,3,6,4,4,3,9,10,4,16,22,21,15,4,4,16,15,3,4,3,15,21,9,4,9,21,22,10,4,10,22,16,4,6,4,5,4,10,11,4,17,23,22,16,4,5,17,16,4,4,4,16,22,10,4,10,22,23,11,4,11,23,17,5])))
             for i in xrange(1,5):
                 self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
                 pass
-            pass
+            a6,a7=mml2.retrieveFamilyIdsOnCells()
+            self.assertTrue(a6.isEqual(DataArrayInt([0,0,0])))
+            self.assertTrue(a7)
+            a8,a9=mml2.retrieveNumberIdsOnCells()
+            self.assertTrue(a8 is None)
+            self.assertTrue(a9)
             for i in xrange(5):
                 f=allFMTSLeavesPerCommonSupport[0][0][0][i]
                 fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
@@ -2154,7 +2248,7 @@ class MEDLoaderTest4(unittest.TestCase):
         """
         fname="ForMEDReader15.med"
         m0=MEDCouplingCMesh()
-        arr=DataArrayDouble(5) ; arr.iota(0)
+        arr=DataArrayDouble(3) ; arr.iota(0)
         m0.setCoords(arr,arr,arr)
         m0.setName("mesh")
         m0=m0.buildUnstructured()
@@ -2170,6 +2264,8 @@ class MEDLoaderTest4(unittest.TestCase):
         #
         mm=MEDFileUMesh()
         mm.setMeshAtLevel(0,m0)
+        fam=DataArrayInt(8) ; fam.iota(0) ; mm.setFamilyFieldArr(0,fam) ; del fam
+        num=DataArrayInt(8) ; num.iota(100) ; mm.setRenumFieldArr(0,num) ; del num
         #
         ffs=MEDFileFieldMultiTS()
         # TimeStep 0
@@ -2236,9 +2332,841 @@ class MEDLoaderTest4(unittest.TestCase):
         mm.write(fname,2)
         ffs.write(fname,0)
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
-        
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),2)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1) # one time serie here : because the 2 fields are defined on the same time steps
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),2)
+        allFMTSLeavesPerCommonSupport=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesPerTimeSeries[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport[0][0]),2)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(ncc)
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.,0.,2.,0.,1.,2.,0.,2.,2.,0.,0.,0.,1.,1.,0.,1.,2.,0.,1.,0.,1.,1.,1.,1.,1.,2.,1.,1.,0.,2.,1.,1.,2.,1.,2.,2.,1.,0.,0.,2.,1.,0.,2.,2.,0.,2.,0.,1.,2.,1.,1.,2.,2.,1.,2.,0.,2.,2.,1.,2.,2.,2.,2.,2.0],27,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([12,12,12,12,12,12,12,12])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,9,18,27,36,45,54,63])))
+        self.assertTrue(a3.isEqual(DataArrayInt([8,1,0,3,4,10,9,12,13,8,2,1,4,5,11,10,13,14,8,4,3,6,7,13,12,15,16,8,5,4,7,8,14,13,16,17,8,10,9,12,13,19,18,21,22,8,11,10,13,14,20,19,22,23,8,13,12,15,16,22,21,24,25,8,14,13,16,17,23,22,25,26])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,1,2,3,4,5,6,7])))
+        self.assertTrue(a7) # no copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([100,101,102,103,104,105,106,107])))
+        self.assertTrue(a9) # no copy here
         pass
 
+    def test16(self):
+        """ Here 2 meshes "mesh1" and "mesh2" and 4 fields (no profiles here) :
+        - "zeField1_0" (CELLS) and "zeField2_0" (NODES) on "mesh1"
+        - "zeField3_1" (CELLS) and "zeField4_1" (NODES) on "mesh2"
+        time steps series are the same for the whole 4 fields
+        """
+        fname="ForMEDReader16.med"
+        m0=MEDCouplingCMesh()
+        arr=DataArrayDouble(3) ; arr.iota(0)
+        m0.setCoords(arr,arr,arr)
+        m0.setName("mesh1")
+        m0=m0.buildUnstructured()
+        #
+        fCell1=MEDCouplingFieldDouble(ON_CELLS)
+        fCell1.setName("zeField1_0")
+        fCell1.setMesh(m0)
+        #
+        fNode1=MEDCouplingFieldDouble(ON_NODES)
+        fNode1.setName("zeField2_0")
+        fNode1.setMesh(m0)
+        #
+        mms=MEDFileMeshes()
+        mm1=MEDFileUMesh()
+        mm1.setMeshAtLevel(0,m0)
+        fam=DataArrayInt([0,1,0,1,2,3,2,3]); mm1.setFamilyFieldArr(0,fam) ; del fam
+        num=DataArrayInt(8) ; num.iota(100) ; mm1.setRenumFieldArr(0,num) ; del num
+        mm1.setFamilyId("FAMILLE_ZERO",0) ; mm1.setFamilyId("Family1_1",1) ; mm1.setFamilyId("Family1_2",2) ; mm1.setFamilyId("Family1_3",3) ; mm1.setFamilyId("Family1_4",4)
+        mm1.setFamiliesIdsOnGroup("Grp1_1",[0,1]) ; mm1.setFamiliesIdsOnGroup("Grp1_2",[2,3])
+        mms.pushMesh(mm1) ; del mm1
+        #
+        m1=m0.deepCpy() ; m1.translate([2.5,0.,0.]) ; m1.setName("mesh2")
+        #
+        fCell2=MEDCouplingFieldDouble(ON_CELLS)
+        fCell2.setName("zeField3_1")
+        fCell2.setMesh(m1)
+        #
+        fNode2=MEDCouplingFieldDouble(ON_NODES)
+        fNode2.setName("zeField4_1")
+        fNode2.setMesh(m1)
+        #
+        mm2=MEDFileUMesh()
+        mm2.setMeshAtLevel(0,m1)
+        fam=DataArrayInt([0,1,0,1,2,3,2,3]); mm2.setFamilyFieldArr(0,fam) ; del fam
+        num=DataArrayInt(8) ; num.iota(200) ; mm2.setRenumFieldArr(0,num) ; del num
+        mm2.setFamilyId("FAMILLE_ZERO",0) ; mm2.setFamilyId("Family2_1",1) ; mm2.setFamilyId("Family2_2",2) ; mm2.setFamilyId("Family2_3",3) ; mm2.setFamilyId("Family2_4",4)
+        mm2.setFamiliesIdsOnGroup("Grp2_1",[0,1]) ; mm2.setFamiliesIdsOnGroup("Grp2_2",[2,3]) ; mm2.setFamiliesIdsOnGroup("Grp2_3",[1,2,3])
+        mms.pushMesh(mm2) ; del mm2
+        ffs1_1=MEDFileFieldMultiTS()
+        ffs1_2=MEDFileFieldMultiTS()
+        ffs2_1=MEDFileFieldMultiTS()
+        ffs2_2=MEDFileFieldMultiTS()
+        mts=MEDFileFields()
+        for elt in ffs1_1,ffs1_2,ffs2_1,ffs2_2:
+            mts.pushField(elt)
+            pass
+        # TimeStep 0
+        t=(1.,0,0) ; off=0.
+        f1ts1=MEDFileField1TS()
+        f1ts2=MEDFileField1TS()
+        a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
+        fCell1.setArray(a)
+        fCell1.setTime(*t)
+        fCell1.checkCoherency()
+        a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
+        a=a.negate()
+        fNode1.setArray(a)
+        fNode1.setTime(*t)
+        fNode1.checkCoherency()
+        f1ts1.setFieldNoProfileSBT(fCell1) ; ffs1_1.pushBackTimeStep(f1ts1)
+        f1ts2.setFieldNoProfileSBT(fNode1) ; ffs1_2.pushBackTimeStep(f1ts2)
+        #
+        f1ts1=MEDFileField1TS()
+        f1ts2=MEDFileField1TS()
+        a=DataArrayDouble(m1.getNumberOfCells()) ; a.iota(1000.+off) ; a.setInfoOnComponents(["xx [m]"])
+        fCell2.setArray(a)
+        fCell2.setTime(*t)
+        fCell2.checkCoherency()
+        a=DataArrayDouble(m1.getNumberOfNodes()) ; a.iota(1000+off) ; a.setInfoOnComponents(["xx [m]"])
+        a=a.negate()
+        fNode2.setArray(a)
+        fNode2.setTime(*t)
+        fNode2.checkCoherency()
+        f1ts1.setFieldNoProfileSBT(fCell2) ; ffs2_1.pushBackTimeStep(f1ts1)
+        f1ts2.setFieldNoProfileSBT(fNode2) ; ffs2_2.pushBackTimeStep(f1ts2)
+        # TimeStep 1
+        t=(2.1,1,0) ; off=100.
+        f1ts1=MEDFileField1TS()
+        f1ts2=MEDFileField1TS()
+        a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
+        fCell1.setArray(a)
+        fCell1.setTime(*t)
+        fCell1.checkCoherency()
+        a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
+        a=a.negate()
+        fNode1.setArray(a)
+        fNode1.setTime(*t)
+        fNode1.checkCoherency()
+        f1ts1.setFieldNoProfileSBT(fCell1) ; ffs1_1.pushBackTimeStep(f1ts1)
+        f1ts2.setFieldNoProfileSBT(fNode1) ; ffs1_2.pushBackTimeStep(f1ts2)
+        #
+        f1ts1=MEDFileField1TS()
+        f1ts2=MEDFileField1TS()
+        a=DataArrayDouble(m1.getNumberOfCells()) ; a.iota(1000.+off) ; a.setInfoOnComponents(["xx [m]"])
+        fCell2.setArray(a)
+        fCell2.setTime(*t)
+        fCell2.checkCoherency()
+        a=DataArrayDouble(m1.getNumberOfNodes()) ; a.iota(1000+off) ; a.setInfoOnComponents(["xx [m]"])
+        a=a.negate()
+        fNode2.setArray(a)
+        fNode2.setTime(*t)
+        fNode2.checkCoherency()
+        f1ts1.setFieldNoProfileSBT(fCell2) ; ffs2_1.pushBackTimeStep(f1ts1)
+        f1ts2.setFieldNoProfileSBT(fNode2) ; ffs2_2.pushBackTimeStep(f1ts2)
+        # TimeStep 2
+        t=(3.1,2,0) ; off=200.
+        f1ts1=MEDFileField1TS()
+        f1ts2=MEDFileField1TS()
+        a=DataArrayDouble(m0.getNumberOfCells()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
+        fCell1.setArray(a)
+        fCell1.setTime(*t)
+        fCell1.checkCoherency()
+        a=DataArrayDouble(m0.getNumberOfNodes()) ; a.iota(off) ; a.setInfoOnComponents(["xx [m]"])
+        a=a.negate()
+        fNode1.setArray(a)
+        fNode1.setTime(*t)
+        fNode1.checkCoherency()
+        f1ts1.setFieldNoProfileSBT(fCell1) ; ffs1_1.pushBackTimeStep(f1ts1)
+        f1ts2.setFieldNoProfileSBT(fNode1) ; ffs1_2.pushBackTimeStep(f1ts2)
+        #
+        f1ts1=MEDFileField1TS()
+        f1ts2=MEDFileField1TS()
+        a=DataArrayDouble(m1.getNumberOfCells()) ; a.iota(1000.+off) ; a.setInfoOnComponents(["xx [m]"])
+        fCell2.setArray(a)
+        fCell2.setTime(*t)
+        fCell2.checkCoherency()
+        a=DataArrayDouble(m1.getNumberOfNodes()) ; a.iota(1000+off) ; a.setInfoOnComponents(["xx [m]"])
+        a=a.negate()
+        fNode2.setArray(a)
+        fNode2.setTime(*t)
+        fNode2.checkCoherency()
+        f1ts1.setFieldNoProfileSBT(fCell2) ; ffs2_1.pushBackTimeStep(f1ts1)
+        f1ts2.setFieldNoProfileSBT(fNode2) ; ffs2_2.pushBackTimeStep(f1ts2)
+        #
+        mms.write(fname,2) ; mts.write(fname,0)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),2)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),2)
+        self.assertEqual(len(allFMTSLeavesToDisplay[1]),2)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1) # one time serie here : because the 2 fields are defined on the same time steps
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),4)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),2)
+        allFMTSLeavesPerCommonSupport2=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport2),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport2[0][0]),2)
+        pass
+
+    def test17(self):
+        """ First test on GAUSS_NE (Elno). Here no Profiles.
+        2 times steps.
+        """
+        fname="ForMEDReader17.med"
+        fieldName1="MyFirstElno"
+        fieldName2="ACellField"
+        fieldName3="ANodeField"
+        coo=DataArrayDouble([0.,0.,1.,0.,2.,0.,0.,1.,1.,1.,2.,1.],6,2)
+        m=MEDCouplingUMesh("mesh",2)
+        m.setCoords(coo)
+        m.allocateCells()
+        m.insertNextCell(NORM_QUAD4,[0,3,4,1])
+        m.insertNextCell(NORM_QUAD4,[1,4,5,2])
+        m.checkCoherency2()
+        #
+        t=(1.1,0,-1)
+        f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setTime(*t) ; f.setMesh(m)
+        f.setArray(DataArrayDouble([3.,5.,7.,6.,2.,3.,11.,8.]))
+        f.setName(fieldName1)
+        f.checkCoherency()
+        MEDLoader.WriteField(fname,f,True)
+        f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
+        f2.setArray(DataArrayDouble([7.,11.],2,1))
+        f2.setName(fieldName2)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+        f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
+        f3.setArray(DataArrayDouble([1.,2.,4.,1.,2.,4.],6,1))
+        f3.setName(fieldName3)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+        #
+        t=(2.1,1,-1)
+        f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setTime(*t) ; f.setMesh(m)
+        f.setArray(DataArrayDouble([7.,6.,3.,5.,11.,8.,2.,3.]))
+        f.setName(fieldName1)
+        f.checkCoherency()
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+        f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
+        f2.setArray(DataArrayDouble([11.,7.],2,1))
+        f2.setName(fieldName2)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+        f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
+        f3.setArray(DataArrayDouble([4.,2.,1.,4.,2.,1.],6,1))
+        f3.setName(fieldName3)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),3)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),3)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),3)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc) # spaceDim 2 -> VTK wants 3D
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.],6,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,0,3,4,1,4,1,4,5,2])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,0])))
+        self.assertTrue(a7) # no copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([0,1])))
+        self.assertTrue(a9) # no copy here
+        for i in xrange(1,2):
+            self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
+            pass
+        vExp0=[DataArrayDouble([7.,11.]),DataArrayDouble([11.,7.])]
+        vExp1=[DataArrayDouble([3.,5.,7.,6.,2.,3.,11.,8.]),DataArrayDouble([7.,6.,3.,5.,11.,8.,2.,3.])]
+        for i in xrange(2):
+            f=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName2)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            self.assertTrue(v.isEqual(vExp0[i],1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport1[0][0][1][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName1)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            self.assertTrue(v.isEqual(vExp1[i],1e-12))
+            pass
+        pass
+    
+    def test18(self):
+        """ First test on GAUSS_PT. Here no Profiles. 2 times steps.
+        """
+        fname="ForMEDReader18.med"
+        fieldName1="MyFirstGauss"
+        fieldName2="ACellField"
+        fieldName3="ANodeField"
+        coo=DataArrayDouble([0.,0.,1.,0.,2.,0.,0.,1.,1.,1.,2.,1.],6,2)
+        m=MEDCouplingUMesh("mesh",2)
+        m.setCoords(coo)
+        m.allocateCells()
+        m.insertNextCell(NORM_QUAD4,[0,3,4,1])
+        m.insertNextCell(NORM_QUAD4,[1,4,5,2])
+        m.checkCoherency2()
+        #
+        t=(1.1,0,-1)
+        f=MEDCouplingFieldDouble(ON_GAUSS_PT) ; f.setTime(*t) ; f.setMesh(m)
+        f.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.2,0.2,0.8,0.8],[0.7,0.3])
+        f.setArray(DataArrayDouble([3.,5.,4.,6.])) ; f.getArray().setInfoOnComponents(["Smth"])
+        f.setName(fieldName1)
+        f.checkCoherency()
+        MEDLoader.WriteField(fname,f,True)
+        f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
+        f2.setArray(DataArrayDouble([7.,11.],2,1))
+        f2.setName(fieldName2)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+        f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
+        f3.setArray(DataArrayDouble([1.,2.,4.,1.,2.,4.],6,1))
+        f3.setName(fieldName3)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+        #
+        t=(2.1,1,-1)
+        f=MEDCouplingFieldDouble(ON_GAUSS_PT) ; f.setTime(*t) ; f.setMesh(m)
+        f.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.2,0.2,0.8,0.8],[0.7,0.3])
+        f.setArray(DataArrayDouble([5.,3.,6.,4.])) ; f.getArray().setInfoOnComponents(["Smth"])
+        f.setName(fieldName1)
+        f.checkCoherency()
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+        f2=MEDCouplingFieldDouble(ON_CELLS) ; f2.setTime(*t) ; f2.setMesh(m)
+        f2.setArray(DataArrayDouble([11.,7.],2,1))
+        f2.setName(fieldName2)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2)
+        f3=MEDCouplingFieldDouble(ON_NODES) ; f3.setTime(*t) ; f3.setMesh(m)
+        f3.setArray(DataArrayDouble([4.,2.,1.,4.,2.,1.],6,1))
+        f3.setName(fieldName3)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),3)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),3)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),3)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc) # spaceDim 2 -> VTK wants 3D
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.],6,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,0,3,4,1,4,1,4,5,2])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,0])))
+        self.assertTrue(a7) # no copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([0,1])))
+        self.assertTrue(a9) # no copy here
+        for i in xrange(1,2):
+            self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
+            pass
+        vExp0=[DataArrayDouble([7.,11.]),DataArrayDouble([11.,7.])]
+        vExp1=[DataArrayDouble([3.,5.,4.,6.]),DataArrayDouble([5.,3.,6.,4.])]
+        for i in xrange(2):
+            f=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName2)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            self.assertTrue(v.isEqual(vExp0[i],1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport1[0][0][1][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName1)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp1[i].setInfoOnComponents(["Smth"])
+            self.assertTrue(v.isEqual(vExp1[i],1e-12))
+            pass
+        ## Now same exercise but with a different load strategy. All is load directly.
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname) # here all is read, the SauvReader (or other Reader) is emulated
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),3)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),3)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),3)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc) # spaceDim 2 -> VTK wants 3D
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.],6,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,0,3,4,1,4,1,4,5,2])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,0])))
+        self.assertTrue(a7) # no copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([0,1])))
+        self.assertTrue(a9) # no copy here
+        for i in xrange(1,2):
+            self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
+            pass
+        vExp0=[DataArrayDouble([7.,11.]),DataArrayDouble([11.,7.])]
+        vExp1=[DataArrayDouble([3.,5.,4.,6.]),DataArrayDouble([5.,3.,6.,4.])]
+        for i in xrange(2):
+            f=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst) # no load needed here
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName2)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            self.assertTrue(v.isEqual(vExp0[i],1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport1[0][0][1][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst) # no load needed here
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName1)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp1[i].setInfoOnComponents(["Smth"])
+            self.assertTrue(v.isEqual(vExp1[i],1e-12))
+            pass
+        pass
+    
+    def test19(self):
+        """
+        This test is a simple non profile CELL field but lying on cells of dimension -1 (not 0 as "usual").
+        """
+        fname="ForMEDReader19.med"
+        fieldName="ACellFieldOnDimM1"
+        coo=DataArrayDouble(3) ; coo.iota()
+        m=MEDCouplingCMesh() ; m.setCoords(coo,coo,coo) ; m.setName("mesh")
+        m0=m.buildUnstructured() ; del m
+        m1=m0.computeSkin()
+        #
+        mm=MEDFileUMesh()                                
+        mm.setMeshAtLevel(0,m0)
+        mm.setMeshAtLevel(-1,m1)
+        ff=MEDFileFieldMultiTS()
+        # time 0
+        t=(1.1,1,-1)
+        f=MEDCouplingFieldDouble(ON_CELLS) ; f.setTime(*t) ; f.setMesh(m1)
+        f.setName(fieldName)
+        arr=DataArrayDouble(24) ; arr.iota() ; arr.setInfoOnComponents(["AStr"])
+        f.setArray(arr)
+        f.checkCoherency()
+        f1ts=MEDFileField1TS() ; f1ts.setFieldNoProfileSBT(f)
+        ff.pushBackTimeStep(f1ts)
+        # time 1
+        t=(2.1,2,-2)
+        f=MEDCouplingFieldDouble(ON_CELLS) ; f.setTime(*t) ; f.setMesh(m1)
+        f.setName(fieldName)
+        arr=DataArrayDouble(24) ; arr.iota() ; arr.reverse() ; arr.setInfoOnComponents(["AStr"])
+        f.setArray(arr)
+        f.checkCoherency()
+        f1ts=MEDFileField1TS() ; f1ts.setFieldNoProfileSBT(f)
+        ff.pushBackTimeStep(f1ts)
+        #
+        mm.write(fname,2)
+        ff.write(fname,0)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),1)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),1)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(ncc)
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.,0.,2.,0.,1.,2.,0.,2.,2.,0.,0.,0.,1.,1.,0.,1.,2.,0.,1.,0.,1.,1.,1.,1.,1.,2.,1.,1.,0.,2.,1.,1.,2.,1.,2.,2.,1.,0.,0.,2.,1.,0.,2.,2.,0.,2.,0.,1.,2.,1.,1.,2.,2.,1.,2.,0.,2.,2.,1.,2.,2.,2.,2.,2.],27,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,3,4,4,1,10,9,0,4,0,9,12,3,4,2,1,4,5,4,2,11,10,1,4,5,14,11,2,4,4,3,6,7,4,3,12,15,6,4,6,15,16,7,4,5,4,7,8,4,7,16,17,8,4,8,17,14,5,4,19,22,21,18,4,10,19,18,9,4,9,18,21,12,4,20,23,22,19,4,11,20,19,10,4,14,23,20,11,4,22,25,24,21,4,12,21,24,15,4,15,24,25,16,4,23,26,25,22,4,16,25,26,17,4,17,26,23,14])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])))
+        self.assertTrue(a7) # no copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8 is None)
+        self.assertTrue(a9) # no copy here
+        a10,a11=mml2.retrieveFamilyIdsOnNodes()
+        self.assertTrue(not a10)
+        self.assertTrue(a11) # no copy here
+        a12,a13=mml2.retrieveNumberIdsOnNodes()
+        self.assertTrue(not a12)
+        self.assertTrue(a13) # no copy here
+        for i in xrange(1,2):
+            self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
+            pass
+        for i in xrange(2):
+            f=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp=DataArrayDouble(24) ; vExp.iota()
+            if i==1: vExp.reverse()
+            vExp.setInfoOnComponents(["AStr"])
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            pass
+        pass
+
+    def test20(self):
+        """ This test works with groups/families on cells AND on nodes. Here 4 fields each on same time steps (2).
+        1 field on CELLS without profile, 1 field on CELLS with profile, 1 field on NODES without profile, 1 field on NODES with profile.
+        All of these 4 fields lies on a single mesh "mesh". The 2 fields on profile lies on a same support.
+        One drawback of this test : no multi geom type. Coming soon !
+        """
+        fname="ForMEDReader20.med"
+        fieldName0="ANodeField"
+        fieldName1="ACellField"
+        fieldName2="ANodeFieldPfl"
+        fieldName3="ACellFieldPfl"
+        pfl2=DataArrayInt([5,6,7,10,11,12,15,16,17,20,21,22]) ; pfl2.setName("pfl2")
+        pfl3=DataArrayInt([4,5,8,9,12,13]) ; pfl3.setName("pfl3")
+        #
+        arr=DataArrayDouble(5) ; arr.iota()
+        m=MEDCouplingCMesh("mesh") ; m.setCoords(arr,arr)
+        m=m.buildUnstructured()
+        mm=MEDFileUMesh()
+        mm.setMeshAtLevel(0,m)
+        fs=MEDFileFields()
+        fmts0=MEDFileFieldMultiTS() ; fs.pushField(fmts0)
+        fmts0.setDtUnit("s")
+        fmts1=MEDFileFieldMultiTS() ; fs.pushField(fmts1)
+        fmts1.setDtUnit("s")
+        fmts2=MEDFileFieldMultiTS() ; fs.pushField(fmts2)
+        fmts2.setDtUnit("s")
+        fmts3=MEDFileFieldMultiTS() ; fs.pushField(fmts3)
+        fmts3.setDtUnit("s")
+        ####
+        t=(1.1,0,-2)
+        f0=MEDCouplingFieldDouble(ON_NODES) ; f0.setMesh(m)
+        f0.setName(fieldName0) ; f0.setTime(*t)
+        da=m.getCoords().magnitude() ; da.setInfoOnComponents(["zeInfo"])
+        f0.setArray(da)
+        f0.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldNoProfileSBT(f0)
+        fmts0.pushBackTimeStep(f1ts)
+        #
+        f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(m)
+        f1.setName(fieldName1) ; f1.setTime(*t)
+        da=m.getBarycenterAndOwner().magnitude() ; da.setInfoOnComponents(["zeInfoCell"])
+        f1.setArray(da)
+        f1.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldNoProfileSBT(f1)
+        fmts1.pushBackTimeStep(f1ts)
+        #
+        f2=MEDCouplingFieldDouble(ON_NODES) ; mTmp=m[pfl3] ; mTmp.zipCoords() ; mTmp.setName(m.getName()) ; f2.setMesh(mTmp)
+        f2.setName(fieldName2) ; f2.setTime(*t)
+        da=m.getCoords().magnitude()[pfl2] ; da.setInfoOnComponents(["zzzz"])
+        f2.setArray(da)
+        f2.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldProfile(f2,mm,0,pfl2)
+        fmts2.pushBackTimeStep(f1ts)
+        #
+        f3=MEDCouplingFieldDouble(ON_CELLS) ; mTmp=m[pfl3] ; mTmp.setName(m.getName()) ; f3.setMesh(mTmp)
+        f3.setName(fieldName3) ; f3.setTime(*t)
+        da=mTmp.getBarycenterAndOwner().magnitude() ; da.setInfoOnComponents(["abcdefg"])
+        f3.setArray(da)
+        f3.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldProfile(f3,mm,0,pfl3)
+        fmts3.pushBackTimeStep(f1ts)
+        ####
+        t=(2.1,1,-3)
+        f0=MEDCouplingFieldDouble(ON_NODES) ; f0.setMesh(m)
+        f0.setName(fieldName0) ; f0.setTime(*t)
+        da=m.getCoords().magnitude() ; da.reverse() ; da.setInfoOnComponents(["zeInfo"])
+        f0.setArray(da)
+        f0.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldNoProfileSBT(f0)
+        fmts0.pushBackTimeStep(f1ts)
+        #
+        f1=MEDCouplingFieldDouble(ON_CELLS) ; f1.setMesh(m)
+        f1.setName(fieldName1) ; f1.setTime(*t)
+        da=m.getBarycenterAndOwner().magnitude() ; da.reverse() ; da.setInfoOnComponents(["zeInfoCell"])
+        f1.setArray(da)
+        f1.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldNoProfileSBT(f1)
+        fmts1.pushBackTimeStep(f1ts)
+        #
+        f2=MEDCouplingFieldDouble(ON_NODES) ; mTmp=m[pfl3] ; mTmp.zipCoords() ; mTmp.setName(m.getName()) ; f2.setMesh(mTmp)
+        f2.setName(fieldName2) ; f2.setTime(*t)
+        da=m.getCoords().magnitude()[pfl2] ; da.reverse() ; da.setInfoOnComponents(["zzzz"])
+        f2.setArray(da)
+        f2.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldProfile(f2,mm,0,pfl2)
+        fmts2.pushBackTimeStep(f1ts)
+        #
+        f3=MEDCouplingFieldDouble(ON_CELLS) ; mTmp=m[pfl3] ; mTmp.setName(m.getName()) ; f3.setMesh(mTmp)
+        f3.setName(fieldName3) ; f3.setTime(*t)
+        da=mTmp.getBarycenterAndOwner().magnitude() ; da.reverse() ; da.setInfoOnComponents(["abcdefg"])
+        f3.setArray(da)
+        f3.checkCoherency()
+        f1ts=MEDFileField1TS()
+        f1ts.setFieldProfile(f3,mm,0,pfl3)
+        fmts3.pushBackTimeStep(f1ts)
+        ####
+        grp1=DataArrayInt([6,7,8,11,12,13,16,17,18]) ; grp1.setName("grp1")
+        grp2=DataArrayInt([10,11,15,16,20,21]) ; grp2.setName("grp2")
+        mm.setGroupsAtLevel(1,[grp1,grp2])
+        grp3=DataArrayInt([4,5,6]) ; grp3.setName("grp3")
+        grp4=DataArrayInt([8,9,10]) ; grp4.setName("grp4")
+        mm.setGroupsAtLevel(0,[grp3,grp4])
+        d=DataArrayInt(25) ; d.iota() ; d*=10 ;  mm.setRenumFieldArr(1,d)
+        d=DataArrayInt(16) ; d.iota() ; d*=11 ;  mm.setRenumFieldArr(0,d)
+        mm.write(fname,2)
+        fs.appendGlobs(fmts2,1e-12)
+        fs.appendGlobs(fmts3,1e-12)
+        fs.write(fname,0)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),4)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),4)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),2)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),2)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[1][0]),2)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,3.,0.,0.,4.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.,3.,1.,0.,4.,1.,0.,0.,2.,0.,1.,2.,0.,2.,2.,0.,3.,2.,0.,4.,2.,0.,0.,3.,0.,1.,3.,0.,2.,3.,0.,3.,3.,0.,4.,3.,0.,0.,4.,0.,1.,4.,0.,2.,4.,0.,3.,4.,0.,4.,4.,0.],25,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,5,6,4,2,1,6,7,4,3,2,7,8,4,4,3,8,9,4,6,5,10,11,4,7,6,11,12,4,8,7,12,13,4,9,8,13,14,4,11,10,15,16,4,12,11,16,17,4,13,12,17,18,4,14,13,18,19,4,16,15,20,21,4,17,16,21,22,4,18,17,22,23,4,19,18,23,24])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([-5,-5,-5,-5,-6,-6,-6,-5,-7,-7,-7,-5,-5,-5,-5,-5])))
+        self.assertTrue(a7) # no copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([0,11,22,33,44,55,66,77,88,99,110,121,132,143,154,165])))
+        self.assertTrue(a9) # no copy here
+        a10,a11=mml2.retrieveFamilyIdsOnNodes()
+        self.assertTrue(a10.isEqual(DataArrayInt([1,1,1,1,1,1,2,2,2,1,3,4,2,2,1,3,4,2,2,1,3,3,1,1,1])))
+        self.assertTrue(a11) # no copy here
+        a12,a13=mml2.retrieveNumberIdsOnNodes()
+        self.assertTrue(a12.isEqual(DataArrayInt([0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240])))
+        self.assertTrue(a13) # no copy here
+        for i in xrange(1,2):
+            self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
+            pass
+        for i in xrange(2):
+            f=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName1)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp=DataArrayDouble([0.7071067811865476,1.5811388300841898,2.5495097567963922,3.5355339059327378,1.5811388300841898,2.1213203435596424,2.9154759474226504,3.8078865529319543,2.5495097567963922,2.9154759474226504,3.5355339059327378,4.301162633521313,3.5355339059327378,3.8078865529319543,4.301162633521313,4.949747468305833])
+            if i==1: vExp.reverse()
+            vExp.setInfoOnComponents(["zeInfoCell"])
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport1[0][0][1][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName0)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp=DataArrayDouble([0.,1.,2.,3.,4.,1.,1.4142135623730951,2.23606797749979,3.1622776601683795,4.123105625617661,2.,2.23606797749979,2.8284271247461903,3.605551275463989,4.47213595499958,3.,3.1622776601683795,3.605551275463989,4.242640687119285,5.,4.,4.123105625617661,4.47213595499958,5.,5.656854249492381])
+            if i==1: vExp.reverse()
+            vExp.setInfoOnComponents(["zeInfo"])
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            pass
+        ### Testing the 2nd support
+        fcscp=allFMTSLeavesPerCommonSupport1[1][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
+        self.assertTrue(not ncc)
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,1.,0.,1.,1.,0.,2.,1.,0.,0.,2.,0.,1.,2.,0.,2.,2.,0.,0.,3.,0.,1.,3.,0.,2.,3.,0.,0.,4.,0.,1.,4.,0.,2.,4.,0.],12,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,3,4,4,2,1,4,5,4,4,3,6,7,4,5,4,7,8,4,7,6,9,10,4,8,7,10,11])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6.isEqual(DataArrayInt([-6,-6,-7,-7,-5,-5])))
+        self.assertTrue(not a7) # copy here
+        a8,a9=mml2.retrieveNumberIdsOnCells()
+        self.assertTrue(a8.isEqual(DataArrayInt([44,55,88,99,132,143])))
+        self.assertTrue(not a9) # copy here
+        a10,a11=mml2.retrieveFamilyIdsOnNodes()
+        self.assertTrue(a10.isEqual(DataArrayInt([1,2,2,3,4,2,3,4,2,3,3,1])))
+        self.assertTrue(not a11) # copy here
+        a12,a13=mml2.retrieveNumberIdsOnNodes()
+        self.assertTrue(a12.isEqual(DataArrayInt([50,60,70,100,110,120,150,160,170,200,210,220])))
+        self.assertTrue(not a13) # copy here
+        for i in xrange(2):
+            f=allFMTSLeavesPerCommonSupport1[1][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName3)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp=DataArrayDouble([1.5811388300842,2.1213203435596,2.5495097567964,2.9154759474227,3.5355339059327,3.807886552932])
+            if i==1: vExp.reverse()
+            vExp.setInfoOnComponents(["abcdefg"])
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport1[1][0][1][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName2)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp=DataArrayDouble([1.,1.4142135623731,2.2360679774998,2.,2.2360679774998,2.8284271247462,3.,3.1622776601684,3.605551275464,4.,4.1231056256177,4.4721359549996])
+            if i==1: vExp.reverse()
+            vExp.setInfoOnComponents(["zzzz"])
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            pass
+        pass
     pass
 
 unittest.main()
index 0da6104cdc1b71ccc92654f375fd5aa196709db4..c122256e963edf121eee1a70870e32abc6ee8feb 100644 (file)
@@ -34,7 +34,7 @@ class SauvLoaderTest(unittest.TestCase):
 
         # read SAUV and write MED
         medFile = "SauvLoaderTest.med"
-        sr=SauvReader.New(sauvFile);
+        sr=SauvReader(sauvFile);
         d2=sr.loadInMEDFileDS();
         d2.write(medFile,0);
 
@@ -95,7 +95,7 @@ class SauvLoaderTest(unittest.TestCase):
 
         # write pointeMed to SAUV
         sauvFile = "SauvLoaderTest.sauv"
-        sw=SauvWriter.New();
+        sw=SauvWriter();
         sw.setMEDFileDS(pointeMed);
         sw.write(sauvFile);
 
@@ -321,9 +321,70 @@ class SauvLoaderTest(unittest.TestCase):
         self.assertTrue( f2.isEqual( f, 1e-12, 1e-12 ))
         del sr
         os.remove( sauvFile )
+        pass
 
+    def testSauvWriterGroupWithOneFamily(self):
+        """
+        This test checks an option for sauv writing. It is requested here to copy a group from a family if a group is lying on a single family.
+        """
+        import re
+        mfd=MEDLoaderDataForTest.buildAMEDFileDataWithGroupOnOneFamilyForSauv()
+        sauvFile = "mesh.sauv"
+        sw=SauvWriter.New()
+        sw.setMEDFileDS(mfd)
+        self.assertTrue(not sw.getCpyGrpIfOnASingleFamilyStatus())
+        sw.setCpyGrpIfOnASingleFamilyStatus(True)
+        self.assertTrue(sw.getCpyGrpIfOnASingleFamilyStatus())
+        sw.write(sauvFile)
+        
+        f = open(sauvFile)
+        # String pattern for the header of the sub meshes record ("PILE" number, number of named objects, number of objects)
+        pattern_pile= re.compile(r'\sPILE\sNUMERO\s+(?P<number>[0-9]+)NBRE\sOBJETS\sNOMMES\s+(?P<nbnamed>[0-9]+)NBRE\sOBJETS\s+(?P<nbobjects>[0-9]+)')
+        # String pattern for a sub mesh header (cell type, number of components and three numbers)
+        pattern_header=re.compile(r'\s+(?P<type>[0-9]+)\s+(?P<nbsubs>[0-9]+)\s+[0-9]+\s+[0-9]+\s+[0-9]+')
+        
+        nbobjects=0
+        line = f.readline()
+        while(line):
+            match_pile = pattern_pile.match(line)
+            if match_pile:
+                number=int(match_pile.group("number"))
+                if number == 1:
+                    nbnamed=int(match_pile.group("nbnamed"))
+                    nbobjects=int(match_pile.group("nbobjects"))
+                    break
+                pass
+            line=f.readline()
+            pass
+        
+        # Skipping the objects names
+        f.readline()
+        # Skipping the objects ids
+        f.readline()
 
+        # Looking for each sub-mesh header 
+        line = f.readline()
+        cur_object=0
+        while(line and cur_object < nbobjects):
+            match_header=pattern_header.match(line)
+            if match_header:
+                cell_type=int(match_header.group("type"))
+                nb_subs=int(match_header.group("nbsubs"))
+                # Looking for a compound object
+                if cell_type == 0:
+                    # Testing if there is only one component
+                    self.assertTrue(nb_subs > 1)
+                else:
+                    f.readline()
+                    f.readline()
+                    cur_object = cur_object + 1
+                    pass
+                pass
+            line=f.readline()
+            pass
+        os.remove(sauvFile)
         pass
+
     pass
 
 unittest.main()
index ccc78ea8b505834b77f6d1fc315ba39f0fba8922..62cbd28ae17bb9b2bb9e0d2a0be9cddc29aad0da 100644 (file)
@@ -47,5 +47,7 @@ ADD_EXECUTABLE(TestSauvLoader ${TestSauvLoader_SOURCES})
 
 TARGET_LINK_LIBRARIES(TestSauvLoader medloader ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
 ADD_TEST(TestSauvLoader TestSauvLoader)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+SET_TESTS_PROPERTIES(TestSauvLoader PROPERTIES ENVIRONMENT "${tests_env}")
 
 INSTALL(TARGETS TestMEDLoader TestSauvLoader DESTINATION ${SALOME_INSTALL_BINS})
index 9c8bdda8fd552c73d3c1dda7f9502df517bd7204..a5b52f77c83a7ea579009457d36318da47625b5c 100644 (file)
@@ -75,6 +75,11 @@ language = 'fr'
 # for source files.
 exclude_trees = ['.build','ref','images','CVS','.svn']
 
+# A list of glob-style patterns that should be excluded when looking for source
+# files. They are matched against the source file names relative to the
+# source directory, using slashes as directory separators on all platforms.
+exclude_patterns = ['**/CVS']
+
 # The reST default role (used for this markup: `text`) to use for all documents.
 #default_role = None
 
index 905d9fc6b59f4bfeb641b5fa206e9dbdf5589b24..6c007facf7047cf9f724e8323698b63b03b1f951 100644 (file)
@@ -1,6 +1,30 @@
 <!DOCTYPE TS><TS>
 <context>
     <name>@default</name>
+    <message>
+        <source>MEN_BUILDER3</source>
+        <translation type="unfinished">Load a python script</translation>
+    </message>
+    <message>
+        <source>STS_BUILDER3</source>
+        <translation type="unfinished">Load a python script</translation>
+    </message>
+    <message>
+        <source>TLT_BUILDER3</source>
+        <translation type="unfinished">Load a python script</translation>
+    </message>
+    <message>
+        <source>STS_LOAD_DXF</source>
+        <translation type="unfinished">Load DXF file</translation>
+    </message>
+    <message>
+        <source>MEN_LOAD_DXF</source>
+        <translation type="unfinished">Load DXF file</translation>
+    </message>
+    <message>
+        <source>TLT_LOAD_DXF</source>
+        <translation type="unfinished">Load DXF file</translation>
+    </message>
     <message>
         <source>TLT_MY_NEW_ITEM</source>
         <translation>My menu item</translation>
index f43c267d4efab2b3f9ea6c164a64877cf5bc8d52..3dc6b4f85efc4a4b5d0c7584bf6b1a41b1e4b38e 100644 (file)
@@ -96,7 +96,7 @@
     <name>XMEDGUI_maquette</name>
     <message>
       <source>BUT_OK</source>
-      <translation>わかりました</translation>
+      <translation>OK</translation>
     </message>
     <message>
       <source>QUE_XMED_LABEL</source>
     </message>
     <message>
       <source>QUE_XMED_NAME</source>
-      <translation>ã\81\82ã\81ªã\81\9fã\81®å\90\8då\89\8dã\82\92å\85¥å\8a\9bã\81\97ã\81¦ã\81\8fã\81 ã\81\95ã\81\84ã\80\81</translation>
+      <translation>ã\81\82ã\81ªã\81\9fã\81®å\90\8då\89\8dã\82\92å\85¥å\8a\9bã\81\97ã\81¦ã\81\8fã\81 ã\81\95ã\81\84ã\80\82</translation>
     </message>
     <message>
       <source>INF_XMED_BANNER</source>
     </message>
     <message>
       <source>INF_XMED_MENU</source>
-      <translation>これはテストです。</translation>
+      <translation>ã\81\93ã\82\8cã\81¯ã\81\9fã\81 ã\81®ã\83\86ã\82¹ã\83\88ã\81§ã\81\99ã\80\82</translation>
     </message>
   </context>
 </TS>
index fe5e5519bd3739767f40369f777a1eb5bf1b054b..ab58eef65e3cdb6bfbcc049a163a600d93c6eb82 100644 (file)
@@ -6,67 +6,67 @@
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="45"/>
       <source>LAB_ADD_DATA_SOURCE</source>
-      <translation>LAB_ADD_DATA_SOURCE</translation>
+      <translation>データのインポート MED</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="46"/>
       <source>TIP_ADD_DATA_SOURCE</source>
-      <translation>TIP_ADD_DATA_SOURCE</translation>
+      <translation>MED のファイルをインポートしたデータを追加します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="52"/>
       <source>LAB_ADD_IMAGE_SOURCE</source>
-      <translation>LAB_ADD_IMAGE_SOURCE</translation>
+      <translation>画像を追加します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="53"/>
       <source>TIP_ADD_IMAGE_SOURCE</source>
-      <translation>TIP_ADD_IMAGE_SOURCE</translation>
+      <translation>イメージ ファイルのインポートを使用してデータを追加します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="62"/>
       <source>LAB_EXPAND_FIELD</source>
-      <translation>LAB_EXPAND_FIELD</translation>
+      <translation>拡張フィールドの時系列</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="69"/>
       <source>LAB_VISUALIZE</source>
-      <translation>LAB_VISUALIZE</translation>
+      <translation>ビュー</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="75"/>
       <source>LAB_USE_IN_WORKSPACE</source>
-      <translation>LAB_USE_IN_WORKSPACE</translation>
+      <translation>ワークスペースを使用します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="83"/>
       <source>LAB_CHANGE_MESH</source>
-      <translation>LAB_CHANGE_MESH</translation>
+      <translation>基になるメッシュを変更します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="157"/>
       <source>IMPORT_MED_FIELDS</source>
-      <translation>IMPORT_MED_FIELDS</translation>
+      <translation>(MED のサイズ) フィールドをインポートします。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="191"/>
       <source>OPERATION_FAILED</source>
-      <translation>OPERATION_FAILED</translation>
+      <translation>操作が失敗しました</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="192"/>
       <source>CREATION_FAILED</source>
-      <translation>CREATION_FAILED</translation>
+      <translation>イメージ ファイルの作成からの医学データに失敗しました</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="283"/>
       <source>OPERATION_NOT_ALLOWED</source>
-      <translation>OPERATION_NOT_ALLOWED</translation>
+      <translation>許可されていない操作</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/DatasourceController.cxx" line="284"/>
       <source>FIELD_ALREADY_DEFINED</source>
-      <translation>FIELD_ALREADY_DEFINED</translation>
+      <translation>このフィールドは、ワークスペースで既に定義されて</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgAlias.ui" line="14"/>
       <source>SELECT_AN_ALIAS_FOR_THE_FIELD</source>
-      <translation>SELECT_AN_ALIAS_FOR_THE_FIELD</translation>
+      <translation>このフィールドのエイリアスを選択します</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgAlias.ui" line="401"/>
       <source>DEFINE_AN_ALIAS</source>
-      <translation>DEFINE_AN_ALIAS</translation>
+      <translation>コンソールでフィールドを操作するエイリアスを設定できます。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgAlias.ui" line="419"/>
       <source>ALIAS</source>
-      <translation>ALIAS</translation>
+      <translation>エイリアス</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgAlias.ui" line="436"/>
       <source>MSG_OPERATION_DEFINES_VARIABLE</source>
-      <translation>MSG_OPERATION_DEFINES_VARIABLE</translation>
+      <translation>(この操作はテキスト コンソールに&lt;alias&gt;という名前の変数を定義します。型 '&lt;alias&gt;. help()"利用可能な機能または単に「doc」参照する)&lt;/alias&gt; &lt;/alias&gt;</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="14"/>
       <source>FORM</source>
-      <translation>FORM</translation>
-    </message>
-    <message>
-      <location filename="MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="391"/>
-      <source>SELECT_MESH</source>
-      <translation>SELECT_MESH</translation>
+      <translation>フォーム</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="403"/>
       <source>MESH_GT</source>
-      <translation>MESH_GT</translation>
+      <translation>-&gt; メッシュします。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui" line="420"/>
       <source>MSG_EXPLORER</source>
-      <translation>MSG_EXPLORER</translation>
+      <translation>(エクスプ ローラー データ空間で参照される MED (メッシュとフィールド) のデータのビューを提供します)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="35"/>
       <source>DATA_VERIFICATION</source>
-      <translation>DATA_VERIFICATION</translation>
+      <translation>データの検証</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.cxx" line="36"/>
       <source>SELECT_MESH</source>
-      <translation>SELECT_MESH</translation>
+      <translation>エクスプ ローラーでメッシュを選択し、メッシュをクリックする必要があります。</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.ui" line="14"/>
       <source>FORM</source>
-      <translation>FORM</translation>
+      <translation>フォーム</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.ui" line="28"/>
       <source>IMAGE_FILE</source>
-      <translation>IMAGE_FILE</translation>
+      <translation>画像ファイル:</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.ui" line="35"/>
       <source>MED_FILE</source>
-      <translation>MED_FILE</translation>
+      <translation>MED ファイル:</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.cxx" line="64"/>
       <source>SELECT_IMAGE_FILE</source>
-      <translation>SELECT_IMAGE_FILE</translation>
+      <translation>イメージ ファイルを選択します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.cxx" line="79"/>
       <source>SPECIFY_MED_FILE</source>
-      <translation>SPECIFY_MED_FILE</translation>
+      <translation>MED ファイルを指定します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.ui" line="82"/>
       <source>LOAD_AUTOMATICALLY</source>
-      <translation>LOAD_AUTOMATICALLY</translation>
+      <translation>自動的に読み込む</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgUseInWorkspace.ui" line="13"/>
       <source>FORM</source>
-      <translation>FORM</translation>
+      <translation>フォーム</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgUseInWorkspace.ui" line="49"/>
       <source>PRESSURE</source>
-      <translation>PRESSURE</translation>
+      <translation>圧力:</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgUseInWorkspace.ui" line="56"/>
       <source>TEMPERATURE</source>
-      <translation>TEMPERATURE</translation>
+      <translation>温度:</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/dialogs/GenericDialog.ui" line="13"/>
       <source>DIALOG</source>
-      <translation>DIALOG</translation>
+      <translation>ダイアログ</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/MEDOPModule.cxx" line="68"/>
       <source>IMPORT_FROM_FILE</source>
-      <translation>IMPORT_FROM_FILE</translation>
+      <translation>ファイルからのインポートします。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/MEDOPModule.cxx" line="69"/>
       <source>IMPORT_MED_FILE</source>
-      <translation>IMPORT_MED_FILE</translation>
+      <translation>MEDファイルをインポート</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/MEDOPModule.cxx" line="72"/>
       <source>MEN_FILE</source>
-      <translation>MEN_FILE</translation>
+      <translation>ファイル(&amp;F)</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="66"/>
       <source>VISUALIZE_SCALAR_MAP</source>
-      <translation>VISUALIZE_SCALAR_MAP</translation>
+      <translation>ビュー (マップ スカラー)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="67"/>
       <source>USE_IN_CONSOLE</source>
-      <translation>USE_IN_CONSOLE</translation>
+      <translation>(コンソール) を使用してください。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="68"/>
       <source>EXPORT_TO_PARAVIS</source>
-      <translation>EXPORT_TO_PARAVIS</translation>
+      <translation>エクスポート (にそこに)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="69"/>
       <source>SAVE_AS_MED</source>
-      <translation>SAVE_AS_MED</translation>
+      <translation>(MED ファイル) に保存します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="70"/>
       <source>REMOVE_FROM_WORKSPACE</source>
-      <translation>REMOVE_FROM_WORKSPACE</translation>
+      <translation>(ワークスペース) の削除します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="91"/>
       <source>LAB_SAVE_WORKSPACE</source>
-      <translation>LAB_SAVE_WORKSPACE</translation>
+      <translation>ワークスペースを保存します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="92"/>
       <source>TIP_SAVE_WORKSPACE</source>
-      <translation>TIP_SAVE_WORKSPACE</translation>
+      <translation>MED ファイル (フィールドおよびメッシュ) ワークスペースを保存します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="97"/>
       <source>LAB_CLEAN_WORKSPACE</source>
-      <translation>LAB_CLEAN_WORKSPACE</translation>
+      <translation>作業領域をきれいに</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="98"/>
       <source>TIP_CLEAN_WORKSPACE</source>
-      <translation>TIP_CLEAN_WORKSPACE</translation>
+      <translation>ワークスペースからすべてのデータを消去します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="271"/>
       <source>SAVE_SELECTED_FIELDS</source>
-      <translation>SAVE_SELECTED_FIELDS</translation>
+      <translation>選択したフィールドを保存します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="425"/>
       <source>SAVE_WORKSPACE_DATA</source>
-      <translation>SAVE_WORKSPACE_DATA</translation>
+      <translation>ワークスペースからデータを保存します。</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="439"/>
       <source>NOT_IMPLEMENTED_YET</source>
-      <translation>NOT_IMPLEMENTED_YET</translation>
+      <translation>実装されていません</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/WorkspaceController.cxx" line="440"/>
       <source>FUNCTION_NOT_IMPLEMENTED</source>
-      <translation>FUNCTION_NOT_IMPLEMENTED</translation>
+      <translation>この機能はまだ実装されていません</translation>
     </message>
   </context>
   <context>
     <message>
       <location filename="MEDOP/gui/MEDOPModule.cxx" line="151"/>
       <source>FILE_FILTER_MED</source>
-      <translation>FILE_FILTER_MED</translation>
+      <translation>音楽配信マック & ファイル (* .med)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.cxx" line="57"/>
       <source>FILE_FILTER_PNG</source>
-      <translation>FILE_FILTER_PNG</translation>
+      <translation>イメージ PNG (*.png)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.cxx" line="58"/>
       <source>FILE_FILTER_JPG</source>
-      <translation>FILE_FILTER_JPG</translation>
+      <translation>画像 JPG (*.jpg)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.cxx" line="59"/>
       <source>FILE_FILTER_PGM</source>
-      <translation>FILE_FILTER_PGM</translation>
+      <translation>イメージ PGM (*.jpg)</translation>
     </message>
     <message>
       <location filename="MEDOP/gui/dialogs/DlgImageToMed.cxx" line="60"/>
       <source>FILE_FILTER_ALL</source>
-      <translation>FILE_FILTER_ALL</translation>
+      <translation>すべてのファイル (*. *)</translation>
     </message>
   </context>
 </TS>
index 348f1be5699f9d0145e207f00422cbcdce4d8701..bf1ed9630e1443ce7d49d0777b9b63b1d5b876e4 100644 (file)
@@ -200,7 +200,7 @@ void MeshCollectionMedXmlDriver::write(const char* filename, ParaDomainSelector*
 
   //Description tag
   time_t present; 
-  char date[6];
+  char date[20];
 #ifndef WIN32
   time( &present);
   struct tm *time_asc = localtime(&present);
index f981249c878d12db089146755d123ec6212dd653..301e159c0bc7e25ad9b042a01b8b84f57d27e55e 100644 (file)
@@ -51,4 +51,6 @@ INSTALL(TARGETS TestMEDPARTITIONER DESTINATION ${SALOME_INSTALL_BINS})
 
 INSTALL(FILES ${MEDPARTITIONERTest_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
 
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 ADD_TEST(TestMEDPARTITIONER TestMEDPARTITIONER)
+SET_TESTS_PROPERTIES(TestMEDPARTITIONER PROPERTIES ENVIRONMENT "${tests_env}")   
index 92143c936ac15915b1b2c1940994fc4b1e9aca0c..fe91ce4804579e23919889dceb73ff2ea74bfedc 100644 (file)
@@ -748,7 +748,7 @@ void MEDPARTITIONERTest::verifyTestMeshWithVecFieldOnNodes()
   string name=_file_name;
   name.replace(name.find(".med"),4,"_WithVecFieldOnNodes.med");
   MEDCouplingUMesh * m=MEDLoader::ReadUMeshFromFile(name.c_str(),_mesh_name.c_str(),0);
-  const std::set<INTERP_KERNEL::NormalizedCellType>& types=m->getAllTypes();
+  std::set<INTERP_KERNEL::NormalizedCellType> types(m->getAllGeoTypes());
   if (_verbose)
     {
       cout<<"\n types in "<<name<<" : ";
index a0a80a4a8933b016cb9c5a48466aecdb2218e005..267586db27df8149a60215bfe49de297e1a3ae1d 100644 (file)
@@ -43,7 +43,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(16,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(3,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(3,(int)mesh->getAllGeoTypes().size());
   for(int i=0;i<12;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,mesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,mesh->getTypeOfCell(12));
@@ -67,7 +67,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(2,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
   CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,mesh->getTypeOfCell(0));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,mesh->getTypeOfCell(1));
   CPPUNIT_ASSERT_EQUAL((std::size_t)11,mesh->getNodalConnectivity()->getNbOfElems());
@@ -90,7 +90,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(7,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
   for(int i=0;i<6;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,mesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,mesh->getTypeOfCell(6));
@@ -129,7 +129,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,constMesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(16,constMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,constMesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllGeoTypes().size());
   for(int i=0;i<12;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,constMesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,constMesh->getTypeOfCell(12));
@@ -158,7 +158,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,constMesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(16,constMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,constMesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllGeoTypes().size());
   for(int i=0;i<12;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,constMesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,constMesh->getTypeOfCell(12));
@@ -212,7 +212,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,constMesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(16,constMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,constMesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllGeoTypes().size());
   for(int i=0;i<12;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,constMesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,constMesh->getTypeOfCell(12));
@@ -240,7 +240,7 @@ void ParaMEDMEMTest::testMEDLoaderRead1()
   CPPUNIT_ASSERT_EQUAL(3,constMesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(16,constMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,constMesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(3,(int)constMesh->getAllGeoTypes().size());
   for(int i=0;i<12;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,constMesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL(NORM_PYRA5,constMesh->getTypeOfCell(12));
@@ -266,7 +266,7 @@ void ParaMEDMEMTest::testMEDLoaderPolygonRead()
   CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(538,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(579,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
   for(int i=0;i<514;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_QUAD4,mesh->getTypeOfCell(i));
   for(int i=514;i<538;i++)
@@ -300,7 +300,7 @@ void ParaMEDMEMTest::testMEDLoaderPolygonRead()
   CPPUNIT_ASSERT_EQUAL(2,constMesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(538,constMesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(579,constMesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(2,(int)constMesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)constMesh->getAllGeoTypes().size());
   for(int i=0;i<514;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_QUAD4,constMesh->getTypeOfCell(i));
   for(int i=514;i<538;i++)
@@ -329,7 +329,7 @@ void ParaMEDMEMTest::testMEDLoaderPolyhedronRead()
   CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(3,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
   CPPUNIT_ASSERT_EQUAL(NORM_TETRA4,mesh->getTypeOfCell(0));
   CPPUNIT_ASSERT_EQUAL(NORM_POLYHED,mesh->getTypeOfCell(1));
   CPPUNIT_ASSERT_EQUAL(NORM_POLYHED,mesh->getTypeOfCell(2));
@@ -345,7 +345,7 @@ void ParaMEDMEMTest::testMEDLoaderPolyhedronRead()
   CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(17,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(3,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(3,(int)mesh->getAllGeoTypes().size());
   CPPUNIT_ASSERT_EQUAL(NORM_POLYGON,mesh->getTypeOfCell(0));
   CPPUNIT_ASSERT_EQUAL(NORM_QUAD4,mesh->getTypeOfCell(1));
   CPPUNIT_ASSERT_EQUAL(NORM_QUAD4,mesh->getTypeOfCell(2));
@@ -382,7 +382,7 @@ void ParaMEDMEMTest::testMEDLoaderPolyhedronRead()
   CPPUNIT_ASSERT_EQUAL(2,mesh->getMeshDimension());
   CPPUNIT_ASSERT_EQUAL(3,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
-  CPPUNIT_ASSERT_EQUAL(1,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(1,(int)mesh->getAllGeoTypes().size());
   for(int i=0;i<3;i++)
     CPPUNIT_ASSERT_EQUAL(NORM_POLYGON,mesh->getTypeOfCell(i));
   CPPUNIT_ASSERT_EQUAL((std::size_t)19,mesh->getNodalConnectivity()->getNbOfElems());
@@ -394,6 +394,6 @@ void ParaMEDMEMTest::testMEDLoaderPolyhedronRead()
   CPPUNIT_ASSERT_EQUAL(0,mesh->getNumberOfCells());
   CPPUNIT_ASSERT_EQUAL(19,mesh->getNumberOfNodes());
   CPPUNIT_ASSERT_EQUAL(3,mesh->getMeshDimension());
-  CPPUNIT_ASSERT_EQUAL(0,(int)mesh->getAllTypes().size());
+  CPPUNIT_ASSERT_EQUAL(0,(int)mesh->getAllGeoTypes().size());
   mesh->decrRef();
 }
index 128e365f56dead5d09d4bcaf40440b46b69d338c..3b36feefe6c895e8276443adfc4817d578369702 100644 (file)
@@ -65,4 +65,6 @@ INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_SCRIPT_
 INSTALL(FILES MEDRenumber.i MEDRenumberCommon.i DESTINATION ${SALOME_INSTALL_HEADERS})
 INSTALL(FILES MEDRenumberTest.py DESTINATION ${SALOME_INSTALL_SCRIPT_PYTHON})
 
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 ADD_TEST(MEDRenumberTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDRenumberTest.py)
+SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${tests_env}")