Version: 6.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

StdMeshers_Hexa_3D Class Reference

#include <StdMeshers_Hexa_3D.hxx>

Inheritance diagram for StdMeshers_Hexa_3D:
Inheritance graph
[legend]

Public Member Functions

 StdMeshers_Hexa_3D (int hypId, int studyId, SMESH_Gen *gen)
 Constructor.
virtual ~StdMeshers_Hexa_3D ()
 Destructor.
virtual bool CheckHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)
 Check hypothesis definition to mesh a shape.
virtual bool Compute (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
 Generates hexahedron mesh on hexaedron like form using algorithm from "Application de l'interpolation transfinie à la création de maillages C0 ou G1 continus sur des triangles, quadrangles, tetraedres, pentaedres et hexaedres déformés.
virtual bool Compute (SMESH_Mesh &aMesh, SMESH_MesherHelper *aHelper)
 Computes hexahedral mesh from 2D mesh of block.
virtual bool Evaluate (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)
 evaluates size of prospective mesh on a shape
virtual std::ostream & SaveTo (std::ostream &save)
 Saves nothing in a stream.
virtual std::istream & LoadFrom (std::istream &load)
 Loads nothing from a stream.
const std::vector< std::string > & GetCompatibleHypothesis ()
 Returns all types of compatible hypotheses.
virtual const std::list< const
SMESHDS_Hypothesis * > & 
GetUsedHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true)
 Returns a list of compatible hypotheses used to mesh a shape.
const list< const
SMESHDS_Hypothesis * > & 
GetAppliedHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true)
 Returns a list of compatible hypotheses assigned to a shape in a mesh.
bool InitCompatibleHypoFilter (SMESH_HypoFilter &theFilter, const bool ignoreAuxiliary) const
 Make the filter recognize only compatible hypotheses.
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Just return false as the algorithm does not hold parameters values.
virtual bool SetParametersByDefaults (const TDefaults &dflts, const SMESH_Mesh *theMesh=0)
SMESH_ComputeErrorPtr GetComputeError () const
 return compute error
void InitComputeError ()
 initialize compute error
bool OnlyUnaryInput () const
bool NeedDescretBoundary () const
bool NeedShape () const
bool SupportSubmeshes () const
virtual void SetEventListener (SMESH_subMesh *subMesh)
 Sets event listener to submeshes if necessary.
virtual void SubmeshRestored (SMESH_subMesh *subMesh)
 Allow algo to do something after persistent restoration.

Static Public Member Functions

static bool GetNodeParamOnEdge (const SMESHDS_Mesh *theMesh, const TopoDS_Edge &theEdge, std::vector< double > &theParams)
 Fill vector of node parameters on geometrical edge, including vertex nodes.
static bool GetSortedNodesOnEdge (const SMESHDS_Mesh *theMesh, const TopoDS_Edge &theEdge, const bool ignoreMediumNodes, std::map< double, const SMDS_MeshNode * > &theNodes)
 Fill map of node parameter on geometrical edge to node it-self.
static bool IsReversedSubMesh (const TopoDS_Face &theFace, SMESHDS_Mesh *theMeshDS)
 Find out elements orientation on a geometrical face.
static double EdgeLength (const TopoDS_Edge &E)
 Compute length of an edge.
static bool FaceNormal (const SMDS_MeshElement *F, gp_XYZ &normal, bool normalized=true)
 Calculate normal of a mesh face.
static GeomAbs_Shape Continuity (TopoDS_Edge E1, TopoDS_Edge E2)
 Return continuity of two edges.
static bool IsContinuous (const TopoDS_Edge &E1, const TopoDS_Edge &E2)
 Return true if an edge can be considered as a continuation of another.
static const SMDS_MeshNodeVertexNode (const TopoDS_Vertex &V, const SMESHDS_Mesh *meshDS)
 Return the node built on a vertex.
static std::vector< const
SMDS_MeshNode * > 
GetCommonNodes (const SMDS_MeshElement *e1, const SMDS_MeshElement *e2)
 Return nodes common to two elements.

Protected Member Functions

bool error (int error, const SMESH_Comment &comment="")
 store error and comment and then return ( error == COMPERR_OK )
bool error (const SMESH_Comment &comment="")
 store COMPERR_ALGO_FAILED error and comment and then return false
bool error (SMESH_ComputeErrorPtr error)
 store error and return error->IsOK()
void addBadInputElement (const SMDS_MeshElement *elem)
 store a bad input element preventing computation, which may be a temporary one i.e.

Protected Attributes

const StdMeshers_ViscousLayers_viscousLayersHyp
std::vector< std::string > _compatibleHypothesis
std::list< const
SMESHDS_Hypothesis * > 
_appliedHypList
std::list< const
SMESHDS_Hypothesis * > 
_usedHypList
bool _onlyUnaryInput
bool _requireDescretBoundary
bool _requireShape
bool _supportSubmeshes
bool _quadraticMesh
int _error
 SMESH_ComputeErrorName or anything algo specific.
std::string _comment
 any text explaining what is wrong in Compute()
std::list< const
SMDS_MeshElement * > 
_badInputElements
 to explain COMPERR_BAD_INPUT_MESH

Detailed Description

Definition at line 41 of file StdMeshers_Hexa_3D.hxx.


Constructor & Destructor Documentation

StdMeshers_Hexa_3D::StdMeshers_Hexa_3D ( int  hypId,
int  studyId,
SMESH_Gen gen 
)

Constructor.

Definition at line 81 of file StdMeshers_Hexa_3D.cxx.

References SMESH_Algo._compatibleHypothesis, SMESH_Algo._requireShape, and MESSAGE.

  :SMESH_3D_Algo(hypId, studyId, gen)
{
  MESSAGE("StdMeshers_Hexa_3D::StdMeshers_Hexa_3D");
  _name = "Hexa_3D";
  _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
  _requireShape = false;
  _compatibleHypothesis.push_back("ViscousLayers");
}
StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D ( ) [virtual]

Destructor.

Definition at line 97 of file StdMeshers_Hexa_3D.cxx.

References MESSAGE.

{
  MESSAGE("StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D");
}

Member Function Documentation

void SMESH_Algo::addBadInputElement ( const SMDS_MeshElement elem) [protected, inherited]

store a bad input element preventing computation, which may be a temporary one i.e.

not residing the mesh, then it will be deleted by InitComputeError()

Definition at line 674 of file SMESH_Algo.cxx.

{
  if ( elem )
    _badInputElements.push_back( elem );
}
virtual bool StdMeshers_Hexa_3D.CheckHypothesis ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
SMESH_Hypothesis::Hypothesis_Status aStatus 
) [virtual]

Check hypothesis definition to mesh a shape.

Parameters:
aMesh- the mesh
aShape- the shape
aStatus- check result
Return values:
bool- true if hypothesis is well defined

Implements SMESH_Algo.

bool StdMeshers_Hexa_3D::Compute ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape 
) [virtual]

Generates hexahedron mesh on hexaedron like form using algorithm from "Application de l'interpolation transfinie à la création de maillages C0 ou G1 continus sur des triangles, quadrangles, tetraedres, pentaedres et hexaedres déformés.

" Alain PERONNET - 8 janvier 1999

Implements SMESH_Algo.

Definition at line 278 of file StdMeshers_Hexa_3D.cxx.

References SMESH_MesherHelper.AddNode(), SMESH_MesherHelper.AddVolume(), B_BACK, B_BOTTOM, B_FRONT, B_LEFT, B_RIGHT, B_TOP, COMPERR_BAD_SHAPE, ComputePentahedralMesh(), StdMeshers_FaceSide.Edge(), SMDS_MeshElement.GetNode(), SMESH_MesherHelper.GetNodeU(), SMESH_MesherHelper.GetSubShapeOri(), SMESH_Block.ID_E00z, SMESH_Block.ID_E01z, SMESH_Block.ID_E0y0, SMESH_Block.ID_E0y1, SMESH_Block.ID_E10z, SMESH_Block.ID_E11z, SMESH_Block.ID_E1y0, SMESH_Block.ID_E1y1, SMESH_Block.ID_Ex00, SMESH_Block.ID_Ex01, SMESH_Block.ID_Ex10, SMESH_Block.ID_Ex11, SMESH_Block.ID_F0yz, SMESH_Block.ID_F1yz, SMESH_Block.ID_Fx0z, SMESH_Block.ID_Fx1z, SMESH_Block.ID_Fxy0, SMESH_Block.ID_Fxy1, SMESH_Block.ID_Shell, SMESH_Block.ID_V000, SMESH_Block.ID_V001, SMESH_Block.ID_V010, SMESH_Block.ID_V011, SMESH_Block.ID_V100, SMESH_Block.ID_V101, SMESH_Block.ID_V110, SMESH_Block.ID_V111, SMESH_MesherHelper.IsQuadraticSubMesh(), SMESH_MesherHelper.LoadNodeColumns(), SMESHDS_Mesh.MeshElements(), MESSAGE, SMDS_MeshElement.NbCornerNodes(), StdMeshers_FaceSide.NbEdges(), SMESHDS_SubMesh.NbElements(), SMESH_test3.pi, Q_BOTTOM, Q_LEFT, Q_RIGHT, Q_TOP, reverse(), SMESH_MesherHelper.SetElementsOnShape(), SMESH_MesherHelper.SetSubShape(), SMESH_Block.ShellPoint(), ex13_hole1partial.x, and ex13_hole1partial.y.

