Salome HOME
Various fixes for test runs - introducing MEDCOUPLING_RESOURCE_DIR env variable
[tools/medcoupling.git] / src / ParaMEDMEM / ParaUMesh.hxx
index ec404a6535c5e4fcf9cbb9a64017afb9530765e6..fa41e50a915b0082bd70a19e2418a8b9c4f6f160 100644 (file)
@@ -58,12 +58,16 @@ namespace MEDCoupling
     MCAuto<DataArrayIdType> _cell_global;
     MCAuto<DataArrayIdType> _node_global;
   private:
+    MCAuto<DataArrayIdType> getCellIdsLyingOnNodesFalse(const DataArrayIdType *globalNodeIds) const;
+    MCAuto<DataArrayIdType> getCellIdsLyingOnNodesTrue(const DataArrayIdType *globalNodeIds) const;
     template<class T>
     typename Traits<T>::ArrayType *redistributeCellFieldT(const DataArrayIdType *globalCellIds, const typename Traits<T>::ArrayType *fieldValueToRed) const
     {
       using DataArrayT = typename Traits<T>::ArrayType;
       MPI_Comm comm(MPI_COMM_WORLD);
       CommInterface ci;
+      if( _cell_global->getNumberOfTuples() != fieldValueToRed->getNumberOfTuples() )
+        throw INTERP_KERNEL::Exception("PAraUMesh::redistributeCellFieldT : invalid input length of array !");
       std::unique_ptr<mcIdType[]> allGlobalCellIds,allGlobalCellIdsIndex;
       int size(ci.allGatherArrays(comm,globalCellIds,allGlobalCellIds,allGlobalCellIdsIndex));
       // Prepare ParaUMesh parts to be sent : compute for each proc the contribution of current rank.
@@ -103,6 +107,8 @@ namespace MEDCoupling
       using DataArrayT = typename Traits<T>::ArrayType;
       MPI_Comm comm(MPI_COMM_WORLD);
       CommInterface ci;
+      if( _node_global->getNumberOfTuples() != fieldValueToRed->getNumberOfTuples() )
+        throw INTERP_KERNEL::Exception("PAraUMesh::redistributeNodeFieldT : invalid input length of array !");
       std::unique_ptr<mcIdType[]> allGlobalCellIds,allGlobalCellIdsIndex;
       int size(ci.allGatherArrays(comm,globalCellIds,allGlobalCellIds,allGlobalCellIdsIndex));
       // Prepare ParaUMesh parts to be sent : compute for each proc the contribution of current rank.