From 899e1770d93d57f9e7e82cdffb2ec9bdc0c86aba Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 13 Mar 2013 17:17:24 +0000 Subject: [PATCH] 0022166: [CEA 792] Regression on 07_Pentahedron.py, 12_3d_extrusion.py 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 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 8b72f7b9b..ce1621aa9 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -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 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