0022103: EDF 2550 SMESH : Allow viscous layer with 3D extrusion

= Allow viscous layers on boundary EDGEs of a 2D sub-mesh

In ComputeParameters(), more attempts to get a correct result
This commit is contained in:
eap 2013-06-04 15:00:45 +00:00
parent b61aaf79a6
commit dccff92fcb
2 changed files with 12 additions and 6 deletions

View File

@ -694,12 +694,12 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
start.SetCoord( iParam, sumParam / 4.); start.SetCoord( iParam, sumParam / 4.);
} }
if ( needGrid ) { if ( needGrid ) {
// compute nodes of 3 x 3 x 3 grid // compute nodes of 10 x 10 x 10 grid
int iNode = 0; int iNode = 0;
Bnd_Box box; Bnd_Box box;
for ( double x = 0.25; x < 0.9; x += 0.25 ) for ( double x = 0.05; x < 1.; x += 0.1 )
for ( double y = 0.25; y < 0.9; y += 0.25 ) for ( double y = 0.05; y < 1.; y += 0.1 )
for ( double z = 0.25; z < 0.9; z += 0.25 ) { for ( double z = 0.05; z < 1.; z += 0.1 ) {
TxyzPair & prmPtn = my3x3x3GridNodes[ iNode++ ]; TxyzPair & prmPtn = my3x3x3GridNodes[ iNode++ ];
prmPtn.first.SetCoord( x, y, z ); prmPtn.first.SetCoord( x, y, z );
ShellPoint( prmPtn.first, prmPtn.second ); ShellPoint( prmPtn.first, prmPtn.second );
@ -718,7 +718,7 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
{ {
double minDist = DBL_MAX; double minDist = DBL_MAX;
gp_XYZ* bestParam = 0; gp_XYZ* bestParam = 0;
for ( int iNode = 0; iNode < 27; iNode++ ) { for ( int iNode = 0; iNode < 1000; iNode++ ) {
TxyzPair & prmPtn = my3x3x3GridNodes[ iNode ]; TxyzPair & prmPtn = my3x3x3GridNodes[ iNode ];
double dist = ( thePoint.XYZ() - prmPtn.second ).SquareModulus(); double dist = ( thePoint.XYZ() - prmPtn.second ).SquareModulus();
if ( dist < minDist ) { if ( dist < minDist ) {
@ -819,6 +819,12 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
<< " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist ); << " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist );
#endif #endif
const double reachedDist = sqrt( sqDistance );
if ( reachedDist > 1000 * myTolerance &&
computeParameters( thePoint, theParams, solution ) &&
reachedDist > distance() )
return true;
theParams = solution; theParams = solution;
if ( myFaceIndex > 0 ) if ( myFaceIndex > 0 )

View File

@ -383,7 +383,7 @@ public:
double myValues[ 4 ]; // values computed at myParam: square distance and 3 derivatives double myValues[ 4 ]; // values computed at myParam: square distance and 3 derivatives
typedef std::pair<gp_XYZ,gp_XYZ> TxyzPair; typedef std::pair<gp_XYZ,gp_XYZ> TxyzPair;
TxyzPair my3x3x3GridNodes[ 27 ]; // to compute the first param guess TxyzPair my3x3x3GridNodes[ 1000 ]; // to compute the first param guess
bool myGridComputed; bool myGridComputed;
}; };