Back to index

salome-smesh  6.5.0
Public Member Functions
SMESH::SMESH_Gen Interface Reference

import "SMESH_Gen.idl";

List of all members.

Public Member Functions

void SetGeomEngine (in GEOM::GEOM_Gen geomcompo)
FilterManager CreateFilterManager ()
SMESH_Pattern GetPattern ()
Measurements CreateMeasurements ()
void SetEmbeddedMode (in boolean theMode)
 Set the current mode.
boolean IsEmbeddedMode ()
 Get the current mode.
void SetCurrentStudy (in SALOMEDS::Study theStudy)
 Set the current study.
SALOMEDS::Study GetCurrentStudy ()
 Get the current study.
SMESH_Hypothesis CreateHypothesis (in string theHypName, in string theLibName) raises ( SALOME::SALOME_Exception )
 Create a hypothesis that can be shared by differents parts of the mesh.
SMESH_Hypothesis GetHypothesisParameterValues (in string theHypName, in string theLibName, in SMESH_Mesh theMesh, in GEOM::GEOM_Object theGeom, in boolean byMesh) raises ( SALOME::SALOME_Exception )
 Return a hypothesis holding parameter values corresponding either to the mesh existing on the given geometry or to size of the geometry.
void SetBoundaryBoxSegmentation (in long theNbSegments) raises ( SALOME::SALOME_Exception )
 Sets number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined.
void SetDefaultNbSegments (in long theNbSegments) raises ( SALOME::SALOME_Exception )
 Sets default number of segments per edge.
void SetName (in string theObjectIOR, in string theObjectName) raises ( SALOME::SALOME_Exception )
 Set the object name.
SMESH_Mesh CreateMesh (in GEOM::GEOM_Object theObject) raises ( SALOME::SALOME_Exception )
 Create a Mesh object, given a geometry shape.
SMESH_Mesh CreateEmptyMesh () raises ( SALOME::SALOME_Exception )
 Create an empty mesh object.
SMESH_Mesh CreateMeshesFromUNV (in string theFileName) raises ( SALOME::SALOME_Exception )
 Create Mesh object importing data from given UNV file (UNV supported version is I-DEAS 10)
mesh_array CreateMeshesFromMED (in string theFileName, out SMESH::DriverMED_ReadStatus theStatus) raises ( SALOME::SALOME_Exception )
 Create Mesh object(s) importing data from given MED file.
mesh_array CreateMeshesFromSAUV (in string theFileName, out SMESH::DriverMED_ReadStatus theStatus) raises ( SALOME::SALOME_Exception )
 Create Mesh object(s) importing data from given MED file.
SMESH_Mesh CreateMeshesFromSTL (in string theFileName) raises ( SALOME::SALOME_Exception )
 Create Mesh object importing data from given STL file.
mesh_array CreateMeshesFromCGNS (in string theFileName, out SMESH::DriverMED_ReadStatus theStatus) raises ( SALOME::SALOME_Exception )
 Create Mesh object(s) importing data from given CGNS file.
SMESH_Mesh CopyMesh (in SMESH_IDSource meshPart, in string meshName, in boolean toCopyGroups, in boolean toKeepIDs) raises ( SALOME::SALOME_Exception )
 Create a mesh by copying a part of another mesh.
SMESH_Mesh Concatenate (in mesh_array theMeshesArray, in boolean theUniteIdenticalGroups, in boolean theMergeNodesAndElements, in double theMergeTolerance) raises ( SALOME::SALOME_Exception )
 Concatenate the given meshes into one mesh.
SMESH_Mesh ConcatenateWithGroups (in mesh_array theMeshesArray, in boolean theUniteIdenticalGroups, in boolean theMergeNodesAndElements, in double theMergeTolerance) raises ( SALOME::SALOME_Exception )
 Concatenate the given meshes into one mesh.
boolean Compute (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject) raises ( SALOME::SALOME_Exception )
 Mesh a subShape.
void CancelCompute (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject)
 Cancel a computation.
boolean IsReadyToCompute (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject) raises ( SALOME::SALOME_Exception )
 Return true if hypotheses are defined well.
