#include <SMESH_Gen.hxx>
Data Structures | |
struct | TAlgoStateError |
Public Types | |
enum | ComputeFlags { SHAPE_ONLY = 1 , UPWARD = 2 , COMPACT_MESH = 4 , SHAPE_ONLY_UPWARD = 3 } |
Public Member Functions | |
SMESH_Gen () | |
Constructor. More... | |
~SMESH_Gen () | |
Destructor. More... | |
SMESH_Mesh * | CreateMesh (bool theIsEmbeddedMode) |
Creates a mesh in a study. More... | |
SMESH_ParallelMesh * | CreateParallelMesh (bool theIsEmbeddedMode) |
Creates a parallel mesh in a study. More... | |
bool | Compute (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const int aFlags=COMPACT_MESH, const ::MeshDimension aDim=::MeshDim_3D, TSetOfInt *aShapesId=0, TopTools_IndexedMapOfShape *anAllowedSubShapes=0) |
Computes aMesh on aShape. More... | |
void | PrepareCompute (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape) |
Prepare Compute a mesh. More... | |
void | CancelCompute (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape) |
const SMESH_subMesh * | GetCurrentSubMesh () const |
Returns a sub-mesh being currently computed. More... | |
bool | Evaluate (::SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap, const bool anUpward=false, TSetOfInt *aShapesId=0) |
evaluates size of prospective mesh on a shape More... | |
bool | CheckAlgoState (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape) |
void | SetBoundaryBoxSegmentation (int theNbSegments) |
Sets number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined. More... | |
int | GetBoundaryBoxSegmentation () const |
void | SetDefaultNbSegments (int nb) |
Sets default number of segments per edge. More... | |
int | GetDefaultNbSegments () const |
bool | GetAlgoState (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, std::list< SMESH_Gen::TAlgoStateError > &theErrors) |
StudyContextStruct * | GetStudyContext () |
Returns StudyContextStruct for a study. More... | |
SMESH_Algo * | GetAlgo (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, TopoDS_Shape *assignedTo=0) |
Finds algo to mesh a shape. More... | |
SMESH_Algo * | GetAlgo (SMESH_subMesh *aSubMesh, TopoDS_Shape *assignedTo=0) |
Finds algo to mesh a sub-mesh. More... | |
int | GetANewId () |
Generate a new id unique within this Gen. More... | |
void | send_mesh (SMESH_Mesh &aMesh, std::string filename) |
bool | parallelComputeSubMeshes (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const ::MeshDimension aDim, TSetOfInt *aShapesId, TopTools_IndexedMapOfShape *allowedSubShapes, SMESH_subMesh::compute_event &computeEvent, const bool includeSelf, const bool complexShapeFirst, const bool aShapeOnly) |
Algo to run the computation of all the submeshes of a mesh in parallel. More... | |
bool | sequentialComputeSubMeshes (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const ::MeshDimension aDim, TSetOfInt *aShapesId, TopTools_IndexedMapOfShape *allowedSubShapes, SMESH_subMesh::compute_event &computeEvent, const bool includeSelf, const bool complexShapeFirst, const bool aShapeOnly) |
Algo to run the computation of all the submeshes of a mesh in sequentila. More... | |
Static Public Member Functions | |
static int | GetShapeDim (const TopAbs_ShapeEnum &aShapeType) |
Return shape dimension by TopAbs_ShapeEnum. More... | |
static int | GetShapeDim (const TopoDS_Shape &aShape) |
static int | GetFlatShapeDim (const TopoDS_Shape &aShape) |
Return shape dimension by exploding compounds. More... | |
static bool | IsGlobalHypothesis (const SMESH_Hypothesis *theHyp, SMESH_Mesh &aMesh) |
static std::vector< std::string > | GetPluginXMLPaths () |
Return paths to xml files of plugins. More... | |
Private Member Functions | |
void | setCurrentSubMesh (SMESH_subMesh *sm) |
Sets a sub-mesh being currently computed. More... | |
void | resetCurrentSubMesh () |
Private Attributes | |
int | _localId |
StudyContextStruct * | _studyContext |
int | _hypId |
int | _segmentation |
int | _nbSegments |
volatile bool | _compute_canceled |
std::list< SMESH_subMesh * > | _sm_current |
SMESH_Gen::SMESH_Gen | ( | ) |
Constructor.
References studyContextStruct::myDocument.
SMESH_Gen::~SMESH_Gen | ( | ) |
Destructor.
void SMESH_Gen::CancelCompute | ( | ::SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape | ||
) |
Referenced by SMESH_Gen_i::CancelCompute().
bool SMESH_Gen::CheckAlgoState | ( | SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape | ||
) |
Referenced by SMESH_Gen_i::IsReadyToCompute().
bool SMESH_Gen::Compute | ( | ::SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
const int | aFlags = COMPACT_MESH , |
||
const ::MeshDimension | aDim = ::MeshDim_3D , |
||
TSetOfInt * | aShapesId = 0 , |
||
TopTools_IndexedMapOfShape * | anAllowedSubShapes = 0 |
||
) |
Computes aMesh on aShape.
aMesh | - the mesh. |
aShape | - the shape. |
aFlags | - ComputeFlags. By default compute the whole mesh and compact at the end. |
aDim | - upper level dimension of the mesh computation (for preview) |
aShapesId | - list of shapes with computed mesh entities (elements or nodes) |
anAllowedSubShapes | - shapes to mesh only. Mesh all if empty or nullptr |
bool | - true if none sub-mesh failed to compute |
Referenced by StdMeshers_Prism_3D::assocOrProjBottom2Top(), SMESH_Gen_i::Compute(), StdMeshers_Import_1D::Compute(), StdMeshers_Import_1D2D::Compute(), StdMeshers_Prism_3D::computeBase(), StdMeshers_ProjectionUtils::MakeComputed(), and SMESH_Gen_i::Precompute().
SMESH_Mesh * SMESH_Gen::CreateMesh | ( | bool | theIsEmbeddedMode | ) |
Creates a mesh in a study.
if (theIsEmbeddedMode) { mesh modification commands are not logged }
Referenced by SMESH_Gen_i::createMesh().
SMESH_ParallelMesh * SMESH_Gen::CreateParallelMesh | ( | bool | theIsEmbeddedMode | ) |
Creates a parallel mesh in a study.
if (theIsEmbeddedMode) { mesh modification commands are not logged }
Referenced by SMESH_Gen_i::createParallelMesh().
bool SMESH_Gen::Evaluate | ( | ::SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
MapShapeNbElems & | aResMap, | ||
const bool | anUpward = false , |
||
TSetOfInt * | aShapesId = 0 |
||
) |
evaluates size of prospective mesh on a shape
aMesh | - the mesh |
aShape | - the shape |
aResMap | - map for prospective numbers of elements |
bool | - is a success |
Referenced by SMESH_Gen_i::Evaluate(), StdMeshers_Projection_1D2D::Evaluate(), and StdMeshers_Projection_2D::Evaluate().
SMESH_Algo * SMESH_Gen::GetAlgo | ( | SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
TopoDS_Shape * | assignedTo = 0 |
||
) |
Finds algo to mesh a shape.
Optionally returns a shape the found algo is bound to
References SMESH_Mesh::GetSubMesh().
Referenced by SMESH_subMesh::AlgoStateEngine(), StdMeshers_Hexa_3D::Evaluate(), SMESH_Mesh_i::findConcurrentSubMeshes(), VISCOUS_2D::_ViscousBuilder2D::findEdgesWithLayers(), SMESH_subMesh::GetAlgo(), StdMeshers_CompositeSegment_1D::GetFaceSide(), and StdMeshers_ViscousLayers2D::RestoreListeners().
SMESH_Algo * SMESH_Gen::GetAlgo | ( | SMESH_subMesh * | aSubMesh, |
TopoDS_Shape * | assignedTo = 0 |
||
) |
Finds algo to mesh a sub-mesh.
Optionally returns a shape the found algo is bound to
References SMESH_HypoFilter::And(), SMESH_HypoFilter::AndNot(), SMESH_MesherHelper::GetAncestors(), SMESH_subMesh::GetFather(), SMESH_MesherHelper::GetGroupType(), SMESH_Mesh::GetHypothesis(), SMESH_Mesh::GetShapeToMesh(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubShape(), SMESH_HypoFilter::HasDim(), SMESH_HypoFilter::HasName(), SMESH_Mesh::HasShapeToMesh(), SMESH_HypoFilter::Init(), SMESH_HypoFilter::Is(), SMESH_HypoFilter::IsAlgo(), SMESH_HypoFilter::IsApplicableTo(), SMESH_Mesh::IsOrderOK(), and SMESH_MesherHelper::NbAncestors().
bool SMESH_Gen::GetAlgoState | ( | SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
std::list< SMESH_Gen::TAlgoStateError > & | theErrors | ||
) |
References checkConformIgnoredAlgos(), checkMissing(), SMESH_subMesh::GetAlgoState(), SMESH_subMesh::getDependsOnIterator(), SMESH_Hypothesis::GetDim(), SMESHDS_Mesh::GetHypothesis(), SMESH_Mesh::GetMeshDS(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubShape(), SMESHDS_Hypothesis::GetType(), SMESH_Mesh::HasShapeToMesh(), SMESH_Hypothesis::HYP_MISSING, SMESH_Mesh::IsNotConformAllowed(), SMESH_subMesh::NO_ALGO, SMESHDS_Hypothesis::PARAM_ALGO, and SMESHDS_Mesh::ShapeToMesh().
Referenced by SMESH_Gen_i::GetAlgoState().
int SMESH_Gen::GetANewId | ( | ) |
Generate a new id unique within this Gen.
Referenced by StdMeshers_Hexa_3D::Compute(), ComputePentahedralMesh(), EvaluatePentahedralMesh(), StdMeshers_Adaptive1D::GetAlgo(), StdMeshers_Adaptive1D_i::StdMeshers_Adaptive1D_i(), StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i(), StdMeshers_AutomaticLength_i::StdMeshers_AutomaticLength_i(), StdMeshers_BlockRenumber_i::StdMeshers_BlockRenumber_i(), StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i(), StdMeshers_CartesianParameters3D_i::StdMeshers_CartesianParameters3D_i(), StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i(), StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i(), StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i(), StdMeshers_Geometric1D_i::StdMeshers_Geometric1D_i(), StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(), StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i(), StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i(), StdMeshers_Import_1D_i::StdMeshers_Import_1D_i(), StdMeshers_ImportSource1D_i::StdMeshers_ImportSource1D_i(), StdMeshers_ImportSource2D_i::StdMeshers_ImportSource2D_i(), StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i(), StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i(), StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i(), StdMeshers_LocalLength_i::StdMeshers_LocalLength_i(), StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i(), StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i(), StdMeshers_MaxLength_i::StdMeshers_MaxLength_i(), StdMeshers_NotConformAllowed_i::StdMeshers_NotConformAllowed_i(), StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i(), StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i(), StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i(), StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i(), StdMeshers_PolyhedronPerSolid_3D_i::StdMeshers_PolyhedronPerSolid_3D_i(), StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i(), StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i(), StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i(), StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i(), StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i(), StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i(), StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i(), StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i(), StdMeshers_Propagation_i::StdMeshers_Propagation_i(), StdMeshers_PropagOfDistribution_i::StdMeshers_PropagOfDistribution_i(), StdMeshers_QuadFromMedialAxis_1D2D_i::StdMeshers_QuadFromMedialAxis_1D2D_i(), StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i(), StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i(), StdMeshers_QuadranglePreference_i::StdMeshers_QuadranglePreference_i(), StdMeshers_QuadraticMesh_i::StdMeshers_QuadraticMesh_i(), StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i(), StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i(), StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i(), StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i(), StdMeshers_SegmentLengthAroundVertex_i::StdMeshers_SegmentLengthAroundVertex_i(), StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i(), StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i(), StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i(), StdMeshers_ViscousLayerBuilder_i::StdMeshers_ViscousLayerBuilder_i(), StdMeshers_ViscousLayers2D_i::StdMeshers_ViscousLayers2D_i(), and StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i().
int SMESH_Gen::GetBoundaryBoxSegmentation | ( | ) | const |
Referenced by StdMeshers_Regular_1D::CheckHypothesis(), and SMESH_Gen_i::GetHypothesisParameterValues().
const SMESH_subMesh * SMESH_Gen::GetCurrentSubMesh | ( | ) | const |
Returns a sub-mesh being currently computed.
Referenced by SMESH_Mesh::GetComputeProgress().
int SMESH_Gen::GetDefaultNbSegments | ( | ) | const |
|
static |
Return shape dimension by exploding compounds.
|
static |
Return paths to xml files of plugins.
References env_sep.
Referenced by _pyHypothesisReader::_pyHypothesisReader(), and SMESH_Algo::GetFeatures().
|
static |
Return shape dimension by TopAbs_ShapeEnum.
References MeshDim_0D, MeshDim_1D, MeshDim_2D, and MeshDim_3D.
Referenced by SMESH_Mesh::AddHypothesis(), SMESH_subMesh::CanAddHypothesis(), checkMissing(), SMESH_subMesh::cleanDependants(), SMESH_subMesh::cleanDependsOn(), SMESH_subMesh::DumpAlgoState(), SMESH_subMesh::Evaluate(), SMESH_Gen_i::GetHypothesisParameterValues(), SMESH_subMesh::IsApplicableHypothesis(), SMESH_subMesh::IsMeshComputed(), SMESH_HypoFilter::IsMoreLocalThanPredicate::IsOk(), StdMeshers_ProjectionUtils::MakeComputed(), parallelComputeSubMeshes(), SMESH_Gen_i::Precompute(), SMESH_Mesh::RemoveHypothesis(), SMESH_subMesh::removeSubMeshElementsAndNodes(), sequentialComputeSubMeshes(), StdMeshers_ProjectionSource3D::SetSource3DShape(), StdMeshers_ProjectionUtils::SourceNotComputedError(), and SMESH_subMesh::SubMeshesComputed().
|
static |
StudyContextStruct * SMESH_Gen::GetStudyContext | ( | ) |
Returns StudyContextStruct for a study.
Referenced by SMESH_Mesh::FindMesh(), StdMeshers_ImportSource1D::GetGroups(), SMESH_Mesh::GetHypothesis(), SMESH_Hypothesis::GetMeshByPersistentID(), StdMeshers_ImportSource1D::GetResultGroups(), StdMeshers_ImportSource1D::GetSourceMeshes(), SMESH_Hypothesis::NotifySubMeshesHypothesisModification(), SMESH_Mesh::RemoveHypothesis(), StdMeshers_ImportSource1D::RestoreGroups(), StdMeshers_ViscousLayers2D::RestoreListeners(), SMESH_Hypothesis::SMESH_Hypothesis(), SMESH_Hypothesis::~SMESH_Hypothesis(), and SMESH_Mesh::~SMESH_Mesh().
|
static |
References SMESH_Mesh::GetHypothesis(), SMESH_Mesh::GetMeshDS(), SMESH_HypoFilter::Is(), and SMESHDS_Mesh::ShapeToMesh().
Referenced by checkMissing().
bool SMESH_Gen::parallelComputeSubMeshes | ( | SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
const ::MeshDimension | aDim, | ||
TSetOfInt * | aShapesId, | ||
TopTools_IndexedMapOfShape * | allowedSubShapes, | ||
SMESH_subMesh::compute_event & | computeEvent, | ||
const bool | includeSelf, | ||
const bool | complexShapeFirst, | ||
const bool | aShapeOnly | ||
) |
Algo to run the computation of all the submeshes of a mesh in parallel.
References SMESH_subMesh::CHECK_COMPUTE_STATE, SMESH_ParallelMesh::cleanup(), compute_function(), SMESH_subMesh::ComputeStateEngine(), SMESH_DriverMesh::exportMesh(), SMESH_subMesh::getDependsOnIterator(), SMESH_Mesh::GetMeshDS(), SMESH_ParallelMesh::GetParallelismMethod(), SMESH_ParallelMesh::GetPool(), GetShapeDim(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubShape(), SMESH_ParallelMesh::GetTmpFolder(), SMESH_Mesh::HasShapeToMesh(), MESSAGE, SMDS_Mesh::Modified(), MultiNode, and SMESH_Mesh::wait().
Referenced by SMESH_ParallelMesh::ComputeSubMeshes().
void SMESH_Gen::PrepareCompute | ( | ::SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape | ||
) |
Prepare Compute a mesh.
Referenced by SMESH_Gen_i::Compute().
|
private |
void SMESH_Gen::send_mesh | ( | SMESH_Mesh & | aMesh, |
std::string | filename | ||
) |
References SMESH_ParallelMesh::GetResource(), SMESH_ParallelMesh::GetTmpFolder(), and MESSAGE.
bool SMESH_Gen::sequentialComputeSubMeshes | ( | SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
const ::MeshDimension | aDim, | ||
TSetOfInt * | aShapesId, | ||
TopTools_IndexedMapOfShape * | allowedSubShapes, | ||
SMESH_subMesh::compute_event & | computeEvent, | ||
const bool | includeSelf, | ||
const bool | complexShapeFirst, | ||
const bool | aShapeOnly | ||
) |
Algo to run the computation of all the submeshes of a mesh in sequentila.
References SMESH_subMesh::CHECK_COMPUTE_STATE, SMESH_subMesh::ComputeStateEngine(), Edge, SMESH_subMesh::FAILED_TO_COMPUTE, SMESH_subMesh::GetComputeState(), SMESH_subMesh::getDependsOnIterator(), SMESH_subMesh::GetId(), GetShapeDim(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubShape(), SMESH_Mesh::HasShapeToMesh(), SMESH_Algo::isDegenerated(), MESSAGE, SMESH_subMesh::READY_TO_COMPUTE, and SMESH_subMesh::SetAllowedSubShapes().
Referenced by SMESH_SequentialMesh::ComputeSubMeshes().
void SMESH_Gen::SetBoundaryBoxSegmentation | ( | int | theNbSegments | ) |
Sets number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined.
Referenced by SMESH_Gen_i::SetBoundaryBoxSegmentation().
|
private |
Sets a sub-mesh being currently computed.
An algorithm can call Compute() for a sub-shape, hence we keep a stack of sub-meshes
void SMESH_Gen::SetDefaultNbSegments | ( | int | nb | ) |
Sets default number of segments per edge.
Referenced by SMESH_Gen_i::SetDefaultNbSegments().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |