mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
23566: EDF 17146 - Problem with viscous layer
This commit is contained in:
parent
2dff514922
commit
ba0f425284
@ -291,7 +291,7 @@ namespace SMESH{
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Class : Length2D
|
Class : Length2D
|
||||||
Description : Functor for calculating length of edge
|
Description : Functor for calculating minimal length of edge
|
||||||
*/
|
*/
|
||||||
class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
|
class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
|
||||||
public:
|
public:
|
||||||
|
@ -804,58 +804,32 @@ bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face& F,
|
|||||||
// check that uv is correct
|
// check that uv is correct
|
||||||
TopLoc_Location loc;
|
TopLoc_Location loc;
|
||||||
Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
|
Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
|
||||||
gp_Pnt nodePnt = XYZ( n ), surfPnt(0,0,0);
|
SMESH_NodeXYZ nXYZ( n );
|
||||||
|
gp_Pnt nodePnt = nXYZ, surfPnt(0,0,0);
|
||||||
double dist = 0;
|
double dist = 0;
|
||||||
if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
|
if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
|
||||||
if ( infinit ||
|
if ( infinit ||
|
||||||
(dist = nodePnt.Distance( surfPnt = surface->Value( uv.X(), uv.Y() ))) > tol )
|
(dist = nodePnt.Distance( surfPnt = surface->Value( uv.X(), uv.Y() ))) > tol )
|
||||||
{
|
{
|
||||||
setPosOnShapeValidity( shapeID, false );
|
setPosOnShapeValidity( shapeID, false );
|
||||||
if ( !infinit && distXYZ ) {
|
|
||||||
surfPnt.Transform( loc );
|
|
||||||
distXYZ[0] = dist;
|
|
||||||
distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
|
|
||||||
}
|
|
||||||
// uv incorrect, project the node to surface
|
// uv incorrect, project the node to surface
|
||||||
GeomAPI_ProjectPointOnSurf& projector = GetProjector( F, loc, tol );
|
Handle(ShapeAnalysis_Surface) sprojector = GetSurface( F );
|
||||||
projector.SetExtremaFlag( Extrema_ExtFlag_MIN );
|
uv = sprojector->ValueOfUV( nXYZ, tol ).XY();
|
||||||
projector.Perform( nodePnt );
|
surfPnt = sprojector->Value( uv );
|
||||||
if ( !projector.IsDone() || projector.NbPoints() < 1 )
|
dist = surfPnt.Distance( nXYZ );
|
||||||
{
|
|
||||||
MESSAGE( "SMESH_MesherHelper::CheckNodeUV() failed to project" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Standard_Real U,V;
|
|
||||||
projector.LowerDistanceParameters(U,V);
|
|
||||||
uv.SetCoord( U,V );
|
|
||||||
surfPnt = surface->Value( U, V );
|
|
||||||
dist = nodePnt.Distance( surfPnt );
|
|
||||||
if ( distXYZ ) {
|
if ( distXYZ ) {
|
||||||
surfPnt.Transform( loc );
|
|
||||||
distXYZ[0] = dist;
|
distXYZ[0] = dist;
|
||||||
distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
|
distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
|
||||||
}
|
}
|
||||||
if ( dist > tol )
|
if ( dist > tol )
|
||||||
{
|
{
|
||||||
Handle(ShapeAnalysis_Surface) sprojector = GetSurface( F );
|
MESSAGE( "SMESH_MesherHelper::CheckNodeUV(), invalid projection" );
|
||||||
uv = sprojector->ValueOfUV( nodePnt, tol ).XY();
|
return false;
|
||||||
surfPnt = sprojector->Value( uv );
|
|
||||||
dist = nodePnt.Distance( surfPnt );
|
|
||||||
if ( distXYZ ) {
|
|
||||||
surfPnt.Transform( loc );
|
|
||||||
distXYZ[0] = dist;
|
|
||||||
distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
|
|
||||||
}
|
|
||||||
if ( dist > tol )
|
|
||||||
{
|
|
||||||
MESSAGE( "SMESH_MesherHelper::CheckNodeUV(), invalid projection" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// store the fixed UV on the face
|
// store the fixed UV on the face
|
||||||
if ( myShape.IsSame(F) && shapeID == myShapeID && myFixNodeParameters )
|
if ( myShape.IsSame(F) && shapeID == myShapeID && myFixNodeParameters )
|
||||||
const_cast<SMDS_MeshNode*>(n)->SetPosition
|
const_cast<SMDS_MeshNode*>(n)->SetPosition
|
||||||
( SMDS_PositionPtr( new SMDS_FacePosition( U, V )));
|
( SMDS_PositionPtr( new SMDS_FacePosition( uv.X(), uv.Y() )));
|
||||||
}
|
}
|
||||||
else if ( myShape.IsSame(F) && uv.Modulus() > numeric_limits<double>::min() )
|
else if ( myShape.IsSame(F) && uv.Modulus() > numeric_limits<double>::min() )
|
||||||
{
|
{
|
||||||
|
@ -4002,7 +4002,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
|
|||||||
const char* theURL,
|
const char* theURL,
|
||||||
bool isMultiFile )
|
bool isMultiFile )
|
||||||
{
|
{
|
||||||
if (!myStudyContext)
|
//if (!myStudyContext)
|
||||||
UpdateStudy();
|
UpdateStudy();
|
||||||
SALOMEDS::Study_var aStudy = getStudyServant();
|
SALOMEDS::Study_var aStudy = getStudyServant();
|
||||||
/* if( !theComponent->_is_nil() )
|
/* if( !theComponent->_is_nil() )
|
||||||
|
@ -1176,26 +1176,28 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
|
|||||||
}
|
}
|
||||||
// import python files corresponding to plugins if they are used in anUpdatedScript
|
// import python files corresponding to plugins if they are used in anUpdatedScript
|
||||||
{
|
{
|
||||||
TCollection_AsciiString importStr;
|
//TCollection_AsciiString importStr;
|
||||||
std::vector<std::string> pluginNames = getPluginNames();
|
std::vector<std::string> pluginNames = getPluginNames();
|
||||||
for ( size_t i = 0; i < pluginNames.size(); ++i )
|
for ( size_t i = 0; i < pluginNames.size(); ++i )
|
||||||
{
|
{
|
||||||
// Convert access to plugin members:
|
// Convert access to plugin members:
|
||||||
// e.g. StdMeshers.QUAD_REDUCED -> StdMeshersBuilder.QUAD_REDUCED
|
// e.g. StdMeshers.QUAD_REDUCED -> smeshBuilder.QUAD_REDUCED
|
||||||
TCollection_AsciiString pluginAccess = (pluginNames[i] + ".").c_str() ;
|
TCollection_AsciiString pluginAccess = (pluginNames[i] + ".").c_str() ;
|
||||||
int iFrom = 1, iPos;
|
int iFrom = 1, iPos;
|
||||||
while (( iPos = anUpdatedScript.Location( pluginAccess, iFrom, anUpdatedScript.Length() )))
|
while (( iPos = anUpdatedScript.Location( pluginAccess, iFrom, anUpdatedScript.Length() )))
|
||||||
{
|
{
|
||||||
anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
|
//anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
|
||||||
iFrom = iPos + pluginNames[i].size() + 8;
|
anUpdatedScript.Remove( iPos, pluginNames[i].size() );
|
||||||
|
anUpdatedScript.Insert( iPos, "smeshBuilder" );
|
||||||
|
iFrom = iPos - pluginNames[i].size() + 12;
|
||||||
}
|
}
|
||||||
// if any plugin member is used, import the plugin
|
// if any plugin member is used, import the plugin
|
||||||
if ( iFrom > 1 )
|
// if ( iFrom > 1 )
|
||||||
importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
|
// importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
|
||||||
" import " + pluginNames[i].c_str() +"Builder" );
|
// " import " + pluginNames[i].c_str() +"Builder" );
|
||||||
}
|
}
|
||||||
if ( !importStr.IsEmpty() )
|
// if ( !importStr.IsEmpty() )
|
||||||
initPart += importStr + "\n";
|
// initPart += importStr + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isMultiFile )
|
if ( isMultiFile )
|
||||||
|
@ -6680,6 +6680,7 @@ void _ViscousBuilder::findCollisionEdges( _SolidData& data, SMESH_MesherHelper&
|
|||||||
_EdgesOnShape& eos = data._edgesOnShape[iS];
|
_EdgesOnShape& eos = data._edgesOnShape[iS];
|
||||||
if ( eos._edges.empty() ) continue;
|
if ( eos._edges.empty() ) continue;
|
||||||
if ( eos.ShapeType() != TopAbs_EDGE && eos.ShapeType() != TopAbs_VERTEX ) continue;
|
if ( eos.ShapeType() != TopAbs_EDGE && eos.ShapeType() != TopAbs_VERTEX ) continue;
|
||||||
|
if ( !eos._sWOL.IsNull() ) continue; // PAL23566
|
||||||
|
|
||||||
for ( size_t i = 0; i < eos._edges.size(); ++i )
|
for ( size_t i = 0; i < eos._edges.size(); ++i )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user