long_array Evaluate (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject) raises ( SALOME::SALOME_Exception )
 Evaluates size of prospective mesh on a shape.
MeshPreviewStruct Precompute (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject, in Dimension theDimension, inout long_array theShapesId) raises ( SALOME::SALOME_Exception )
 Calculate Mesh as preview till indicated dimension First, verify list of hypothesis associated with the Sub-shape.
algo_error_array GetAlgoState (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject) raises ( SALOME::SALOME_Exception )
 Return errors of hypotheses definintion algo_error_array is empty if everything is OK.
compute_error_array GetComputeErrors (in SMESH_Mesh theMesh, in GEOM::GEOM_Object theSubObject) raises ( SALOME::SALOME_Exception )
 Return errors of mesh computation compute_error_array is empty if everything is OK.
MeshPreviewStruct GetBadInputElements (in SMESH_Mesh theMesh, in short theSubShapeID) raises ( SALOME::SALOME_Exception )
 Return mesh elements preventing computation of a sub-shape.
long_array GetSubShapesId (in GEOM::GEOM_Object theMainObject, in object_array theListOfSubObjects) raises ( SALOME::SALOME_Exception )
 Return indeces of faces, edges and vertices of given sub-shapes within theMainObject.
GEOM::GEOM_Object GetGeometryByMeshElement (in SMESH_Mesh theMesh, in long theElementID, in string theGeomName) raises ( SALOME::SALOME_Exception )
 Return geometrical object the given element is built on.
GEOM::GEOM_Object FindGeometryByMeshElement (in SMESH_Mesh theMesh, in long theElementID) raises ( SALOME::SALOME_Exception )
 Return geometrical object the given element is built on.
long GetObjectId (in Object theObject)
 Return id of object, registered in current study context.
boolean GetMEDVersion (in string theFileName, out MED_VERSION theVersion)
 Get MED version of the file by its name.
string_array GetMeshNames (in string theFileName)
 Get names of meshes defined in file with the specified name.

Detailed Description

Definition at line 115 of file SMESH_Gen.idl.


Member Function Documentation

void SMESH::SMESH_Gen::CancelCompute ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject 
)

Cancel a computation.

bool SMESH_Gen::Compute ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject 
) raises ( SALOME::SALOME_Exception )

Mesh a subShape.

Compute a mesh.

First, verify list of hypothesis associated with the Sub-shape, return NOK if hypothesis are not sufficient

Definition at line 116 of file SMESH_Gen.cxx.

