Salome HOME
0022166: [CEA 792] Regression on 07_Pentahedron.py, 12_3d_extrusion.py
authoreap <eap@opencascade.com>
Wed, 13 Mar 2013 17:17:24 +0000 (17:17 +0000)
committereap <eap@opencascade.com>
Wed, 13 Mar 2013 17:17:24 +0000 (17:17 +0000)
and 13_projection_3d.py scripts from CEA test base

When projecting quadratic 1D mesh to a 'vertical' composite side, fix
node location before creating a quadratic segment in order to have a
valid position (U and shape) of medium node.

src/StdMeshers/StdMeshers_Prism_3D.cxx

index 8b72f7b9bb800586efc6cc329ede14afd6a87542..ce1621aa9379dbab2ce71c511a8938a844650a6b 100644 (file)
@@ -1162,7 +1162,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
 
         // compute nodes on target EDGEs
         rgtSide->Reverse(); // direct it same as the lftSide
-        myHelper->SetElementsOnShape( false );
+        myHelper->SetElementsOnShape( false ); // myHelper holds the prism shape
         TopoDS_Edge tgtEdge;
         for ( size_t iN = 1; iN < srcNodeStr.size()-1; ++iN ) // add nodes
         {
@@ -1173,25 +1173,24 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
         }
         for ( size_t iN = 1; iN < srcNodeStr.size(); ++iN ) // add segments
         {
-          SMDS_MeshElement* newEdge = myHelper->AddEdge( newNodes[ iN-1 ], newNodes[ iN ] );
+          // find an EDGE to set a new segment
           std::pair<int, TopAbs_ShapeEnum> id2type = 
             myHelper->GetMediumPos( newNodes[ iN-1 ], newNodes[ iN ] );
-          if ( id2type.second == TopAbs_EDGE )
-          {
-            meshDS->SetMeshElementOnShape( newEdge, id2type.first );
-          }
-          else // new nodes are on different EDGEs; put one of them on VERTEX
+          if ( id2type.second != TopAbs_EDGE )
           {
+            // new nodes are on different EDGEs; put one of them on VERTEX
             const int      edgeIndex = rgtSide->EdgeIndex( srcNodeStr[ iN-1 ].normParam );
             const double vertexParam = rgtSide->LastParameter( edgeIndex );
             const gp_Pnt           p = BRep_Tool::Pnt( rgtSide->LastVertex( edgeIndex ));
             const int         isPrev = ( Abs( srcNodeStr[ iN-1 ].normParam - vertexParam ) <
                                          Abs( srcNodeStr[ iN   ].normParam - vertexParam ));
-            meshDS->SetMeshElementOnShape( newEdge, newNodes[ iN-(1-isPrev) ]->getshapeId() );
             meshDS->UnSetNodeOnShape( newNodes[ iN-isPrev ] );
             meshDS->SetNodeOnVertex ( newNodes[ iN-isPrev ], rgtSide->LastVertex( edgeIndex ));
-            meshDS->MoveNode( newNodes[ iN-isPrev ], p.X(), p.Y(), p.Z() );
+            meshDS->MoveNode        ( newNodes[ iN-isPrev ], p.X(), p.Y(), p.Z() );
+            id2type.first = newNodes[ iN-(1-isPrev) ]->getshapeId();
           }
+          SMDS_MeshElement* newEdge = myHelper->AddEdge( newNodes[ iN-1 ], newNodes[ iN ] );
+          meshDS->SetMeshElementOnShape( newEdge, id2type.first );
         }
         myHelper->SetElementsOnShape( true );
         for ( int i = 0; i < rgtSide->NbEdges(); ++i ) // update state of sub-meshes