{
  // PAL14921. Enable catching std::bad_alloc and Standard_OutOfMemory outside
  //Unexpect aCatch(SalomeException);
  MESSAGE("StdMeshers_Hexa_3D::Compute");
  SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();

  // Shape verification
  // ----------------------

  // shape must be a solid (or a shell) with 6 faces
  TopExp_Explorer exp(aShape,TopAbs_SHELL);
  if ( !exp.More() )
    return error(COMPERR_BAD_SHAPE, "No SHELL in the geometry");
  if ( exp.Next(), exp.More() )
    return error(COMPERR_BAD_SHAPE, "More than one SHELL in the geometry");

  TopTools_IndexedMapOfShape FF;
  TopExp::MapShapes( aShape, TopAbs_FACE, FF);
  if ( FF.Extent() != 6)
  {
    static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), 0, _gen);
    if ( !compositeHexa.Compute( aMesh, aShape ))
      return error( compositeHexa.GetComputeError() );
    return true;
  }

  // Find sides of a cube
  // ---------------------
  
  FaceQuadStructPtr quad[ 6 ];
  StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen);
  for ( int i = 0; i < 6; ++i )
  {
    if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 )))))
      return error( quadAlgo.GetComputeError() );
    if ( quad[i]->side.size() != 4 )
      return error( COMPERR_BAD_SHAPE, "Not a quadrangular box side" );
  }

  _FaceGrid aCubeSide[ 6 ];

  swap( aCubeSide[B_BOTTOM]._quad, quad[0] );
  swap( aCubeSide[B_BOTTOM]._quad->side[ Q_RIGHT],// direct the normal of bottom quad inside cube
        aCubeSide[B_BOTTOM]._quad->side[ Q_LEFT ] );

  aCubeSide[B_FRONT]._quad = getQuadWithBottom( aCubeSide[B_BOTTOM]._quad->side[Q_BOTTOM], quad );
  aCubeSide[B_RIGHT]._quad = getQuadWithBottom( aCubeSide[B_BOTTOM]._quad->side[Q_RIGHT ], quad );
  aCubeSide[B_BACK ]._quad = getQuadWithBottom( aCubeSide[B_BOTTOM]._quad->side[Q_TOP   ], quad );
  aCubeSide[B_LEFT ]._quad = getQuadWithBottom( aCubeSide[B_BOTTOM]._quad->side[Q_LEFT  ], quad );
  if ( aCubeSide[B_FRONT ]._quad )
    aCubeSide[B_TOP  ]._quad = getQuadWithBottom( aCubeSide[B_FRONT ]._quad->side[Q_TOP ], quad );

  for ( int i = 1; i < 6; ++i )
    if ( !aCubeSide[i]._quad )
      return error( COMPERR_BAD_SHAPE );

  // Make viscous layers
  // --------------------

  SMESH_ProxyMesh::Ptr proxymesh;
  if ( _viscousLayersHyp )
  {
    proxymesh = _viscousLayersHyp->Compute( aMesh, aShape, /*makeN2NMap=*/ true );
    if ( !proxymesh )
      return false;
  }

  // Check if there are triangles on cube sides
  // -------------------------------------------

  if ( aMesh.NbTriangles() > 0 )
  {
    for ( int i = 0; i < 6; ++i )
    {
      const TopoDS_Face& sideF = aCubeSide[i]._quad->face;
      if ( SMESHDS_SubMesh* smDS = meshDS->MeshElements( sideF ))
      {
        bool isAllQuad = true;
        SMDS_ElemIteratorPtr fIt = smDS->GetElements();
        while ( fIt->more() && isAllQuad )
        {
          const SMDS_MeshElement* f = fIt->next();
          isAllQuad = ( f->NbCornerNodes() == 4 );
        }
        if ( !isAllQuad )
        {
          SMESH_ComputeErrorPtr err = ComputePentahedralMesh(aMesh, aShape, proxymesh.get());
          return error( err );
        }
      }
    }
  }

  // Check presence of regular grid mesh on FACEs of the cube
  // ------------------------------------------------------------

  // tool creating quadratic elements if needed
  SMESH_MesherHelper helper (aMesh);
  _quadraticMesh = helper.IsQuadraticSubMesh(aShape);

  for ( int i = 0; i < 6; ++i )
  {
    const TopoDS_Face& F = aCubeSide[i]._quad->face;
    StdMeshers_FaceSide* baseQuadSide = aCubeSide[i]._quad->side[ Q_BOTTOM ];
    vector< TopAbs_Orientation > eOri( baseQuadSide->NbEdges() );

    for ( int iE = 0; iE < baseQuadSide->NbEdges(); ++iE )
    {
      const TopoDS_Edge& baseE = baseQuadSide->Edge( iE );
      eOri[ iE ] = baseE.Orientation();

      // assure correctness of node positions on baseE:
      // helper.GetNodeU() will fix positions if they are wrong
      if ( SMESHDS_SubMesh* smDS = meshDS->MeshElements( baseE ))
      {
        bool ok;
        helper.SetSubShape( baseE );
        SMDS_ElemIteratorPtr eIt = smDS->GetElements();
        while ( eIt->more() )
        {
          const SMDS_MeshElement* e = eIt->next();
          helper.GetNodeU( baseE, e->GetNode(0), e->GetNode(1), &ok);
          helper.GetNodeU( baseE, e->GetNode(1), e->GetNode(0), &ok);
        }
      }

      // load grid
      TParam2ColumnMap u2nodesMap;
      if ( !helper.LoadNodeColumns( u2nodesMap, F, baseE, meshDS, proxymesh.get() ))
      {
        SMESH_ComputeErrorPtr err = ComputePentahedralMesh(aMesh, aShape, proxymesh.get());
        return error( err );
      }
      // store u2nodesMap
      if ( iE == 0 )
      {
        aCubeSide[i]._u2nodesMap.swap( u2nodesMap );
      }
      else // unite 2 maps
      {
        if ( eOri[0] == eOri[iE] )
          append( aCubeSide[i]._u2nodesMap, u2nodesMap.begin(), u2nodesMap.end());
        else
          append( aCubeSide[i]._u2nodesMap, u2nodesMap.rbegin(), u2nodesMap.rend());
      }
    }
    // check if the loaded grid corresponds to nb of quadrangles
    const SMESHDS_SubMesh* faceSubMesh =
      proxymesh ? proxymesh->GetSubMesh( F ) : meshDS->MeshElements( F );
    const int nbQuads = faceSubMesh->NbElements();
    const int nbHor = aCubeSide[i]._u2nodesMap.size() - 1;
    const int nbVer = aCubeSide[i]._u2nodesMap.begin()->second.size() - 1;
    if ( nbQuads != nbHor * nbVer )
    {
      SMESH_ComputeErrorPtr err = ComputePentahedralMesh(aMesh, aShape, proxymesh.get());
      return error( err );
    }
  }

  // Orient loaded grids of cube sides along axis of the unitary cube coord system
  for ( int i = 0; i < 6; ++i )
  {
    bool reverse = false;
    if ( helper.GetSubShapeOri( aShape.Oriented( TopAbs_FORWARD ),
                                aCubeSide[i]._quad->face ) == TopAbs_REVERSED )
      reverse = !reverse;

    if ( helper.GetSubShapeOri( aCubeSide[i]._quad->face.Oriented( TopAbs_FORWARD ),
                                aCubeSide[i]._quad->side[0]->Edge(0) ) == TopAbs_REVERSED )
      reverse = !reverse;

    if ( i == B_BOTTOM ||
         i == B_LEFT   ||
         i == B_BACK )
      reverse = !reverse;

    aCubeSide[i]._columns.resize( aCubeSide[i]._u2nodesMap.size() );

    int iFwd = 0, iRev = aCubeSide[i]._columns.size()-1;
    int* pi = reverse ? &iRev : &iFwd;
    TParam2ColumnMap::iterator u2nn = aCubeSide[i]._u2nodesMap.begin();
    for ( ; iFwd < aCubeSide[i]._columns.size(); --iRev, ++iFwd, ++u2nn )
      aCubeSide[i]._columns[ *pi ].swap( u2nn->second );

    aCubeSide[i]._u2nodesMap.clear();
  }
  
  if ( proxymesh )
    for ( int i = 0; i < 6; ++i )
      for ( unsigned j = 0; j < aCubeSide[i]._columns.size(); ++j)
        for ( unsigned k = 0; k < aCubeSide[i]._columns[j].size(); ++k)
        {
          const SMDS_MeshNode* & n = aCubeSide[i]._columns[j][k];
          n = proxymesh->GetProxyNode( n );
        }

  // 4) Create internal nodes of the cube
  // -------------------------------------

  helper.SetSubShape( aShape );
  helper.SetElementsOnShape(true);

  // shortcuts to sides
  _FaceGrid* fBottom = & aCubeSide[ B_BOTTOM ];
  _FaceGrid* fRight  = & aCubeSide[ B_RIGHT  ];
  _FaceGrid* fTop    = & aCubeSide[ B_TOP    ];
  _FaceGrid* fLeft   = & aCubeSide[ B_LEFT   ];
  _FaceGrid* fFront  = & aCubeSide[ B_FRONT  ];
  _FaceGrid* fBack   = & aCubeSide[ B_BACK   ];

  // cube size measured in nb of nodes
  int x, xSize = fBottom->_columns.size() , X = xSize - 1;
  int y, ySize = fLeft->_columns.size()   , Y = ySize - 1;
  int z, zSize = fLeft->_columns[0].size(), Z = zSize - 1;

  // columns of internal nodes "rising" from nodes of fBottom
  _Indexer colIndex( xSize, ySize );
  vector< vector< const SMDS_MeshNode* > > columns( colIndex.size() );

  // fill node columns by front and back box sides
  for ( x = 0; x < xSize; ++x ) {
    vector< const SMDS_MeshNode* >& column0 = columns[ colIndex( x, 0 )];
    vector< const SMDS_MeshNode* >& column1 = columns[ colIndex( x, Y )];
    column0.resize( zSize );
    column1.resize( zSize );
    for ( z = 0; z < zSize; ++z ) {
      column0[ z ] = fFront->GetNode( x, z );
      column1[ z ] = fBack ->GetNode( x, z );
    }
  }
  // fill node columns by left and right box sides
  for ( y = 1; y < ySize-1; ++y ) {
    vector< const SMDS_MeshNode* >& column0 = columns[ colIndex( 0, y )];
    vector< const SMDS_MeshNode* >& column1 = columns[ colIndex( X, y )];
    column0.resize( zSize );
    column1.resize( zSize );
    for ( z = 0; z < zSize; ++z ) {
      column0[ z ] = fLeft ->GetNode( y, z );
      column1[ z ] = fRight->GetNode( y, z );
    }
  }
  // get nodes from top and bottom box sides
  for ( x = 1; x < xSize-1; ++x ) {
    for ( y = 1; y < ySize-1; ++y ) {
      vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )];
      column.resize( zSize );
      column.front() = fBottom->GetNode( x, y );
      column.back()  = fTop   ->GetNode( x, y );
    }
  }

  // projection points of the internal node on cube sub-shapes by which
  // coordinates of the internal node are computed
  vector<gp_XYZ> pointsOnShapes( SMESH_Block::ID_Shell );

  // projections on vertices are constant
  pointsOnShapes[ SMESH_Block::ID_V000 ] = fBottom->GetXYZ( 0, 0 );
  pointsOnShapes[ SMESH_Block::ID_V100 ] = fBottom->GetXYZ( X, 0 );
  pointsOnShapes[ SMESH_Block::ID_V010 ] = fBottom->GetXYZ( 0, Y );
  pointsOnShapes[ SMESH_Block::ID_V110 ] = fBottom->GetXYZ( X, Y );
  pointsOnShapes[ SMESH_Block::ID_V001 ] = fTop->GetXYZ( 0, 0 );
  pointsOnShapes[ SMESH_Block::ID_V101 ] = fTop->GetXYZ( X, 0 );
  pointsOnShapes[ SMESH_Block::ID_V011 ] = fTop->GetXYZ( 0, Y );
  pointsOnShapes[ SMESH_Block::ID_V111 ] = fTop->GetXYZ( X, Y );

  for ( x = 1; x < xSize-1; ++x )
  {
    gp_XYZ params; // normalized parameters of internal node within a unit box
    params.SetCoord( 1, x / double(X) );
    for ( y = 1; y < ySize-1; ++y )
    {
      params.SetCoord( 2, y / double(Y) );
      // a column to fill in during z loop
      vector< const SMDS_MeshNode* >& column = columns[ colIndex( x, y )];
      // projection points on horizontal edges
      pointsOnShapes[ SMESH_Block::ID_Ex00 ] = fBottom->GetXYZ( x, 0 );
      pointsOnShapes[ SMESH_Block::ID_Ex10 ] = fBottom->GetXYZ( x, Y );
      pointsOnShapes[ SMESH_Block::ID_E0y0 ] = fBottom->GetXYZ( 0, y );
      pointsOnShapes[ SMESH_Block::ID_E1y0 ] = fBottom->GetXYZ( X, y );
      pointsOnShapes[ SMESH_Block::ID_Ex01 ] = fTop->GetXYZ( x, 0 );
      pointsOnShapes[ SMESH_Block::ID_Ex11 ] = fTop->GetXYZ( x, Y );
      pointsOnShapes[ SMESH_Block::ID_E0y1 ] = fTop->GetXYZ( 0, y );
      pointsOnShapes[ SMESH_Block::ID_E1y1 ] = fTop->GetXYZ( X, y );
      // projection points on horizontal faces
      pointsOnShapes[ SMESH_Block::ID_Fxy0 ] = fBottom->GetXYZ( x, y );
      pointsOnShapes[ SMESH_Block::ID_Fxy1 ] = fTop   ->GetXYZ( x, y );
      for ( z = 1; z < zSize-1; ++z ) // z loop
      {
        params.SetCoord( 3, z / double(Z) );
        // projection points on vertical edges
        pointsOnShapes[ SMESH_Block::ID_E00z ] = fFront->GetXYZ( 0, z );    
        pointsOnShapes[ SMESH_Block::ID_E10z ] = fFront->GetXYZ( X, z );    
        pointsOnShapes[ SMESH_Block::ID_E01z ] = fBack->GetXYZ( 0, z );    
        pointsOnShapes[ SMESH_Block::ID_E11z ] = fBack->GetXYZ( X, z );
        // projection points on vertical faces
        pointsOnShapes[ SMESH_Block::ID_Fx0z ] = fFront->GetXYZ( x, z );    
        pointsOnShapes[ SMESH_Block::ID_Fx1z ] = fBack ->GetXYZ( x, z );    
        pointsOnShapes[ SMESH_Block::ID_F0yz ] = fLeft ->GetXYZ( y, z );    
        pointsOnShapes[ SMESH_Block::ID_F1yz ] = fRight->GetXYZ( y, z );

        // compute internal node coordinates
        gp_XYZ coords;
        SMESH_Block::ShellPoint( params, pointsOnShapes, coords );
        column[ z ] = helper.AddNode( coords.X(), coords.Y(), coords.Z() );

      }
    }
  }

  // side data no more needed, free memory
  for ( int i = 0; i < 6; ++i )
    aCubeSide[i]._columns.clear();

  // 5) Create hexahedrons
  // ---------------------

  for ( x = 0; x < xSize-1; ++x ) {
    for ( y = 0; y < ySize-1; ++y ) {
      vector< const SMDS_MeshNode* >& col00 = columns[ colIndex( x, y )];
      vector< const SMDS_MeshNode* >& col10 = columns[ colIndex( x+1, y )];
      vector< const SMDS_MeshNode* >& col01 = columns[ colIndex( x, y+1 )];
      vector< const SMDS_MeshNode* >& col11 = columns[ colIndex( x+1, y+1 )];
      for ( z = 0; z < zSize-1; ++z )
      {
        // bottom face normal of a hexa mush point outside the volume
        helper.AddVolume(col00[z],   col01[z],   col11[z],   col10[z],
                         col00[z+1], col01[z+1], col11[z+1], col10[z+1]);
      }
    }
  }
  return true;
}
bool StdMeshers_Hexa_3D::Compute ( SMESH_Mesh aMesh,
SMESH_MesherHelper aHelper 
) [virtual]