{
  MESSAGE("SMESH_Gen::Compute");
  MEMOSTAT;

  bool ret = true;

  SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);

  const bool includeSelf = true;
  const bool complexShapeFirst = true;
  const int  globalAlgoDim = 100;

  SMESH_subMeshIteratorPtr smIt;

  if ( anUpward ) // is called from below code here
  {
    // -----------------------------------------------
    // mesh all the sub-shapes starting from vertices
    // -----------------------------------------------
    smIt = sm->getDependsOnIterator(includeSelf, !complexShapeFirst);
    while ( smIt->more() )
    {
      SMESH_subMesh* smToCompute = smIt->next();

      // do not mesh vertices of a pseudo shape
      const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
      if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
        continue;

      // check for preview dimension limitations
      if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
      {
        // clear compute state to not show previous compute errors
        //  if preview invoked less dimension less than previous
        smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
        continue;
      }

      if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
      {
#ifdef WITH_SMESH_CANCEL_COMPUTE
        if (_compute_canceled)
          return false;
        _sm_current = smToCompute;
#endif
        smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
#ifdef WITH_SMESH_CANCEL_COMPUTE
        _sm_current = NULL;
#endif
      }

      // we check all the submeshes here and detect if any of them failed to compute
      if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
        ret = false;
      else if ( aShapesId )
        aShapesId->insert( smToCompute->GetId() );
    }
    //aMesh.GetMeshDS()->Modified();
    return ret;
  }
  else
  {
    // -----------------------------------------------------------------
    // apply algos that DO NOT require Discreteized boundaries and DO NOT
    // support submeshes, starting from the most complex shapes
    // and collect submeshes with algos that DO support submeshes
    // -----------------------------------------------------------------
    list< SMESH_subMesh* > smWithAlgoSupportingSubmeshes;

    // map to sort sm with same dim algos according to dim of
    // the shape the algo assigned to (issue 0021217)
    multimap< int, SMESH_subMesh* > shDim2sm;
    multimap< int, SMESH_subMesh* >::reverse_iterator shDim2smIt;
    TopoDS_Shape algoShape;
    int prevShapeDim = -1;

    smIt = sm->getDependsOnIterator(includeSelf, complexShapeFirst);
    while ( smIt->more() )
    {
      SMESH_subMesh* smToCompute = smIt->next();
      if ( smToCompute->GetComputeState() != SMESH_subMesh::READY_TO_COMPUTE )
        continue;

      const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
      int aShapeDim = GetShapeDim( aSubShape );
      if ( aShapeDim < 1 ) break;
      
      // check for preview dimension limitations
      if ( aShapesId && aShapeDim > (int)aDim )
        continue;

      SMESH_Algo* algo = GetAlgo( aMesh, aSubShape, &algoShape );
      if ( algo && !algo->NeedDiscreteBoundary() )
      {
        if ( algo->SupportSubmeshes() )
        {
          // reload sub-meshes from shDim2sm into smWithAlgoSupportingSubmeshes
          // so that more local algos to go first
          if ( prevShapeDim != aShapeDim )
          {
            prevShapeDim = aShapeDim;
            for ( shDim2smIt = shDim2sm.rbegin(); shDim2smIt != shDim2sm.rend(); ++shDim2smIt )
              if ( shDim2smIt->first == globalAlgoDim )
                smWithAlgoSupportingSubmeshes.push_back( shDim2smIt->second );
              else
                smWithAlgoSupportingSubmeshes.push_front( shDim2smIt->second );
            shDim2sm.clear();
          }
          // add smToCompute to shDim2sm map
          if ( algoShape.IsSame( aMesh.GetShapeToMesh() ))
          {
            aShapeDim = globalAlgoDim; // to compute last
          }
          else
          {
            aShapeDim = GetShapeDim( algoShape );
            if ( algoShape.ShapeType() == TopAbs_COMPOUND )
            {
              TopoDS_Iterator it( algoShape );
              aShapeDim += GetShapeDim( it.Value() );
            }
          }
          shDim2sm.insert( make_pair( aShapeDim, smToCompute ));
        }
        else
        {
#ifdef WITH_SMESH_CANCEL_COMPUTE
          if (_compute_canceled)
            return false;
          _sm_current = smToCompute;
#endif
          smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
#ifdef WITH_SMESH_CANCEL_COMPUTE
          _sm_current = NULL;
#endif
          if ( aShapesId )
            aShapesId->insert( smToCompute->GetId() );
        }
      }
    }
    // reload sub-meshes from shDim2sm into smWithAlgoSupportingSubmeshes
    for ( shDim2smIt = shDim2sm.rbegin(); shDim2smIt != shDim2sm.rend(); ++shDim2smIt )
      if ( shDim2smIt->first == globalAlgoDim )
        smWithAlgoSupportingSubmeshes.push_back( shDim2smIt->second );
      else
        smWithAlgoSupportingSubmeshes.push_front( shDim2smIt->second );

    // ------------------------------------------------------------
    // sort list of submeshes according to mesh order
    // ------------------------------------------------------------
    aMesh.SortByMeshOrder( smWithAlgoSupportingSubmeshes );

    // ------------------------------------------------------------
    // compute submeshes under shapes with algos that DO NOT require
    // Discreteized boundaries and DO support submeshes
    // ------------------------------------------------------------
    list< SMESH_subMesh* >::iterator subIt, subEnd;
    subIt  = smWithAlgoSupportingSubmeshes.begin();
    subEnd = smWithAlgoSupportingSubmeshes.end();
    // start from lower shapes
    for ( ; subIt != subEnd; ++subIt )
    {
      sm = *subIt;

      // get a shape the algo is assigned to
      if ( !GetAlgo( aMesh, sm->GetSubShape(), & algoShape ))
        continue; // strange...

      // look for more local algos
      smIt = sm->getDependsOnIterator(!includeSelf, !complexShapeFirst);
      while ( smIt->more() )
      {
        SMESH_subMesh* smToCompute = smIt->next();

        const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
        const int aShapeDim = GetShapeDim( aSubShape );
        //if ( aSubShape.ShapeType() == TopAbs_VERTEX ) continue;
        if ( aShapeDim < 1 ) continue;

        // check for preview dimension limitations
        if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
          continue;
        
        SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
        filter
          .And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
          .And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh ));

        if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( aSubShape, filter, true )) {
          SMESH_Hypothesis::Hypothesis_Status status;
          if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
            // mesh a lower smToCompute starting from vertices
            Compute( aMesh, aSubShape, /*anUpward=*/true, aDim, aShapesId );
        }
      }
    }
    // ----------------------------------------------------------
    // apply the algos that do not require Discreteized boundaries
    // ----------------------------------------------------------
    for ( subIt = smWithAlgoSupportingSubmeshes.begin(); subIt != subEnd; ++subIt )
    {
      sm = *subIt;
      if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
      {
        const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
        // check for preview dimension limitations
        if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
          continue;

#ifdef WITH_SMESH_CANCEL_COMPUTE
        if (_compute_canceled)
          return false;
        _sm_current = sm;
#endif
        sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
#ifdef WITH_SMESH_CANCEL_COMPUTE
        _sm_current = NULL;
#endif
        if ( aShapesId )
          aShapesId->insert( sm->GetId() );
      }
    }
    // -----------------------------------------------
    // mesh the rest sub-shapes starting from vertices
    // -----------------------------------------------
    ret = Compute( aMesh, aShape, /*anUpward=*/true, aDim, aShapesId );
  }

  MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
  MEMOSTAT;

  SMESHDS_Mesh *myMesh = aMesh.GetMeshDS();
  myMesh->adjustStructure();
  MESSAGE("*** compactMesh after compute");
  myMesh->compactMesh();
  //myMesh->adjustStructure();
  list<int> listind = myMesh->SubMeshIndices();
  list<int>::iterator it = listind.begin();
  int total = 0;
  for(; it != listind.end(); ++it)
    {
      ::SMESHDS_SubMesh *subMesh = myMesh->MeshElements(*it);
      total +=  subMesh->getSize();
    }
  MESSAGE("total elements and nodes in submesh sets:" << total);
  MESSAGE("Number of node objects " << SMDS_MeshNode::nbNodes);
  MESSAGE("Number of cell objects " << SMDS_MeshCell::nbCells);
  //myMesh->dumpGrid();
  //aMesh.GetMeshDS()->Modified();

  // fix quadratic mesh by bending iternal links near concave boundary
  if ( aShape.IsSame( aMesh.GetShapeToMesh() ) &&
       !aShapesId ) // not preview
  {
    SMESH_MesherHelper aHelper( aMesh );
    if ( aHelper.IsQuadraticMesh() != SMESH_MesherHelper::LINEAR )
      aHelper.FixQuadraticElements();
  }
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SMESH_Mesh SMESH::SMESH_Gen::Concatenate ( in mesh_array  theMeshesArray,
in boolean  theUniteIdenticalGroups,
in boolean  theMergeNodesAndElements,
in double  theMergeTolerance 
) raises ( SALOME::SALOME_Exception )

