Salome HOME
New references checked for PYRA5 due to modification of shape function in fd8dbd34764...
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingUMesh_intersection.cxx
index 7b4eecba9de7677e89885214e4882ccbb119cf26..16677a3d4264224ac013dfb1c83d4ef55af19686 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022  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
@@ -1127,7 +1127,7 @@ MEDCouplingUMesh *BuildMesh2DCutInternal(double eps, MEDCouplingUMesh *splitMesh
   if (i < nbCellsInSplitMesh1D-1)
     {
       // Build circular permutation to shift consecutive edges together
-      renumb->iota(i+1);
+      renumb->iota(nbCellsInSplitMesh1D-1-i);
       renumb->applyModulus(nbCellsInSplitMesh1D);
       splitMesh1D->renumberCells(renumbP, false);
       cSplitPtr = splitMesh1D->getNodalConnectivity()->begin();
@@ -1489,8 +1489,8 @@ void InsertNodeInConnIfNecessary(mcIdType nodeIdToInsert, std::vector<mcIdType>&
       mcIdType pt0(conn[i]),pt1(conn[(i+1)%sz]);
       double v1[3]={coords[3*pt1+0]-coords[3*pt0+0],coords[3*pt1+1]-coords[3*pt0+1],coords[3*pt1+2]-coords[3*pt0+2]},v2[3]={coords[3*nodeIdToInsert+0]-coords[3*pt0+0],coords[3*nodeIdToInsert+1]-coords[3*pt0+1],coords[3*nodeIdToInsert+2]-coords[3*pt0+2]};
       double normm(sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2]));
-      std::transform(v1,v1+3,v1,std::bind2nd(std::multiplies<double>(),1./normm));
-      std::transform(v2,v2+3,v2,std::bind2nd(std::multiplies<double>(),1./normm));
+      std::transform(v1,v1+3,v1,std::bind(std::multiplies<double>(),std::placeholders::_1,1./normm));
+      std::transform(v2,v2+3,v2,std::bind(std::multiplies<double>(),std::placeholders::_1,1./normm));
       double v3[3];
       v3[0]=v1[1]*v2[2]-v1[2]*v2[1]; v3[1]=v1[2]*v2[0]-v1[0]*v2[2]; v3[2]=v1[0]*v2[1]-v1[1]*v2[0];
       double normm2(sqrt(v3[0]*v3[0]+v3[1]*v3[1]+v3[2]*v3[2])),dotTest(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]);
@@ -2336,6 +2336,9 @@ void MEDCouplingUMesh::ReplaceEdgeInFace(const mcIdType * sIdxConn, const mcIdTy
  * This method expects that all nodes in \a this are not closer than \a eps.
  * If it is not the case you can invoke MEDCouplingUMesh::mergeNodes before calling this method.
  *
+ * \b WARNING this method only works for 'partition-like' non-conformities. When joining adjacent faces, the set of all small faces must fit exactly into the
+ * neighboring bigger face. No real face intersection is actually computed.
+ *
  * \param [in] eps the relative error to detect merged edges.
  * \return DataArrayIdType  * - The list of cellIds in \a this that have been subdivided. If empty, nothing changed in \a this (as if it were a const method). The array is a newly allocated array
  *                           that the user is expected to deal with.
@@ -2343,6 +2346,7 @@ void MEDCouplingUMesh::ReplaceEdgeInFace(const mcIdType * sIdxConn, const mcIdTy
  * \throw If \a this is not coherent.
  * \throw If \a this has not spaceDim equal to 3.
  * \throw If \a this has not meshDim equal to 3.
+ * \throw If the 'partition-like' condition described above is not respected.
  * \sa MEDCouplingUMesh::mergeNodes, MEDCouplingUMesh::conformize2D, MEDCouplingUMesh::convertAllToPoly()
  */
 DataArrayIdType *MEDCouplingUMesh::conformize3D(double eps)