Computes hexahedral mesh from 2D mesh of block.

Reimplemented from SMESH_Algo.

Definition at line 738 of file StdMeshers_Hexa_3D.cxx.

References StdMeshers_HexaFromSkin_3D.Compute(), SMESH_Algo.GetComputeError(), and SMESH_Algo.InitComputeError().

{
  static StdMeshers_HexaFromSkin_3D * algo = 0;
  if ( !algo ) {
    SMESH_Gen* gen = aMesh.GetGen();
    algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), 0, gen );
  }
  algo->InitComputeError();
  algo->Compute( aMesh, aHelper );
  return error( algo->GetComputeError());
}
GeomAbs_Shape SMESH_Algo::Continuity ( TopoDS_Edge  E1,
TopoDS_Edge  E2 
) [static, inherited]

Return continuity of two edges.

Parameters:
E1- the 1st edge
E2- the 2nd edge
Return values:
GeomAbs_Shape- regularity at the junction between E1 and E2

Definition at line 494 of file SMESH_Algo.cxx.

References SMESH_AdvancedEditor.tol.

{
  //E1.Orientation(TopAbs_FORWARD), E2.Orientation(TopAbs_FORWARD); // avoid pb with internal edges
  if (E1.Orientation() > TopAbs_REVERSED) // INTERNAL
      E1.Orientation( TopAbs_FORWARD );
  if (E2.Orientation() > TopAbs_REVERSED) // INTERNAL
      E2.Orientation( TopAbs_FORWARD );
  TopoDS_Vertex V = TopExp::LastVertex (E1, true);
  if ( !V.IsSame( TopExp::FirstVertex(E2, true )))
    if ( !TopExp::CommonVertex( E1, E2, V ))
      return GeomAbs_C0;
  Standard_Real u1 = BRep_Tool::Parameter( V, E1 );
  Standard_Real u2 = BRep_Tool::Parameter( V, E2 );
  BRepAdaptor_Curve C1( E1 ), C2( E2 );
  Standard_Real tol = BRep_Tool::Tolerance( V );
  Standard_Real angTol = 2e-3;
  try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
    OCC_CATCH_SIGNALS;
#endif
    return BRepLProp::Continuity(C1, C2, u1, u2, tol, angTol);
  }
  catch (Standard_Failure) {
  }
  return GeomAbs_C0;
}
double SMESH_Algo::EdgeLength ( const TopoDS_Edge &  E) [static, inherited]

Compute length of an edge.

Parameters:
E- the edge
Return values:
double- the length

Definition at line 167 of file SMESH_Algo.cxx.

References Handle().

Referenced by StdMeshers_PrismAsBlock.Init().

{
  double UMin = 0, UMax = 0;
  if (BRep_Tool::Degenerated(E))
    return 0;
  TopLoc_Location L;
  Handle(Geom_Curve) C = BRep_Tool::Curve(E, L, UMin, UMax);
  GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); //range is important for periodic curves
  double length = GCPnts_AbscissaPoint::Length(AdaptCurve, UMin, UMax);
  return length;
}
bool SMESH_Algo::error ( SMESH_ComputeErrorPtr  error) [protected, inherited]

store error and return error->IsOK()

store error and return ( error == COMPERR_OK )

Definition at line 623 of file SMESH_Algo.cxx.

{
  if ( error ) {
    _error   = error->myName;
    _comment = error->myComment;
    _badInputElements = error->myBadElements;
    return error->IsOK();
  }
  return true;
}
bool SMESH_Algo.error ( int  error,
const SMESH_Comment comment = "" 
) [protected, inherited]
bool SMESH_Algo.error ( const SMESH_Comment comment = "") [protected, inherited]

store COMPERR_ALGO_FAILED error and comment and then return false

Definition at line 340 of file SMESH_Algo.hxx.

References COMPERR_ALGO_FAILED, and SMESH_Algo.error().

Referenced by SMESH_Algo.error().

  { return error(COMPERR_ALGO_FAILED, comment); }
virtual bool StdMeshers_Hexa_3D.Evaluate ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
MapShapeNbElems aResMap 
) [virtual]

evaluates size of prospective mesh on a shape

Parameters:
aMesh- the mesh
aShape- the shape
aNbElems- prospective number of elements by types
Return values:
bool- is a success

Implements SMESH_Algo.

bool SMESH_Algo::FaceNormal ( const SMDS_MeshElement F,
gp_XYZ &  normal,
bool  normalized = true 
) [static, inherited]

Calculate normal of a mesh face.

Definition at line 185 of file SMESH_Algo.cxx.

References SMDS_MeshElement.GetNode(), SMDS_MeshElement.GetType(), SMDS_MeshElement.IsQuadratic(), SMDS_MeshElement.NbNodes(), ex29_refine.node(), SMDSAbs_Face, SMDS_MeshNode.X(), SMDS_MeshNode.Y(), and SMDS_MeshNode.Z().

Referenced by SMESH_ElementSearcherImpl.findOuterBoundary(), and SMESH_ElementSearcherImpl.GetPointState().

{
  if ( !F || F->GetType() != SMDSAbs_Face )
    return false;

  normal.SetCoord(0,0,0);
  int nbNodes = F->IsQuadratic() ? F->NbNodes()/2 : F->NbNodes();
  for ( int i = 0; i < nbNodes-2; ++i )
  {
    gp_XYZ p[3];
    for ( int n = 0; n < 3; ++n )
    {
      const SMDS_MeshNode* node = F->GetNode( i + n );
      p[n].SetCoord( node->X(), node->Y(), node->Z() );
    }
    normal += ( p[2] - p[1] ) ^ ( p[0] - p[1] );
  }
  double size2 = normal.SquareModulus();
  bool ok = ( size2 > numeric_limits<double>::min() * numeric_limits<double>::min());
  if ( normalized && ok )
    normal /= sqrt( size2 );

  return ok;
}
const list< const SMESHDS_Hypothesis * > & SMESH_Algo::GetAppliedHypothesis ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
const bool  ignoreAuxiliary = true 
) [inherited]

Returns a list of compatible hypotheses assigned to a shape in a mesh.

List the relevant hypothesis associated to the shape.

Parameters:
aMesh- the mesh
aShape- the shape
ignoreAuxiliary- do not include auxiliary hypotheses in the list
Return values:
conststd.list <const SMESHDS_Hypothesis*> - hypotheses list

List the relevant hypothesis associated to the shape. Relevant hypothesis have a name (type) listed in the algorithm. Hypothesis associated to father shape -are not- taken into account (see GetUsedHypothesis)

Relevant hypothesis have a name (type) listed in the algorithm. Hypothesis associated to father shape -are not- taken into account (see GetUsedHypothesis)

Definition at line 149 of file SMESH_Algo.cxx.

{
  _appliedHypList.clear();
  SMESH_HypoFilter filter;
  if ( InitCompatibleHypoFilter( filter, ignoreAuxiliary ))
    aMesh.GetHypotheses( aShape, filter, _appliedHypList, false );

  return _appliedHypList;
}
vector< const SMDS_MeshNode * > SMESH_Algo::GetCommonNodes ( const SMDS_MeshElement e1,
const SMDS_MeshElement e2 
) [static, inherited]

Return nodes common to two elements.

Definition at line 547 of file SMESH_Algo.cxx.

References SMDS_MeshElement.GetNode(), SMDS_MeshElement.GetNodeIndex(), and SMDS_MeshElement.NbNodes().

Referenced by StdMeshers_QuadToTriaAdaptor.Compute2ndPart(), SMESH_MeshEditor.ConvertFromQuadratic(), and SMESH_ElementSearcherImpl.GetPointState().

{
  vector< const SMDS_MeshNode*> common;
  for ( int i = 0 ; i < e1->NbNodes(); ++i )
    if ( e2->GetNodeIndex( e1->GetNode( i )) >= 0 )
      common.push_back( e1->GetNode( i ));
  return common;
}
const std::vector< std::string >& SMESH_Algo.GetCompatibleHypothesis ( ) [inherited]

Returns all types of compatible hypotheses.

SMESH_ComputeErrorPtr SMESH_Algo.GetComputeError ( ) const [inherited]

return compute error

Referenced by Compute().

bool SMESH_Algo::GetNodeParamOnEdge ( const SMESHDS_Mesh theMesh,
const TopoDS_Edge &  theEdge,
std::vector< double > &  theParams 
) [static, inherited]

Fill vector of node parameters on geometrical edge, including vertex nodes.

Parameters:
theMesh- The mesh containing nodes
theEdge- The geometrical edge of interest
theParams- The resulting vector of sorted node parameters
Return values:
bool- false if not all parameters are OK

Definition at line 343 of file SMESH_Algo.cxx.

References SMESHDS_SubMesh.GetElements(), SMESHDS_SubMesh.GetNodes(), SMDS_MeshNode.GetPosition(), SMDS_Position.GetTypeOfPosition(), SMDS_EdgePosition.GetUParameter(), SMESHDS_Mesh.MeshElements(), ex29_refine.node(), and SMDS_TOP_EDGE.

Referenced by StdMeshers_Arithmetic1D.SetParametersByMesh().

{
  theParams.clear();

  if ( !theMesh || theEdge.IsNull() )
    return false;

  SMESHDS_SubMesh * eSubMesh = theMesh->MeshElements( theEdge );
  if ( !eSubMesh || !eSubMesh->GetElements()->more() )
    return false; // edge is not meshed

  //int nbEdgeNodes = 0;
  set < double > paramSet;
  if ( eSubMesh )
  {
    // loop on nodes of an edge: sort them by param on edge
    SMDS_NodeIteratorPtr nIt = eSubMesh->GetNodes();
    while ( nIt->more() )
    {
      const SMDS_MeshNode* node = nIt->next();
      const SMDS_PositionPtr& pos = node->GetPosition();
      if ( pos->GetTypeOfPosition() != SMDS_TOP_EDGE )
        return false;
      const SMDS_EdgePosition* epos =
        static_cast<const SMDS_EdgePosition*>(node->GetPosition());
      if ( !paramSet.insert( epos->GetUParameter() ).second )
        return false; // equal parameters
    }
  }
  // add vertex nodes params
  TopoDS_Vertex V1,V2;
  TopExp::Vertices( theEdge, V1, V2);
  if ( VertexNode( V1, theMesh ) &&
       !paramSet.insert( BRep_Tool::Parameter(V1,theEdge) ).second )
    return false; // there are equal parameters
  if ( VertexNode( V2, theMesh ) &&
       !paramSet.insert( BRep_Tool::Parameter(V2,theEdge) ).second )
    return false; // there are equal parameters

  // fill the vector
  theParams.resize( paramSet.size() );
  set < double >::iterator   par    = paramSet.begin();
  vector< double >::iterator vecPar = theParams.begin();
  for ( ; par != paramSet.end(); ++par, ++vecPar )
    *vecPar = *par;

  return theParams.size() > 1;
}
bool SMESH_Algo::GetSortedNodesOnEdge ( const SMESHDS_Mesh theMesh,
const TopoDS_Edge &  theEdge,
const bool  ignoreMediumNodes,
std::map< double, const SMDS_MeshNode * > &  theNodes 
) [static, inherited]

Fill map of node parameter on geometrical edge to node it-self.

Fill vector of node parameters on geometrical edge, including vertex nodes.

Parameters:
theMesh- The mesh containing nodes
theEdge- The geometrical edge of interest
theNodes- The resulting map
ignoreMediumNodes- to store medium nodes of quadratic elements or not
Return values:
bool- false if not all parameters are OK
Parameters:
theMesh- The mesh containing nodes
theEdge- The geometrical edge of interest
theParams- The resulting vector of sorted node parameters
Return values:
bool- false if not all parameters are OK

Definition at line 404 of file SMESH_Algo.cxx.

References SMESHDS_SubMesh.GetElements(), SMDS_MeshNode.GetInverseElementIterator(), SMESHDS_SubMesh.GetNodes(), SMDS_MeshNode.GetPosition(), SMDS_Position.GetTypeOfPosition(), SMDS_EdgePosition.GetUParameter(), SMESHDS_Mesh.MeshElements(), SMESH_AdvancedEditor.n1, SMESH_AdvancedEditor.n2, ex29_refine.node(), and SMDS_TOP_EDGE.

Referenced by VISCOUS._ViscousBuilder.addBoundaryElements(), SMESH_MesherHelper.LoadNodeColumns(), and _FaceSide.StoreNodes().

{
  theNodes.clear();

  if ( !theMesh || theEdge.IsNull() )
    return false;

  SMESHDS_SubMesh * eSubMesh = theMesh->MeshElements( theEdge );
  if ( !eSubMesh || !eSubMesh->GetElements()->more() )
    return false; // edge is not meshed

  int nbNodes = 0;
  set < double > paramSet;
  if ( eSubMesh )
  {
    // loop on nodes of an edge: sort them by param on edge
    SMDS_NodeIteratorPtr nIt = eSubMesh->GetNodes();
    while ( nIt->more() )
    {
      const SMDS_MeshNode* node = nIt->next();
      if ( ignoreMediumNodes ) {
        SMDS_ElemIteratorPtr elemIt = node->GetInverseElementIterator();
        if ( elemIt->more() && elemIt->next()->IsMediumNode( node ))
          continue;
      }
      const SMDS_PositionPtr& pos = node->GetPosition();
      if ( pos->GetTypeOfPosition() != SMDS_TOP_EDGE )
        return false;
      const SMDS_EdgePosition* epos =
        static_cast<const SMDS_EdgePosition*>(node->GetPosition());
      theNodes.insert( make_pair( epos->GetUParameter(), node ));
      //MESSAGE("U " << epos->GetUParameter() << " ID " << node->GetID());
      ++nbNodes;
    }
  }
  // add vertex nodes
  TopoDS_Vertex v1, v2;
  TopExp::Vertices(theEdge, v1, v2);
  const SMDS_MeshNode* n1 = VertexNode( v1, (SMESHDS_Mesh*) theMesh );
  const SMDS_MeshNode* n2 = VertexNode( v2, (SMESHDS_Mesh*) theMesh );
  //MESSAGE("Vertices ID " << n1->GetID() << " " << n2->GetID());
  Standard_Real f, l;
  BRep_Tool::Range(theEdge, f, l);
  if ( v1.Orientation() != TopAbs_FORWARD )
    std::swap( f, l );
  if ( n1 && ++nbNodes )
    theNodes.insert( make_pair( f, n1 ));
  if ( n2 && ++nbNodes )
    theNodes.insert( make_pair( l, n2 ));

  return theNodes.size() == nbNodes;
}
virtual const std::list<const SMESHDS_Hypothesis *>& SMESH_Algo.GetUsedHypothesis ( SMESH_Mesh aMesh,
const TopoDS_Shape &  aShape,
const bool  ignoreAuxiliary = true 
) [virtual, inherited]

Returns a list of compatible hypotheses used to mesh a shape.

Parameters:
aMesh- the mesh
aShape- the shape
ignoreAuxiliary- do not include auxiliary hypotheses in the list
Return values:
conststd.list <const SMESHDS_Hypothesis*> - hypotheses list

List the hypothesis used by the algorithm associated to the shape. Hypothesis associated to father shape -are- taken into account (see GetAppliedHypothesis). Relevant hypothesis have a name (type) listed in the algorithm. This method could be surcharged by specific algorithms, in case of several hypothesis simultaneously applicable.

Reimplemented in StdMeshers_Regular_1D.

Referenced by StdMeshers_SegmentAroundVertex_0D.CheckHypothesis(), and StdMeshers_Projection_3D.CheckHypothesis().

bool SMESH_Algo::InitCompatibleHypoFilter ( SMESH_HypoFilter theFilter,
const bool  ignoreAuxiliary 
) const [inherited]

Make the filter recognize only compatible hypotheses.

Make filter recognize only compatible hypotheses.

Parameters:
theFilter- the filter to initialize
ignoreAuxiliary- make filter ignore compatible auxiliary hypotheses
Return values:
bool- true if the algo has compatible hypotheses
Parameters:
theFilter- the filter to initialize
ignoreAuxiliary- make filter ignore compatible auxiliary hypotheses

Definition at line 468 of file SMESH_Algo.cxx.

References SMESH_HypoFilter.AndNot(), SMESH_HypoFilter.HasName(), SMESH_HypoFilter.Init(), SMESH_HypoFilter.IsAuxiliary(), and SMESH_HypoFilter.Or().

{
  if ( !_compatibleHypothesis.empty() )
  {
    theFilter.Init( theFilter.HasName( _compatibleHypothesis[0] ));
    for ( int i = 1; i < _compatibleHypothesis.size(); ++i )
      theFilter.Or( theFilter.HasName( _compatibleHypothesis[ i ] ));

    if ( ignoreAuxiliary )
      theFilter.AndNot( theFilter.IsAuxiliary() );

    return true;
  }
  return false;
}
void SMESH_Algo::InitComputeError ( ) [inherited]

initialize compute error

Definition at line 655 of file SMESH_Algo.cxx.

References COMPERR_OK.

Referenced by Compute().

{
  _error = COMPERR_OK;
  _comment.clear();
  list<const SMDS_MeshElement*>::iterator elem = _badInputElements.begin();
  for ( ; elem != _badInputElements.end(); ++elem )
    if ( (*elem)->GetID() < 1 )
      delete *elem;
  _badInputElements.clear();
}
static bool SMESH_Algo.IsContinuous ( const TopoDS_Edge &  E1,
const TopoDS_Edge &  E2 
) [static, inherited]

Return true if an edge can be considered as a continuation of another.

Definition at line 313 of file SMESH_Algo.hxx.

Referenced by StdMeshers_Quadrangle_2D.CheckNbEdges(), StdMeshers_Quadrangle_2D.CheckNbEdgesForEvaluate(), and _QuadFaceGrid.Init().

                                                                           {
    return ( Continuity( E1, E2 ) >= GeomAbs_G1 );
  }
bool SMESH_Algo::IsReversedSubMesh ( const TopoDS_Face &  theFace,
SMESHDS_Mesh theMeshDS 
) [static, inherited]

Find out elements orientation on a geometrical face.

Parameters:
theFace- The face correctly oriented in the shape being meshed
theMeshDS- The mesh data structure
Return values:
bool- true if the face normal and the normal of first element in the correspoding submesh point in different directions

Definition at line 220 of file SMESH_Algo.cxx.

References SMESHDS_SubMesh.GetElements(), SMDS_MeshNode.GetPosition(), SMDS_MeshElement.getshapeId(), SMDS_Position.GetTypeOfPosition(), SMDS_FacePosition.GetUParameter(), SMDS_FacePosition.GetVParameter(), Handle(), SMESHDS_Mesh.IndexToShape(), SMESHDS_Mesh.MeshElements(), SMDS_MeshElement.NbNodes(), ex29_refine.node(), SMDS_MeshElement.nodesIterator(), SMESHDS_Mesh.ShapeToIndex(), SMDS_TOP_FACE, SMDS_TOP_VERTEX, SMDS_MeshNode.X(), SMDS_MeshNode.Y(), and SMDS_MeshNode.Z().

Referenced by StdMeshers_QuadToTriaAdaptor.Compute(), and VISCOUS._ViscousBuilder.findFacesWithLayers().

{
  if ( theFace.IsNull() || !theMeshDS )
    return false;

  // find out orientation of a meshed face
  int faceID = theMeshDS->ShapeToIndex( theFace );
  TopoDS_Shape aMeshedFace = theMeshDS->IndexToShape( faceID );
  bool isReversed = ( theFace.Orientation() != aMeshedFace.Orientation() );

  const SMESHDS_SubMesh * aSubMeshDSFace = theMeshDS->MeshElements( faceID );
  if ( !aSubMeshDSFace )
    return isReversed;

  // find element with node located on face and get its normal
  const SMDS_FacePosition* facePos = 0;
  int vertexID = 0;
  gp_Pnt nPnt[3];
  gp_Vec Ne;
  bool normalOK = false;
  SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
  while ( iteratorElem->more() ) // loop on elements on theFace
  {
    const SMDS_MeshElement* elem = iteratorElem->next();
    if ( elem && elem->NbNodes() > 2 ) {
      SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
      const SMDS_FacePosition* fPos = 0;
      int i = 0, vID = 0;
      while ( nodesIt->more() ) { // loop on nodes
        const SMDS_MeshNode* node
          = static_cast<const SMDS_MeshNode *>(nodesIt->next());
        if ( i == 3 ) i = 2;
        nPnt[ i++ ].SetCoord( node->X(), node->Y(), node->Z() );
        // check position
        const SMDS_PositionPtr& pos = node->GetPosition();
        if ( !pos ) continue;
        if ( pos->GetTypeOfPosition() == SMDS_TOP_FACE ) {
          fPos = dynamic_cast< const SMDS_FacePosition* >( pos );
        }
        else if ( pos->GetTypeOfPosition() == SMDS_TOP_VERTEX ) {
          vID = node->getshapeId();
        }
      }
      if ( fPos || ( !normalOK && vID )) {
        // compute normal
        gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
        if ( v01.SquareMagnitude() > RealSmall() &&
             v02.SquareMagnitude() > RealSmall() )
        {
          Ne = v01 ^ v02;
          normalOK = ( Ne.SquareMagnitude() > RealSmall() );
        }
        // we need position on theFace or at least on vertex
        if ( normalOK ) {
          vertexID = vID;
          if ((facePos = fPos))
            break;
        }
      }
    }
  }
  if ( !normalOK )
    return isReversed;

  // node position on face
  double u,v;
  if ( facePos ) {
    u = facePos->GetUParameter();
    v = facePos->GetVParameter();
  }
  else if ( vertexID ) {
    TopoDS_Shape V = theMeshDS->IndexToShape( vertexID );
    if ( V.IsNull() || V.ShapeType() != TopAbs_VERTEX )
      return isReversed;
    gp_Pnt2d uv = BRep_Tool::Parameters( TopoDS::Vertex( V ), theFace );
    u = uv.X();
    v = uv.Y();
  }
  else
  {
    return isReversed;
  }

  // face normal at node position
  TopLoc_Location loc;
  Handle(Geom_Surface) surf = BRep_Tool::Surface( theFace, loc );
  if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 ) return isReversed;
  gp_Vec d1u, d1v;
  surf->D1( u, v, nPnt[0], d1u, d1v );
  gp_Vec Nf = (d1u ^ d1v).Transformed( loc );

  if ( theFace.Orientation() == TopAbs_REVERSED )
    Nf.Reverse();

  return Ne * Nf < 0.;
}
virtual std::istream& SMESH_Algo.LoadFrom ( std::istream &  load) [virtual, inherited]