Concatenate the given meshes into one mesh.

Union groups with the same name and type if theUniteIdenticalGroups flag is true. Merge coincident nodes and elements if theMergeNodesAndElements flag is true.

SMESH_Mesh SMESH::SMESH_Gen::ConcatenateWithGroups ( in mesh_array  theMeshesArray,
in boolean  theUniteIdenticalGroups,
in boolean  theMergeNodesAndElements,
in double  theMergeTolerance 
) raises ( SALOME::SALOME_Exception )

Concatenate the given meshes into one mesh.

Union groups with the same name and type if theUniteIdenticalGroups flag is true. Merge coincident nodes and elements if theMergeNodesAndElements flag is true. Create the groups of all elements from initial meshes.

SMESH_Mesh SMESH::SMESH_Gen::CopyMesh ( in SMESH_IDSource  meshPart,
in string  meshName,
in boolean  toCopyGroups,
in boolean  toKeepIDs 
) raises ( SALOME::SALOME_Exception )

Create a mesh by copying a part of another mesh.

Parameters:
meshPart- a part of mesh to copy
meshName- a name of the new mesh
toCopyGroups- to create in the new mesh groups the copied elements belongs to
toKeepIDs- to preserve IDs of the copied elements or not
SMESH_Mesh SMESH::SMESH_Gen::CreateEmptyMesh ( ) raises ( SALOME::SALOME_Exception )

Create an empty mesh object.

Here is the caller graph for this function:

SMESH_Hypothesis SMESH::SMESH_Gen::CreateHypothesis ( in string  theHypName,
in string  theLibName 
) raises ( SALOME::SALOME_Exception )

Create a hypothesis that can be shared by differents parts of the mesh.

An hypothesis is either:

  • a method used to generate or modify a part of the mesh (algorithm).
  • a parameter or a law used by an algorithm. Algorithms are 1D, 2D or 3D.

Here is the caller graph for this function:

SMESH_Mesh * SMESH_Gen::CreateMesh ( in GEOM::GEOM_Object  theObject) raises ( SALOME::SALOME_Exception )

Create a Mesh object, given a geometry shape.

Creates a mesh in a study.

Mesh is created empty (no points, no elements). Shape is explored via GEOM_Client to create local copies. of TopoDS_Shapes and bind CORBA references of shape & subshapes with TopoDS_Shapes

if (theIsEmbeddedMode) { mesh modification commands are not logged }

Definition at line 90 of file SMESH_Gen.cxx.

{
  Unexpect aCatch(SalomeException);
  MESSAGE("SMESH_Gen::CreateMesh");

  // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
  StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);

  // create a new SMESH_mesh object
  SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
                                     theStudyId,
                                     this,
                                     theIsEmbeddedMode,
                                     aStudyContext->myDocument);
  aStudyContext->mapMesh[_localId-1] = aMesh;

  return aMesh;
}
mesh_array SMESH::SMESH_Gen::CreateMeshesFromCGNS ( in string  theFileName,
out SMESH::DriverMED_ReadStatus  theStatus 
) raises ( SALOME::SALOME_Exception )

Create Mesh object(s) importing data from given CGNS file.

mesh_array SMESH::SMESH_Gen::CreateMeshesFromMED ( in string  theFileName,
out SMESH::DriverMED_ReadStatus  theStatus 
) raises ( SALOME::SALOME_Exception )

Create Mesh object(s) importing data from given MED file.

mesh_array SMESH::SMESH_Gen::CreateMeshesFromSAUV ( in string  theFileName,
out SMESH::DriverMED_ReadStatus  theStatus 
) raises ( SALOME::SALOME_Exception )

Create Mesh object(s) importing data from given MED file.

SMESH_Mesh SMESH::SMESH_Gen::CreateMeshesFromSTL ( in string  theFileName) raises ( SALOME::SALOME_Exception )

Create Mesh object importing data from given STL file.

SMESH_Mesh SMESH::SMESH_Gen::CreateMeshesFromUNV ( in string  theFileName) raises ( SALOME::SALOME_Exception )

Create Mesh object importing data from given UNV file (UNV supported version is I-DEAS 10)

bool SMESH_Gen::Evaluate ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject 
) raises ( SALOME::SALOME_Exception )

Evaluates size of prospective mesh on a shape.

Evaluate a mesh.

Definition at line 417 of file SMESH_Gen.cxx.

{
  MESSAGE("SMESH_Gen::Evaluate");

  bool ret = true;

  SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);

  const bool includeSelf = true;
  const bool complexShapeFirst = true;
  SMESH_subMeshIteratorPtr smIt;

  if ( anUpward ) { // is called from below code here
    // -----------------------------------------------
    // mesh all the sub-shapes starting from vertices
    // -----------------------------------------------
    smIt = sm->getDependsOnIterator(includeSelf, !complexShapeFirst);
    while ( smIt->more() ) {
      SMESH_subMesh* smToCompute = smIt->next();

      // do not mesh vertices of a pseudo shape
      const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
      //if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
      //  continue;
      if ( !aMesh.HasShapeToMesh() ) {
        if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
            aShType == TopAbs_SHELL )
          continue;
      }

      smToCompute->Evaluate(aResMap);
      if( aShapesId )
        aShapesId->insert( smToCompute->GetId() );
    }
    return ret;
  }
  else {
    // -----------------------------------------------------------------
    // apply algos that DO NOT require Discreteized boundaries and DO NOT
    // support submeshes, starting from the most complex shapes
    // and collect submeshes with algos that DO support submeshes
    // -----------------------------------------------------------------
    list< SMESH_subMesh* > smWithAlgoSupportingSubmeshes;
    smIt = sm->getDependsOnIterator(includeSelf, complexShapeFirst);
    while ( smIt->more() ) {
      SMESH_subMesh* smToCompute = smIt->next();
      const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
      const int aShapeDim = GetShapeDim( aSubShape );
      if ( aShapeDim < 1 ) break;
      
      SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
      if ( algo && !algo->NeedDiscreteBoundary() ) {
        if ( algo->SupportSubmeshes() ) {
          smWithAlgoSupportingSubmeshes.push_front( smToCompute );
        }
        else {
          smToCompute->Evaluate(aResMap);
          if ( aShapesId )
            aShapesId->insert( smToCompute->GetId() );
        }
      }
    }

    // ------------------------------------------------------------
    // sort list of meshes according to mesh order
    // ------------------------------------------------------------
    aMesh.SortByMeshOrder( smWithAlgoSupportingSubmeshes );

    // ------------------------------------------------------------
    // compute submeshes under shapes with algos that DO NOT require
    // Discreteized boundaries and DO support submeshes
    // ------------------------------------------------------------
    list< SMESH_subMesh* >::iterator subIt, subEnd;
    subIt  = smWithAlgoSupportingSubmeshes.begin();
    subEnd = smWithAlgoSupportingSubmeshes.end();
    // start from lower shapes
    for ( ; subIt != subEnd; ++subIt ) {
      sm = *subIt;

      // get a shape the algo is assigned to
      TopoDS_Shape algoShape;
      if ( !GetAlgo( aMesh, sm->GetSubShape(), & algoShape ))
        continue; // strange...

      // look for more local algos
      smIt = sm->getDependsOnIterator(!includeSelf, !complexShapeFirst);
      while ( smIt->more() ) {
        SMESH_subMesh* smToCompute = smIt->next();

        const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
        const int aShapeDim = GetShapeDim( aSubShape );
        if ( aShapeDim < 1 ) continue;

        //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();

        SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
        filter
          .And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
          .And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh ));

        if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( aSubShape, filter, true )) {
          SMESH_Hypothesis::Hypothesis_Status status;
          if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
            // mesh a lower smToCompute starting from vertices
            Evaluate( aMesh, aSubShape, aResMap, /*anUpward=*/true, aShapesId );
        }
      }
    }
    // ----------------------------------------------------------
    // apply the algos that do not require Discreteized boundaries
    // ----------------------------------------------------------
    for ( subIt = smWithAlgoSupportingSubmeshes.begin(); subIt != subEnd; ++subIt )
    {
      sm = *subIt;
      sm->Evaluate(aResMap);
      if ( aShapesId )
        aShapesId->insert( sm->GetId() );
    }

    // -----------------------------------------------
    // mesh the rest sub-shapes starting from vertices
    // -----------------------------------------------
    ret = Evaluate( aMesh, aShape, aResMap, /*anUpward=*/true, aShapesId );
  }

  MESSAGE( "VSR - SMESH_Gen::Evaluate() finished, OK = " << ret);
  return ret;
}

Here is the call graph for this function:

GEOM::GEOM_Object SMESH::SMESH_Gen::FindGeometryByMeshElement ( in SMESH_Mesh  theMesh,
in long  theElementID 
) raises ( SALOME::SALOME_Exception )

