mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-05 04:44:18 +05:00
Regression SALOME_TESTS/Grids/smesh/viscous_layers_00/A1
This commit is contained in:
parent
95d9cf9632
commit
3f0822bd99
@ -2122,7 +2122,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
|
|||||||
theAlgo->GetUsedHypothesis( *_father, _subShape, ignoreAuxiliaryHyps ); // copy
|
theAlgo->GetUsedHypothesis( *_father, _subShape, ignoreAuxiliaryHyps ); // copy
|
||||||
|
|
||||||
// put in a compound all shapes with the same hypothesis assigned
|
// put in a compound all shapes with the same hypothesis assigned
|
||||||
// and a good ComputState
|
// and a good ComputeState
|
||||||
|
|
||||||
TopoDS_Compound aCompound;
|
TopoDS_Compound aCompound;
|
||||||
BRep_Builder aBuilder;
|
BRep_Builder aBuilder;
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include <Geom2d_Line.hxx>
|
#include <Geom2d_Line.hxx>
|
||||||
#include <Geom2d_TrimmedCurve.hxx>
|
#include <Geom2d_TrimmedCurve.hxx>
|
||||||
#include <GeomAdaptor_Curve.hxx>
|
#include <GeomAdaptor_Curve.hxx>
|
||||||
|
#include <GeomLib.hxx>
|
||||||
#include <Geom_Circle.hxx>
|
#include <Geom_Circle.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <Geom_Line.hxx>
|
#include <Geom_Line.hxx>
|
||||||
@ -1811,45 +1812,36 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge,
|
|||||||
totalNbFaces++;
|
totalNbFaces++;
|
||||||
F = TopoDS::Face( s );
|
F = TopoDS::Face( s );
|
||||||
|
|
||||||
// IDEA: if there is a problem with finding a normal,
|
|
||||||
// we can compute an area-weighted sum of normals of all faces sharing the node
|
|
||||||
gp_XY uv = helper.GetNodeUV( F, node, 0, &normOK );
|
gp_XY uv = helper.GetNodeUV( F, node, 0, &normOK );
|
||||||
Handle(Geom_Surface) surface = BRep_Tool::Surface( F );
|
Handle(Geom_Surface) surface = BRep_Tool::Surface( F );
|
||||||
surface->D1( uv.X(), uv.Y(), p, du,dv );
|
|
||||||
geomNorm = du ^ dv;
|
|
||||||
double size2 = geomNorm.SquareMagnitude();
|
|
||||||
if ( size2 < 1e-10 ) // singularity
|
|
||||||
{
|
{
|
||||||
SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator(SMDSAbs_Face);
|
gp_Dir normal;
|
||||||
while ( fIt->more() )
|
if ( GeomLib::NormEstim( surface, uv, 1e-10, normal ) < 3 )
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* f = fIt->next();
|
geomNorm = normal;
|
||||||
if ( editor.FindShape( f ) == *id )
|
normOK = true;
|
||||||
{
|
}
|
||||||
SMESH_MeshAlgos::FaceNormal( f, (gp_XYZ&) geomNorm.XYZ(), /*normalized=*/false );
|
else // hard singularity
|
||||||
size2 = geomNorm.SquareMagnitude();
|
{
|
||||||
break;
|
SMDS_ElemIteratorPtr fIt = node->GetInverseElementIterator(SMDSAbs_Face);
|
||||||
}
|
while ( fIt->more() )
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement* f = fIt->next();
|
||||||
|
if ( editor.FindShape( f ) == *id )
|
||||||
|
{
|
||||||
|
SMESH_MeshAlgos::FaceNormal( f, (gp_XYZ&) geomNorm.XYZ(), /*normalized=*/false );
|
||||||
|
if ( helper.IsReversedSubMesh( F ))
|
||||||
|
geomNorm.Reverse();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
double size2 = geomNorm.SquareMagnitude();
|
||||||
|
if ( size2 > numeric_limits<double>::min() )
|
||||||
|
geomNorm /= sqrt( size2 );
|
||||||
|
else
|
||||||
|
normOK = false;
|
||||||
}
|
}
|
||||||
// double ddu = 0, ddv = 0;
|
|
||||||
// if ( du.SquareMagnitude() > dv.SquareMagnitude() )
|
|
||||||
// ddu = 1e-3;
|
|
||||||
// else
|
|
||||||
// ddv = 1e-3;
|
|
||||||
// surface->D1( uv.X()+ddu, uv.Y()+ddv, p, du,dv );
|
|
||||||
// geomNorm = du ^ dv;
|
|
||||||
// size2 = geomNorm.SquareMagnitude();
|
|
||||||
// if ( size2 < 1e-10 )
|
|
||||||
// {
|
|
||||||
// surface->D1( uv.X()-ddu, uv.Y()-ddv, p, du,dv );
|
|
||||||
// geomNorm = du ^ dv;
|
|
||||||
// size2 = geomNorm.SquareMagnitude();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
if ( size2 > numeric_limits<double>::min() )
|
|
||||||
geomNorm /= sqrt( size2 );
|
|
||||||
else
|
|
||||||
normOK = false;
|
|
||||||
if ( helper.GetSubShapeOri( data._solid, F ) != TopAbs_REVERSED )
|
if ( helper.GetSubShapeOri( data._solid, F ) != TopAbs_REVERSED )
|
||||||
geomNorm.Reverse();
|
geomNorm.Reverse();
|
||||||
edge._normal += geomNorm.XYZ();
|
edge._normal += geomNorm.XYZ();
|
||||||
|
Loading…
Reference in New Issue
Block a user