#include <SMESH_3D_Algo.hxx>

Public Member Functions | |
| SMESH_3D_Algo (int hypId, int studyId, SMESH_Gen *gen) | |
| virtual | ~SMESH_3D_Algo () |
| 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 bool | CheckHypothesis (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)=0 |
| Check hypothesis definition to mesh a shape. | |
| virtual bool | Compute (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)=0 |
| Computes mesh on a shape. | |
| virtual bool | Compute (SMESH_Mesh &aMesh, SMESH_MesherHelper *aHelper) |
| Computes mesh without geometry. | |
| virtual bool | Evaluate (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)=0 |
| evaluates size of prospective mesh on a shape | |
| 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_MeshNode * | VertexNode (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 | |
| 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 | |
Definition at line 36 of file SMESH_3D_Algo.hxx.
Definition at line 42 of file SMESH_3D_Algo.cxx.
: SMESH_Algo(hypId, studyId, gen) { // _compatibleHypothesis.push_back("hypothese_3D_bidon"); _type = ALGO_3D; gen->_map3D_Algo[hypId] = this; }
| SMESH_3D_Algo::~SMESH_3D_Algo | ( | ) | [virtual] |
Definition at line 56 of file SMESH_3D_Algo.cxx.
{
}
| 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 SMESH_Algo.CheckHypothesis | ( | SMESH_Mesh & | aMesh, |
| const TopoDS_Shape & | aShape, | ||
| SMESH_Hypothesis::Hypothesis_Status & | aStatus | ||
| ) | [pure virtual, inherited] |
Check hypothesis definition to mesh a shape.
| aMesh | - the mesh |
| aShape | - the shape |
| aStatus | - check result |
| bool | - true if hypothesis is well defined |
Implemented in StdMeshers_Hexa_3D, StdMeshers_Import_1D, StdMeshers_Import_1D2D, StdMeshers_MEFISTO_2D, StdMeshers_Prism_3D, StdMeshers_Projection_1D, StdMeshers_Projection_2D, StdMeshers_Projection_3D, StdMeshers_Quadrangle_2D, StdMeshers_RadialPrism_3D, StdMeshers_RadialQuadrangle_1D2D, StdMeshers_Regular_1D, StdMeshers_SegmentAroundVertex_0D, StdMeshers_UseExisting_2D, and StdMeshers_UseExisting_1D.
| virtual bool SMESH_Algo.Compute | ( | SMESH_Mesh & | aMesh, |
| const TopoDS_Shape & | aShape | ||
| ) | [pure virtual, inherited] |
Computes mesh on a shape.
| aMesh | - the mesh |
| aShape | - the shape |
| bool | - is a success |
Algorithms that !NeedDescretBoundary() || !OnlyUnaryInput() are to set SMESH_ComputeError returned by SMESH_submesh.GetComputeError() to report problematic subshapes
Implemented in StdMeshers_CompositeHexa_3D, StdMeshers_CompositeSegment_1D, StdMeshers_Hexa_3D, StdMeshers_HexaFromSkin_3D, StdMeshers_Import_1D, StdMeshers_Import_1D2D, StdMeshers_MEFISTO_2D, StdMeshers_Prism_3D, StdMeshers_Projection_1D, StdMeshers_Projection_2D, StdMeshers_Projection_3D, StdMeshers_Quadrangle_2D, StdMeshers_RadialPrism_3D, StdMeshers_RadialQuadrangle_1D2D, StdMeshers_Regular_1D, StdMeshers_SegmentAroundVertex_0D, StdMeshers_UseExisting_2D, and StdMeshers_UseExisting_1D.
| virtual bool SMESH_Algo.Compute | ( | SMESH_Mesh & | aMesh, |
| SMESH_MesherHelper * | aHelper | ||
| ) | [virtual, inherited] |
Computes mesh without geometry.
| aMesh | - the mesh |
| aHelper | - helper that must be used for adding elements to |
| bool | - is a success |
The method is called if ( !aMesh->HasShapeToMesh() )
Reimplemented in StdMeshers_Hexa_3D, and StdMeshers_HexaFromSkin_3D.
| GeomAbs_Shape SMESH_Algo::Continuity | ( | TopoDS_Edge | E1, |
| TopoDS_Edge | E2 | ||
| ) | [static, inherited] |
Return continuity of two edges.
| E1 | - the 1st edge |
| E2 | - the 2nd edge |
| 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.
| E | - the edge |
| 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.
| bool SMESH_Algo.error | ( | int | error, |
| const SMESH_Comment & | comment = "" |
||
| ) | [protected, inherited] |
store error and comment and then return ( error == COMPERR_OK )
Referenced by StdMeshers_Projection_3D.Compute(), StdMeshers_HexaFromSkin_3D.Compute(), StdMeshers_CompositeHexa_3D.Compute(), StdMeshers_Projection_3D.Evaluate(), and StdMeshers_HexaFromSkin_3D.Evaluate().
| 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 SMESH_Algo.Evaluate | ( | SMESH_Mesh & | aMesh, |
| const TopoDS_Shape & | aShape, | ||
| MapShapeNbElems & | aResMap | ||
| ) | [pure virtual, inherited] |
evaluates size of prospective mesh on a shape
| aMesh | - the mesh |
| aShape | - the shape |
| aNbElems | - prospective number of elements by types |
| bool | - is a success |
Implemented in StdMeshers_CompositeHexa_3D, StdMeshers_Hexa_3D, StdMeshers_HexaFromSkin_3D, StdMeshers_Import_1D, StdMeshers_Import_1D2D, StdMeshers_MEFISTO_2D, StdMeshers_Prism_3D, StdMeshers_Projection_1D, StdMeshers_Projection_2D, StdMeshers_Projection_3D, StdMeshers_Quadrangle_2D, StdMeshers_RadialPrism_3D, StdMeshers_RadialQuadrangle_1D2D, StdMeshers_Regular_1D, StdMeshers_SegmentAroundVertex_0D, StdMeshers_UseExisting_2D, and StdMeshers_UseExisting_1D.
| 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.
| aMesh | - the mesh |
| aShape | - the shape |
| ignoreAuxiliary | - do not include auxiliary hypotheses in the list |
| const | std.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 StdMeshers_Hexa_3D.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.
| theMesh | - The mesh containing nodes |
| theEdge | - The geometrical edge of interest |
| theParams | - The resulting vector of sorted node parameters |
| 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.
| 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 |
| bool | - false if not all parameters are OK |
| theMesh | - The mesh containing nodes |
| theEdge | - The geometrical edge of interest |
| theParams | - The resulting vector of sorted node parameters |
| 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.
| aMesh | - the mesh |
| aShape | - the shape |
| ignoreAuxiliary | - do not include auxiliary hypotheses in the list |
| const | std.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.
| theFilter | - the filter to initialize |
| ignoreAuxiliary | - make filter ignore compatible auxiliary hypotheses |
| bool | - true if the algo has compatible hypotheses |
| 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 StdMeshers_Hexa_3D.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.
| theFace | - The face correctly oriented in the shape being meshed |
| theMeshDS | - The mesh data structure |
| 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.
| load | - the stream |
| std.ostream | & - the stream |
| bool SMESH_Algo.NeedDescretBoundary | ( | ) | const [inherited] |
Definition at line 222 of file SMESH_Algo.hxx.
{ return _requireDescretBoundary; }
| 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.
| save | - the stream |
| std.ostream | & - the stream |
| virtual void SMESH_Algo.SetEventListener | ( | SMESH_subMesh * | subMesh | ) | [virtual, inherited] |
Sets event listener to submeshes if necessary.
| 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.
| 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.
| V | - the vertex |
| meshDS | - mesh |
| const | SMDS_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;
}
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] |
Definition at line 355 of file SMESH_Algo.hxx.
Referenced by StdMeshers_Hexa_3D.StdMeshers_Hexa_3D(), StdMeshers_Import_1D.StdMeshers_Import_1D(), StdMeshers_Import_1D2D.StdMeshers_Import_1D2D(), StdMeshers_MEFISTO_2D.StdMeshers_MEFISTO_2D(), StdMeshers_Projection_1D.StdMeshers_Projection_1D(), StdMeshers_Projection_2D.StdMeshers_Projection_2D(), StdMeshers_Projection_3D.StdMeshers_Projection_3D(), StdMeshers_Quadrangle_2D.StdMeshers_Quadrangle_2D(), StdMeshers_RadialPrism_3D.StdMeshers_RadialPrism_3D(), StdMeshers_RadialQuadrangle_1D2D.StdMeshers_RadialQuadrangle_1D2D(), and StdMeshers_Regular_1D.StdMeshers_Regular_1D().
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] |
Definition at line 369 of file SMESH_Algo.hxx.
Referenced by StdMeshers_CompositeHexa_3D.Compute(), StdMeshers_CompositeHexa_3D.Evaluate(), and SMESH_Algo.SMESH_Algo().
bool SMESH_Algo._requireDescretBoundary [protected, inherited] |
Definition at line 363 of file SMESH_Algo.hxx.
Referenced by SMESH_Algo.SMESH_Algo(), StdMeshers_Import_1D2D.StdMeshers_Import_1D2D(), and StdMeshers_RadialQuadrangle_1D2D.StdMeshers_RadialQuadrangle_1D2D().
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.StdMeshers_Hexa_3D().
bool SMESH_Algo._supportSubmeshes [protected, inherited] |
Definition at line 365 of file SMESH_Algo.hxx.
Referenced by SMESH_Algo.SMESH_Algo(), and StdMeshers_RadialQuadrangle_1D2D.StdMeshers_RadialQuadrangle_1D2D().
std::list<const SMESHDS_Hypothesis *> SMESH_Algo._usedHypList [protected, inherited] |
Definition at line 357 of file SMESH_Algo.hxx.