Return geometrical object the given element is built on.

The returned geometrical object not published in study by this method.

bool SMESH_Gen::GetAlgoState ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject 
) raises ( SALOME::SALOME_Exception )

Return errors of hypotheses definintion algo_error_array is empty if everything is OK.

Definition at line 762 of file SMESH_Gen.cxx.

{
  //MESSAGE("SMESH_Gen::CheckAlgoState");

  bool ret = true;
  bool hasAlgo = false;

  SMESH_subMesh* sm = theMesh.GetSubMesh(theShape);
  const SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
  TopoDS_Shape mainShape = meshDS->ShapeToMesh();

  // -----------------
  // get global algos
  // -----------------

  const SMESH_Algo* aGlobAlgoArr[] = {0,0,0,0};

  const list<const SMESHDS_Hypothesis*>& listHyp = meshDS->GetHypothesis( mainShape );
  list<const SMESHDS_Hypothesis*>::const_iterator it=listHyp.begin();
  for ( ; it != listHyp.end(); it++)
  {
    const SMESHDS_Hypothesis * aHyp = *it;
    if (aHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO)
      continue;

    const SMESH_Algo* algo = dynamic_cast<const SMESH_Algo*> (aHyp);
    ASSERT ( algo );

    int dim = algo->GetDim();
    aGlobAlgoArr[ dim ] = algo;

    hasAlgo = true;
  }

  // --------------------------------------------------------
  // info on algos that will be ignored because of ones that
  // don't NeedDiscreteBoundary() attached to super-shapes,
  // check that a conform mesh will be produced
  // --------------------------------------------------------


  // find a global algo possibly hiding sub-algos
  int dim;
  const SMESH_Algo* aGlobIgnoAlgo = 0;
  for (dim = 3; dim > 0; dim--)
  {
    if (aGlobAlgoArr[ dim ] &&
        !aGlobAlgoArr[ dim ]->NeedDiscreteBoundary())
    {
      aGlobIgnoAlgo = aGlobAlgoArr[ dim ];
      break;
    }
  }

  set<SMESH_subMesh*> aCheckedSubs;
  bool checkConform = ( !theMesh.IsNotConformAllowed() );

  // loop on theShape and its sub-shapes
  SMESH_subMeshIteratorPtr revItSub = sm->getDependsOnIterator( /*includeSelf=*/true,
                                                                /*complexShapeFirst=*/true);
  while ( revItSub->more() )
  {
    SMESH_subMesh* smToCheck = revItSub->next();
    if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
      break;

    if ( aCheckedSubs.insert( smToCheck ).second ) // not yet checked
      if (!checkConformIgnoredAlgos (theMesh, smToCheck, aGlobIgnoAlgo,
                                     0, checkConform, aCheckedSubs, theErrors))
        ret = false;

    if ( smToCheck->GetAlgoState() != SMESH_subMesh::NO_ALGO )
      hasAlgo = true;
  }

  // ----------------------------------------------------------------
  // info on missing hypothesis and find out if all needed algos are
  // well defined
  // ----------------------------------------------------------------

  //MESSAGE( "---info on missing hypothesis and find out if all needed algos are");

  // find max dim of global algo
  int aTopAlgoDim = 0;
  for (dim = 3; dim > 0; dim--)
  {
    if (aGlobAlgoArr[ dim ])
    {
      aTopAlgoDim = dim;
      break;
    }
  }
  bool checkNoAlgo = theMesh.HasShapeToMesh() ? bool( aTopAlgoDim ) : false;
  bool globalChecked[] = { false, false, false, false };

  // loop on theShape and its sub-shapes
  aCheckedSubs.clear();
  revItSub = sm->getDependsOnIterator( /*includeSelf=*/true, /*complexShapeFirst=*/true);
  while ( revItSub->more() )
  {
    SMESH_subMesh* smToCheck = revItSub->next();
    if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
      break;

    if ( aCheckedSubs.insert( smToCheck ).second ) // not yet checked
      if (!checkMissing (this, theMesh, smToCheck, aTopAlgoDim,
                         globalChecked, checkNoAlgo, aCheckedSubs, theErrors))
      {
        ret = false;
        if (smToCheck->GetAlgoState() == SMESH_subMesh::NO_ALGO )
          checkNoAlgo = false;
      }
  }

  if ( !hasAlgo ) {
    ret = false;
    INFOS( "None algorithm attached" );
    theErrors.push_back( TAlgoStateError() );
    theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, 1, true );
  }

  return ret;
}