Loads nothing from a stream.

Parameters:
load- the stream
Return values:
std.ostream& - the stream
bool SMESH_Algo.NeedDescretBoundary ( ) const [inherited]

Definition at line 222 of file SMESH_Algo.hxx.

bool SMESH_Algo.NeedShape ( ) const [inherited]

Definition at line 225 of file SMESH_Algo.hxx.

{ return _requireShape; }
bool SMESH_Algo.OnlyUnaryInput ( ) const [inherited]

Definition at line 214 of file SMESH_Algo.hxx.

{ return _onlyUnaryInput; }
virtual std::ostream& SMESH_Algo.SaveTo ( std::ostream &  save) [virtual, inherited]

Saves nothing in a stream.

Parameters:
save- the stream
Return values:
std.ostream& - the stream
virtual void SMESH_Algo.SetEventListener ( SMESH_subMesh subMesh) [virtual, inherited]

Sets event listener to submeshes if necessary.

Parameters:
subMesh- submesh where algo is set

This method is called when a submesh gets HYP_OK algo_state. After being set, event listener is notified on each event of a submesh. By default none listener is set

Reimplemented in StdMeshers_CompositeSegment_1D, StdMeshers_Import_1D, StdMeshers_Import_1D2D, StdMeshers_Projection_1D, StdMeshers_Projection_2D, StdMeshers_Projection_3D, and StdMeshers_Regular_1D.

virtual bool SMESH_Algo.SetParametersByDefaults ( const TDefaults &  dflts,
const SMESH_Mesh theMesh = 0 
) [virtual, inherited]
virtual bool SMESH_Algo.SetParametersByMesh ( const SMESH_Mesh theMesh,
const TopoDS_Shape &  theShape 
) [virtual, inherited]

Just return false as the algorithm does not hold parameters values.

virtual void SMESH_Algo.SubmeshRestored ( SMESH_subMesh subMesh) [virtual, inherited]

Allow algo to do something after persistent restoration.

Parameters:
subMesh- restored submesh

This method is called only if a submesh has HYP_OK algo_state.

Reimplemented in StdMeshers_Import_1D, StdMeshers_Import_1D2D, StdMeshers_RadialQuadrangle_1D2D, and StdMeshers_Regular_1D.

bool SMESH_Algo.SupportSubmeshes ( ) const [inherited]

Definition at line 228 of file SMESH_Algo.hxx.

{ return _supportSubmeshes; }
const SMDS_MeshNode * SMESH_Algo::VertexNode ( const TopoDS_Vertex &  V,
const SMESHDS_Mesh meshDS 
) [static, inherited]

Return the node built on a vertex.

Parameters:
V- the vertex
meshDS- mesh
Return values:
constSMDS_MeshNode* - found node or NULL

Definition at line 531 of file SMESH_Algo.cxx.

References SMESHDS_Mesh.MeshElements().

Referenced by SMESH.SMESH_Gen.Compute(), StdMeshers_ProjectionUtils.FindMatchingNodesOnFaces(), StdMeshers_FaceSide.GetFaceWires(), and StdMeshers_FaceSide.GetUVPtStruct().

{
  if ( SMESHDS_SubMesh* sm = meshDS->MeshElements(V) ) {
    SMDS_NodeIteratorPtr nIt= sm->GetNodes();
    if (nIt->more())
      return nIt->next();
  }
  return 0;
}

Field Documentation

std::list<const SMESHDS_Hypothesis *> SMESH_Algo._appliedHypList [protected, inherited]

Definition at line 356 of file SMESH_Algo.hxx.

std::list<const SMDS_MeshElement*> SMESH_Algo._badInputElements [protected, inherited]

to explain COMPERR_BAD_INPUT_MESH

Definition at line 373 of file SMESH_Algo.hxx.

std::string SMESH_Algo._comment [protected, inherited]

any text explaining what is wrong in Compute()

Definition at line 372 of file SMESH_Algo.hxx.

std::vector<std::string> SMESH_Algo._compatibleHypothesis [protected, inherited]
int SMESH_Algo._error [protected, inherited]

SMESH_ComputeErrorName or anything algo specific.

Definition at line 371 of file SMESH_Algo.hxx.

Referenced by SMESH_Algo.SMESH_Algo().

bool SMESH_Algo._onlyUnaryInput [protected, inherited]

Definition at line 362 of file SMESH_Algo.hxx.

Referenced by SMESH_Algo.SMESH_Algo().

bool SMESH_Algo._quadraticMesh [protected, inherited]
bool SMESH_Algo._requireDescretBoundary [protected, inherited]
bool SMESH_Algo._requireShape [protected, inherited]

Definition at line 364 of file SMESH_Algo.hxx.

Referenced by SMESH_Algo.SMESH_Algo(), and StdMeshers_Hexa_3D().

bool SMESH_Algo._supportSubmeshes [protected, inherited]
std::list<const SMESHDS_Hypothesis *> SMESH_Algo._usedHypList [protected, inherited]

Definition at line 357 of file SMESH_Algo.hxx.

Definition at line 60 of file StdMeshers_Hexa_3D.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