Salome HOME
Minor doc: recall conformize3D limitation.
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingUMesh_internal.cxx
index 4b6b75a843f33f57f4c5c3910fdbaba032c438b8..7bbe37f8e284186cc4d51d1d5abf2a0d63f75560 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -510,6 +510,11 @@ void MEDCouplingUMesh::fillCellIdsToKeepFromNodeIds(const mcIdType *begin, const
   MCAuto<DataArrayIdType> cellIdsKept=DataArrayIdType::New(); cellIdsKept->alloc(0,1);
   checkConnectivityFullyDefined();
   mcIdType tmp=-1;
+  if(getNodalConnectivity()->empty())
+  {
+    cellIdsKeptArr=cellIdsKept.retn();
+    return;
+  }
   mcIdType sz=getNodalConnectivity()->getMaxValue(tmp); sz=std::max(sz,ToIdType(0))+1;
   std::vector<bool> fastFinder(sz,false);
   for(const mcIdType *work=begin;work!=end;work++)
@@ -801,7 +806,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMeshFromThisLowLev(mcIdType nbO
   for(mcIdType iz=0;iz<nbOf1DCells;iz++)
     {
       if(iz!=0)
-        std::transform(newConnIPtr+1,newConnIPtr+1+nbOf2DCells,newConnIPtr+1+iz*nbOf2DCells,std::bind2nd(std::plus<mcIdType>(),newConnIPtr[iz*nbOf2DCells]));
+        std::transform(newConnIPtr+1,newConnIPtr+1+nbOf2DCells,newConnIPtr+1+iz*nbOf2DCells,std::bind(std::plus<mcIdType>(),std::placeholders::_1,newConnIPtr[iz*nbOf2DCells]));
       const mcIdType *posOfTypeOfCell(newConnIPtr);
       for(std::vector<mcIdType>::const_iterator iter=newc.begin();iter!=newc.end();iter++,newConnPtr++)
         {
@@ -1342,7 +1347,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(const std::vector<const MEDCo
       mcIdType curNbOfCell=ToIdType((*it)->getNumberOfCells());
       const mcIdType *curCI=(*it)->_nodal_connec_index->begin();
       const mcIdType *curC=(*it)->_nodal_connec->begin();
-      cIPtr=std::transform(curCI+1,curCI+curNbOfCell+1,cIPtr,std::bind2nd(std::plus<mcIdType>(),offset));
+      cIPtr=std::transform(curCI+1,curCI+curNbOfCell+1,cIPtr,std::bind(std::plus<mcIdType>(),std::placeholders::_1,offset));
       for(mcIdType j=0;j<curNbOfCell;j++)
         {
           const mcIdType *src=curC+curCI[j];
@@ -1567,7 +1572,7 @@ void MEDCouplingUMesh::AppendExtrudedCell(const mcIdType *connBg, const mcIdType
         *ii++=-1;
         std::reverse_iterator<const mcIdType *> rConnBg(connEnd);
         std::reverse_iterator<const mcIdType *> rConnEnd(connBg+1);
-        std::transform(rConnBg,rConnEnd,ii,std::bind2nd(std::plus<mcIdType>(),deltaz));
+        std::transform(rConnBg,rConnEnd,ii,std::bind(std::plus<mcIdType>(),std::placeholders::_1,deltaz));
         std::size_t nbOfRadFaces=std::distance(connBg+1,connEnd);
         for(std::size_t i=0;i<nbOfRadFaces;i++)
           {
@@ -1588,14 +1593,14 @@ void MEDCouplingUMesh::AppendExtrudedCell(const mcIdType *connBg, const mcIdType
  * This method allows to compute given the status of 3D curve cells and the descending connectivity 3DSurf->3DCurve to deduce the intersection of each 3D surf cells
  * with a plane. The result will be put in 'cut3DSuf' out parameter.
  * \param [in] cut3DCurve  input parameter that gives for each 3DCurve cell if it owns fully to the plane or partially.
- * \param [out] nodesOnPlane, returns all the nodes that are on the plane.
+ * \param [out] nodesOnPlane returns all the nodes that are on the plane.
  * \param [in] nodal3DSurf is the nodal connectivity of 3D surf mesh.
  * \param [in] nodalIndx3DSurf is the nodal connectivity index of 3D surf mesh.
  * \param [in] nodal3DCurve is the nodal connectivity of 3D curve mesh.
- * \param [in] nodal3DIndxCurve is the nodal connectivity index of 3D curve mesh.
+ * \param [in] nodalIndx3DCurve is the nodal connectivity index of 3D curve mesh.
  * \param [in] desc is the descending connectivity 3DSurf->3DCurve
  * \param [in] descIndx is the descending connectivity index 3DSurf->3DCurve
- * \param [out] cut3DSuf input/output param.
+ * \param [out] cut3DSurf input/output param.
  */
 void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector<mcIdType>& cut3DCurve, std::vector<mcIdType>& nodesOnPlane, const mcIdType *nodal3DSurf, const mcIdType *nodalIndx3DSurf,
                                                    const mcIdType *nodal3DCurve, const mcIdType *nodalIndx3DCurve,
@@ -1818,7 +1823,7 @@ void MEDCouplingUMesh::attractSeg3MidPtsAroundNodesUnderground(double ratio, con
                       auto ptToMove(nc[*nci+3]);
                       auto attractor(aa?nc[*nci+1]:nc[*nci+2]),endPt(aa?nc[*nci+2]:nc[*nci+1]);
                       std::transform(coords+spaceDim*attractor,coords+spaceDim*(attractor+1),coords+spaceDim*endPt,
-                                     coords+spaceDim*ptToMove,[ratio](const double& stPt, const double& endPt) { return stPt+ratio*(endPt-stPt); });
+                                     coords+spaceDim*ptToMove,[ratio](const double& stPt2, const double& endPt2) { return stPt2+ratio*(endPt2-stPt2); });
                     }
                   else
                     continue;//both 2 boundary nodes of current seg3 are un nodeIds input list -> skip it.