Version: 6.3.1
Public Member Functions | Protected Attributes

SMESH.Controls.OverConstrainedFace Class Reference

#include <SMESH_ControlsDef.hxx>

Inheritance diagram for SMESH.Controls.OverConstrainedFace:
Inheritance graph
[legend]

Public Member Functions

 OverConstrainedFace ()
virtual void SetMesh (const SMDS_Mesh *theMesh)
virtual SMDSAbs_ElementType GetType () const
virtual bool IsSatisfy (long theElementId)

Protected Attributes

const SMDS_MeshmyMesh
std::vector< const
SMDS_MeshNode * > 
myLinkNodes

Detailed Description

Definition at line 435 of file SMESH_ControlsDef.hxx.


Constructor & Destructor Documentation

SMESH.Controls.OverConstrainedFace.OverConstrainedFace ( )

Definition at line 438 of file SMESH_ControlsDef.hxx.

:myMesh(0) {}

Member Function Documentation

virtual SMDSAbs_ElementType SMESH.Controls.OverConstrainedFace.GetType ( ) const [virtual]

Implements SMESH.Controls.Predicate.

Definition at line 440 of file SMESH_ControlsDef.hxx.

References SMDSAbs_Face.

{ return SMDSAbs_Face; }
bool OverConstrainedFace::IsSatisfy ( long  theElementId) [virtual]

Implements SMESH.Controls.Predicate.

Definition at line 2041 of file SMESH_Controls.cxx.

References PAL_MESH_043_3D.face, SMDS_Mesh.FindElement(), SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.GetNodeIndex(), SMESH.Controls.NumericalFunctor.myMesh, SMESH_AdvancedEditor.n1, SMESH_AdvancedEditor.n2, and SMDSAbs_Face.

{
  // An element is over-constrained if it has N-1 free borders where
  // N is the number of edges/faces for a 2D/3D element.
  if ( const SMDS_MeshElement* face = myMesh->FindElement(theElementId))
    if ( face->GetType() == SMDSAbs_Face )
    {
      int nbSharedBorders = 0;
      int nbN = face->NbCornerNodes();
      for ( int i = 0; i < nbN; ++i )
      {
        // check if a link is shared by another face
        const SMDS_MeshNode* n1 = face->GetNode( i );
        const SMDS_MeshNode* n2 = face->GetNode( (i+1)%nbN );
        SMDS_ElemIteratorPtr fIt = n1->GetInverseElementIterator( SMDSAbs_Face );
        bool isShared = false;
        while ( !isShared && fIt->more() )
        {
          const SMDS_MeshElement* f = fIt->next();
          isShared = ( f != face && f->GetNodeIndex(n2) != -1 );
        }
        if ( isShared && ++nbSharedBorders > 1 )
          break;
      }
      return ( nbSharedBorders == 1 );
    }
  return false;
}
virtual void SMESH.Controls.OverConstrainedFace.SetMesh ( const SMDS_Mesh theMesh) [virtual]

Implements SMESH.Controls.Functor.

Definition at line 439 of file SMESH_ControlsDef.hxx.

{ myMesh = theMesh; }

Field Documentation

Definition at line 444 of file SMESH_ControlsDef.hxx.

Definition at line 443 of file SMESH_ControlsDef.hxx.

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