Version: 6.3.1
Public Member Functions | Data Fields

VISCOUS._SmoothNode Struct Reference

Data of node on a shrinked FACE. More...

Public Member Functions

bool Smooth (int &badNb, Handle(Geom_Surface)&surface, SMESH_MesherHelper &helper, const double refSign, bool set3D)
 Perform laplacian smooth on the FACE.

Data Fields

const SMDS_MeshNode_node
vector< _Simplex_simplices

Detailed Description

Data of node on a shrinked FACE.

Definition at line 404 of file StdMeshers_ViscousLayers.cxx.


Member Function Documentation

bool _SmoothNode::Smooth ( int badNb,
Handle(Geom_Surface)&  surface,
SMESH_MesherHelper helper,
const double  refSign,
bool  set3D 
)

Perform laplacian smooth on the FACE.

Return values:
bool- true if the node has been moved

Definition at line 3810 of file StdMeshers_ViscousLayers.cxx.

References SMESH_MesherHelper.GetNodeUV(), SMESH_MesherHelper.GetSubShape(), SMDS_FacePosition.SetUParameter(), and SMDS_FacePosition.SetVParameter().

{
  const TopoDS_Face& face = TopoDS::Face( helper.GetSubShape() );

  // compute new UV for the node
  gp_XY newPos (0,0);
  for ( unsigned i = 0; i < _simplices.size(); ++i )
    newPos += helper.GetNodeUV( face, _simplices[i]._nPrev );
  newPos /= _simplices.size();

  // count quality metrics (orientation) of triangles around the node
  int nbOkBefore = 0;
  gp_XY tgtUV = helper.GetNodeUV( face, _node );
  for ( unsigned i = 0; i < _simplices.size(); ++i )
    nbOkBefore += _simplices[i].IsForward( tgtUV, face, helper, refSign );

  int nbOkAfter = 0;
  for ( unsigned i = 0; i < _simplices.size(); ++i )
    nbOkAfter += _simplices[i].IsForward( newPos, face, helper, refSign );

  if ( nbOkAfter < nbOkBefore )
    return false;

  SMDS_FacePosition* pos = static_cast<SMDS_FacePosition*>( _node->GetPosition() );
  pos->SetUParameter( newPos.X() );
  pos->SetVParameter( newPos.Y() );

#ifdef __myDEBUG
  set3D = true;
#endif
  if ( set3D )
  {
    gp_Pnt p = surface->Value( newPos.X(), newPos.Y() );
    const_cast< SMDS_MeshNode* >( _node )->setXYZ( p.X(), p.Y(), p.Z() );
    dumpMove( _node );
  }

  badNb += _simplices.size() - nbOkAfter;
  return ( (tgtUV-newPos).SquareModulus() > 1e-10 );
}

Field Documentation

Definition at line 406 of file StdMeshers_ViscousLayers.cxx.

Definition at line 408 of file StdMeshers_ViscousLayers.cxx.

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS