From 405388e7fa96e572b914164f186f6ab240a0a8fa Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 13 Nov 2012 11:22:37 +0000 Subject: [PATCH] 0021940: EDF 2460 SMESH : Issue with ConvertToQuadratic 1) Take FACE periodicity into accound if the FACE has no seam EDGE In FixQuadraticElements(): 2) Correctly enable fixing node parameters 3) detect curved links 2D by links on EDGES only --- src/SMESH/SMESH_MesherHelper.cxx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 60d202870..ab1cc9cab 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -283,6 +283,18 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh) myDegenShapeIds.insert( meshDS->ShapeToIndex( v.Current() )); } } + if ( !myDegenShapeIds.empty() && !myParIndex ) { + if ( surface->IsUPeriodic() || surface->IsUClosed() ) { + myParIndex |= U_periodic; + myPar1[0] = surf.FirstUParameter(); + myPar2[0] = surf.LastUParameter(); + } + else if ( surface->IsVPeriodic() || surface->IsVClosed() ) { + myParIndex |= V_periodic; + myPar1[1] = surf.FirstVParameter(); + myPar2[1] = surf.LastVParameter(); + } + } } } } @@ -3428,7 +3440,7 @@ namespace { // Structures used by FixQuadraticElements() */ //======================================================================= -void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& error, +void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError, bool volumeOnly) { // setenv NO_FixQuadraticElements to know if FixQuadraticElements() is guilty of bad conversion @@ -3462,7 +3474,8 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& error, #endif SMESH_MesherHelper h(*myMesh); h.SetSubShape( s.Current() ); - h.FixQuadraticElements( error, false ); + h.ToFixNodeParameters(true); + h.FixQuadraticElements( compError, false ); } } // fix nodes on geom faces @@ -3473,12 +3486,12 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& error, MSG("FIX FACE " << nbfaces-- << " #" << GetMeshDS()->ShapeToIndex(fIt.Key())); SMESH_MesherHelper h(*myMesh); h.SetSubShape( fIt.Key() ); - h.FixQuadraticElements( error, true); h.ToFixNodeParameters(true); + h.FixQuadraticElements( compError, true); } //perf_print_all_meters(1); - if ( error && error->myName == EDITERR_NO_MEDIUM_ON_GEOM ) - error->myComment = "during conversion to quadratic, " + if ( compError && compError->myName == EDITERR_NO_MEDIUM_ON_GEOM ) + compError->myComment = "during conversion to quadratic, " "some medium nodes were not placed on geometry to avoid distorting elements"; return; } @@ -3521,7 +3534,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& error, // Issue 0020982 // Move medium nodes to the link middle for elements whose corner nodes // are out of geometrical boundary to fix distorted elements. - force3DOutOfBoundary( *this, error ); + force3DOutOfBoundary( *this, compError ); if ( elemType == SMDSAbs_Volume ) { @@ -3595,7 +3608,9 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& error, QLink link( face->GetNode(iN), face->GetNode((iN+1)%nbN), face->GetNode(iN+nbN) ); pLink = links.insert( link ).first; faceLinks[ iN ] = & *pLink; - if ( !isCurved ) + if ( !isCurved && + link.node1()->GetPosition()->GetTypeOfPosition() < 2 && + link.node2()->GetPosition()->GetTypeOfPosition() < 2 ) isCurved = !link.IsStraight(); } // store QFace -- 2.39.2