Here is the call graph for this function:

MeshPreviewStruct SMESH::SMESH_Gen::GetBadInputElements ( in SMESH_Mesh  theMesh,
in short  theSubShapeID 
) raises ( SALOME::SALOME_Exception )

Return mesh elements preventing computation of a sub-shape.

compute_error_array SMESH::SMESH_Gen::GetComputeErrors ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject 
) raises ( SALOME::SALOME_Exception )

Return errors of mesh computation compute_error_array is empty if everything is OK.

SALOMEDS::Study SMESH::SMESH_Gen::GetCurrentStudy ( )

Get the current study.

GEOM::GEOM_Object SMESH::SMESH_Gen::GetGeometryByMeshElement ( in SMESH_Mesh  theMesh,
in long  theElementID,
in string  theGeomName 
) raises ( SALOME::SALOME_Exception )

Return geometrical object the given element is built on.

The returned geometrical object, if not nil, is either found in the study or is published by this method with the given name

SMESH_Hypothesis SMESH::SMESH_Gen::GetHypothesisParameterValues ( in string  theHypName,
in string  theLibName,
in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theGeom,
in boolean  byMesh 
) raises ( SALOME::SALOME_Exception )

Return a hypothesis holding parameter values corresponding either to the mesh existing on the given geometry or to size of the geometry.

The returned hypothesis may be the one existing in a study and used to compute the mesh, or a temporary one created just to pass parameter values.

boolean SMESH::SMESH_Gen::GetMEDVersion ( in string  theFileName,
out MED_VERSION  theVersion 
)

Get MED version of the file by its name.

string_array SMESH::SMESH_Gen::GetMeshNames ( in string  theFileName)

Get names of meshes defined in file with the specified name.

long SMESH::SMESH_Gen::GetObjectId ( in Object  theObject)

Return id of object, registered in current study context.

Can be used to check if the object was created in the same container, as this engine.

long_array SMESH::SMESH_Gen::GetSubShapesId ( in GEOM::GEOM_Object  theMainObject,
in object_array  theListOfSubObjects 
) raises ( SALOME::SALOME_Exception )

Return indeces of faces, edges and vertices of given sub-shapes within theMainObject.

Get the current mode.

boolean SMESH::SMESH_Gen::IsReadyToCompute ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject 
) raises ( SALOME::SALOME_Exception )

Return true if hypotheses are defined well.

MeshPreviewStruct SMESH::SMESH_Gen::Precompute ( in SMESH_Mesh  theMesh,
in GEOM::GEOM_Object  theSubObject,
in Dimension  theDimension,
inout long_array  theShapesId 
) raises ( SALOME::SALOME_Exception )

Calculate Mesh as preview till indicated dimension First, verify list of hypothesis associated with the Sub-shape.

Return mesh preview structure

void SMESH::SMESH_Gen::SetBoundaryBoxSegmentation ( in long  theNbSegments) raises ( SALOME::SALOME_Exception )

Sets number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined.

void SMESH::SMESH_Gen::SetCurrentStudy ( in SALOMEDS::Study  theStudy)

Set the current study.

Here is the caller graph for this function:

void SMESH::SMESH_Gen::SetDefaultNbSegments ( in long  theNbSegments) raises ( SALOME::SALOME_Exception )

Sets default number of segments per edge.

void SMESH::SMESH_Gen::SetEmbeddedMode ( in boolean  theMode)

Set the current mode.

void SMESH::SMESH_Gen::SetGeomEngine ( in GEOM::GEOM_Gen  geomcompo)
void SMESH::SMESH_Gen::SetName ( in string  theObjectIOR,
in string  theObjectName 
) raises ( SALOME::SALOME_Exception )

Set the object name.


The documentation for this interface was generated from the following files: