From 9c2ce3dffb1f26145f6ab49ebe9c9bb61254725b Mon Sep 17 00:00:00 2001 From: prascle Date: Fri, 5 Apr 2013 15:19:53 +0000 Subject: [PATCH] PR: debug G. Nicolas (EDF 1967) --- .../input/tui_generate_flat_elements.doc | 9 ++- src/SMESH/SMESH_MeshEditor.cxx | 74 +++++++++++++++---- src/SMESH_I/SMESH_MeshEditor_i.cxx | 18 +++-- 3 files changed, 79 insertions(+), 22 deletions(-) diff --git a/doc/salome/gui/SMESH/input/tui_generate_flat_elements.doc b/doc/salome/gui/SMESH/input/tui_generate_flat_elements.doc index 7284a76b5..42f061b39 100644 --- a/doc/salome/gui/SMESH/input/tui_generate_flat_elements.doc +++ b/doc/salome/gui/SMESH/input/tui_generate_flat_elements.doc @@ -7,11 +7,16 @@

Double nodes on groups boundaries

\n Double nodes on shared faces between groups of volumes and create flat elements on demand. -\n The list of groups must describe a partition of the mesh volumes. The nodes of the internal -faces at the boundaries of the groups are doubled. Optionally, the internal faces are replaced +\n The list of groups must contain at least two groups. The groups have to be disjoint: no common element into two different groups. +\n The nodes of the internal faces at the boundaries of the groups are doubled. Optionally, the internal faces are replaced by flat elements. \n Triangles are transformed into prisms, and quadrangles into hexahedrons. \n The flat elements are stored in groups of volumes. +These groups are named according to the position of the group in the list: +the group j_n_p is the group of the flat elements that are built between the group #n and the group #p in the list. +If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created. +All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation). +The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples". \n \n This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder). diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 6d3e74d4e..b9a15a21e 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -11251,11 +11251,14 @@ double SMESH_MeshEditor::OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const /*! * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand. - * The list of groups must describe a partition of the mesh volumes. - * The nodes of the internal faces at the boundaries of the groups are doubled. - * In option, the internal faces are replaced by flat elements. - * Triangles are transformed in prisms, and quadrangles in hexahedrons. - * The flat elements are stored in groups of volumes. + * The list of groups must contain at least two groups. The groups have to be disjoint: no common element into two different groups. + * The nodes of the internal faces at the boundaries of the groups are doubled. Optionally, the internal faces are replaced by flat elements. + * Triangles are transformed into prisms, and quadrangles into hexahedrons. + * The flat elements are stored in groups of volumes. These groups are named according to the position of the group in the list: + * the group j_n_p is the group of the flat elements that are built between the group #n and the group #p in the list. + * If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created. + * All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation). + * The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples". * @param theElems - list of groups of volumes, where a group of volume is a set of * SMDS_MeshElements sorted by Id. * @param createJointElems - if TRUE, create the elements @@ -11289,6 +11292,32 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector emptySet; emptyMap.clear(); + MESSAGE(".. Number of domains :"<FindElement(smdsId); if (! domain.count(elem)) // neighbor is in another domain : face is shared { - DownIdType face(downIds[n], downTypes[n]); - if (!faceDomains.count(face)) - faceDomains[face] = emptyMap; // create an empty entry for face - if (!faceDomains[face].count(idom)) - { - faceDomains[face][idom] = vtkId; // volume associated to face in this domain - celldom[vtkId] = idom; - //MESSAGE(" cell with a border " << vtkId << " domain " << idom); - } + bool ok = false ; + for (int idombis = 0; idombis < theElems.size(); idombis++) // check if the neighbor belongs to another domain of the list + { + // MESSAGE("Domain " << idombis); + const TIDSortedElemSet& domainbis = theElems[idombis]; + if ( domainbis.count(elem)) ok = true ; // neighbor is in a correct domain : face is kept + } + if ( ok ) // the characteristics of the face is stored + { + DownIdType face(downIds[n], downTypes[n]); + if (!faceDomains.count(face)) + faceDomains[face] = emptyMap; // create an empty entry for face + if (!faceDomains[face].count(idom)) + { + faceDomains[face][idom] = vtkId; // volume associated to face in this domain + celldom[vtkId] = idom; + //MESSAGE(" cell with a border " << vtkId << " domain " << idom); + } + } } } } @@ -11396,6 +11435,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector > mutipleNodes; // nodes multi domains with domain order std::map > mutipleNodesToFace; // nodes multi domains with domain order to transform in Face (junction between 3 or more 2D domains) + MESSAGE(".. Duplication of the nodes"); for (int idomain = 0; idomain < theElems.size(); idomain++) { itface = faceDomains.begin(); @@ -11458,6 +11498,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector > nodeQuadDomains; std::map mapOfJunctionGroups; + MESSAGE(".. Creation of elements: simple junction"); if (createJointElems) { int idg; @@ -11637,6 +11679,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector >::const_iterator itnod = nodeDomains.begin(); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 9e06d0d69..e85a4ca1b 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -6580,13 +6580,18 @@ CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D() //================================================================================ /*! - * \brief Double nodes on shared faces between groups of volumes and create flat - * elements on demand. - * The list of groups must describe a partition of the mesh volumes. + * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand. + * The list of groups must contain at least two groups. The groups have to be disjoint: + * no common element into two different groups. * The nodes of the internal faces at the boundaries of the groups are doubled. - * In option, the internal faces are replaced by flat elements. - * Triangles are transformed in prisms, and quadrangles in hexahedrons. + * Optionally, the internal faces are replaced by flat elements. + * Triangles are transformed into prisms, and quadrangles into hexahedrons. * The flat elements are stored in groups of volumes. + * These groups are named according to the position of the group in the list: + * the group j_n_p is the group of the flat elements that are built between the group #n and the group #p in the list. + * If there is no shared faces between the group #n and the group #p in the list, the group j_n_p is not created. + * All the flat elements are gathered into the group named "joints3D" (or "joints2D" in 2D situation). + * The flat element of the multiple junctions between the simple junction are stored in a group named "jointsMultiples". * @param theDomains - list of groups of volumes * @param createJointElems - if TRUE, create the elements * @return TRUE if operation has been completed successfully, FALSE otherwise @@ -6605,6 +6610,9 @@ SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& the SMESHDS_Mesh* aMeshDS = getMeshDS(); + // MESSAGE("theDomains.length = "< domains; domains.clear(); -- 2.30.2