From 0d3a62f662e8c319b781cba03027fee2c00406d0 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 4 Mar 2019 13:45:42 +0100 Subject: [PATCH] Intersect2DMeshWith1DLine: more doc. --- .../MEDCouplingUMesh_intersection.cxx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx index 04b79883f..f2df4a04f 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx @@ -863,10 +863,13 @@ private: int _iend; MCAuto _mesh; MCAuto _edge; - int _left; - int _right; + int _left; // index (local numbering) of the left 2D cell bordering the edge '_edge' + int _right; // same as above, right side. }; +/* + * Update indices of left and right 2D cell bordering the current edge. + */ void EdgeInfo::somethingHappendAt(int pos, const std::vector< MCAuto >& newLeft, const std::vector< MCAuto >& newRight) { const MEDCouplingUMesh *mesh(_mesh); @@ -952,9 +955,9 @@ private: const CellInfo& get(int pos) const; CellInfo& get(int pos); private: - std::vector _pool; - MCAuto _ze_mesh; - std::vector _edge_info; + std::vector _pool; // for a newly created 2D cell, the list of edges (int) and edges ptr constiuing it + MCAuto _ze_mesh; // the aggregated mesh + std::vector _edge_info; // for each new edge added when cuting the 2D cell, the information on left and right bordering 2D cell }; VectorOfCellInfo::VectorOfCellInfo(const std::vector& edges, const std::vector< MCAuto >& edgesPtr):_pool(1) @@ -1123,7 +1126,12 @@ MEDCouplingUMesh *BuildMesh2DCutInternal(double eps, MEDCouplingUMesh *splitMesh else renumb->iota(); // - + // The 1D first piece is used to intersect the 2D cell resulting in max two 2D cells. + // The next 1D piece is localised (getPositionOf()) into this previous cut. + // The result of the next intersection replaces the former single 2D cell that has been cut in the + // pool. The neighbourhood information detained by pool._edge_info is also updated so that left and right + // adjacent 2D cell of a 1D piece is kept up to date. + // And so on and so forth. for(int iStart=0;iStart