SALOME - SMESH
StdMeshers_AutomaticLength Class Reference

1D Hypothesis to compute segment length free of thinking More...

#include <StdMeshers_AutomaticLength.hxx>

Inheritance diagram for StdMeshers_AutomaticLength:
Inheritance graph
Collaboration diagram for StdMeshers_AutomaticLength:
Collaboration graph

Public Types

enum  Hypothesis_Status {
  HYP_OK = 0, HYP_MISSING, HYP_CONCURENT, HYP_BAD_PARAMETER,
  HYP_HIDDEN_ALGO, HYP_HIDING_ALGO, HYP_UNKNOWN_FATAL, HYP_INCOMPATIBLE,
  HYP_NOTCONFORM, HYP_ALREADY_EXIST, HYP_BAD_DIM, HYP_BAD_SUBSHAPE,
  HYP_BAD_GEOMETRY, HYP_NEED_SHAPE
}
 
enum  hypothesis_type {
  PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D,
  ALGO_3D
}
 

Public Member Functions

 StdMeshers_AutomaticLength (int hypId, int studyId, SMESH_Gen *gen)
 
virtual ~ StdMeshers_AutomaticLength ()
 
double GetLength (const SMESH_Mesh *aMesh, const TopoDS_Shape &anEdge) throw ( SMESH_Exception )
 Computes segment for a given edge. More...
 
double GetLength (const SMESH_Mesh *aMesh, const double edgeLength) throw ( SMESH_Exception )
 Computes segment length for an edge of given length. More...
 
void SetFineness (double theFineness) throw ( SMESH_Exception )
 Set Fineness. More...
 
double GetFineness () const
 Return mesh Fineness. More...
 
virtual std::ostream & SaveTo (std::ostream &save)
 
virtual std::istream & LoadFrom (std::istream &load)
 
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Initialize Fineness by the mesh built on the geometry. More...
 
virtual bool SetParametersByDefaults (const TDefaults &dflts, const SMESH_Mesh *theMesh=0)
 Initialize my parameter values by default parameters. More...
 
virtual int GetDim () const
 
int GetStudyId () const
 
virtual void NotifySubMeshesHypothesisModification ()
 
virtual int GetShapeType () const
 
virtual const char * GetLibName () const
 
void SetLibName (const char *theLibName)
 
void SetParameters (const char *theParameters)
 
char * GetParameters () const
 
void SetLastParameters (const char *theParameters)
 
char * GetLastParameters () const
 
void ClearParameters ()
 
virtual bool IsAuxiliary () const
 Return true if me is an auxiliary hypothesis. More...
 
const char * GetName () const
 
int GetID () const
 
int GetType () const
 

Static Public Member Functions

static bool IsStatusFatal (Hypothesis_Status theStatus)
 

Protected Attributes

std::map< const TopoDS_TShape *, double > _TShapeToLength
 
const SMESH_Mesh_mesh
 
double _fineness
 
double _S0
 
double _minLen
 
SMESH_Gen_gen
 
int _studyId
 
int _shapeType
 
int _param_algo_dim
 
std::string _name
 
int _hypId
 
int _type
 

Friends

std::ostream & operator<< (std::ostream &save, StdMeshers_AutomaticLength &hyp)
 
std::istream & operator>> (std::istream &load, StdMeshers_AutomaticLength &hyp)
 

Detailed Description

1D Hypothesis to compute segment length free of thinking

It computes segment length basing on max shape size to shortest edge length ratio: S = S0 * f(L/Lmin) where f(x) = 1 + (2/Pi * 7 * atan(x/5) )

Definition at line 48 of file StdMeshers_AutomaticLength.hxx.

Member Enumeration Documentation

◆ Hypothesis_Status

Enumerator
HYP_OK 
HYP_MISSING 
HYP_CONCURENT 
HYP_BAD_PARAMETER 
HYP_HIDDEN_ALGO 
HYP_HIDING_ALGO 
HYP_UNKNOWN_FATAL 
HYP_INCOMPATIBLE 
HYP_NOTCONFORM 
HYP_ALREADY_EXIST 
HYP_BAD_DIM 
HYP_BAD_SUBSHAPE 
HYP_BAD_GEOMETRY 
HYP_NEED_SHAPE 

Definition at line 50 of file SMESH_Hypothesis.hxx.

◆ hypothesis_type

Enumerator
PARAM_ALGO 
ALGO_0D 
ALGO_1D 
ALGO_2D 
ALGO_3D 

Definition at line 49 of file SMESHDS_Hypothesis.hxx.

Constructor & Destructor Documentation

◆ StdMeshers_AutomaticLength()

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

◆ ~ StdMeshers_AutomaticLength()

virtual StdMeshers_AutomaticLength::~ StdMeshers_AutomaticLength ( )
virtual

Member Function Documentation

◆ GetLength() [1/2]

double StdMeshers_AutomaticLength::GetLength ( const SMESH_Mesh aMesh,
const TopoDS_Shape &  anEdge 
)
throw (SMESH_Exception
)

Computes segment for a given edge.

◆ GetLength() [2/2]

double StdMeshers_AutomaticLength::GetLength ( const SMESH_Mesh aMesh,
const double  edgeLength 
)
throw (SMESH_Exception
)

Computes segment length for an edge of given length.

◆ SetFineness()

void StdMeshers_AutomaticLength::SetFineness ( double  theFineness)
throw (SMESH_Exception
)

Set Fineness.

Parameters
theFineness- The Fineness value [0.0-1.0], 0 - coarse mesh 1 - fine mesh

Raise if theFineness is out of range The "Initial Number of Elements on the Shortest Edge" (S0) is divided by (0.5 + 4.5 x theFineness)

◆ GetFineness()

double StdMeshers_AutomaticLength::GetFineness ( ) const

Return mesh Fineness.

Return values
double- Fineness value [0.0-1.0]

Definition at line 83 of file StdMeshers_AutomaticLength.hxx.

References SMESHDS_Hypothesis::LoadFrom(), SMESHDS_Hypothesis::SaveTo(), SMESH_Hypothesis::SetParametersByDefaults(), and SMESH_Hypothesis::SetParametersByMesh().

Here is the call graph for this function:

◆ SaveTo()

virtual std::ostream& StdMeshers_AutomaticLength::SaveTo ( std::ostream &  save)
virtual

Implements SMESHDS_Hypothesis.

◆ LoadFrom()

virtual std::istream& StdMeshers_AutomaticLength::LoadFrom ( std::istream &  load)
virtual

Implements SMESHDS_Hypothesis.

◆ SetParametersByMesh()

virtual bool StdMeshers_AutomaticLength::SetParametersByMesh ( const SMESH_Mesh theMesh,
const TopoDS_Shape &  theShape 
)
virtual

Initialize Fineness by the mesh built on the geometry.

Parameters
theMesh- the built mesh
theShape- the geometry of interest
Return values
bool- true if parameter values have been successfully defined

Implements SMESH_Hypothesis.

◆ SetParametersByDefaults()

virtual bool StdMeshers_AutomaticLength::SetParametersByDefaults ( const TDefaults dflts,
const SMESH_Mesh theMesh = 0 
)
virtual

Initialize my parameter values by default parameters.

Return values
bool- true if parameter values have been successfully defined

Implements SMESH_Hypothesis.

◆ IsStatusFatal()

static bool SMESH_Hypothesis::IsStatusFatal ( Hypothesis_Status  theStatus)
staticinherited

Definition at line 68 of file SMESH_Hypothesis.hxx.

◆ GetDim()

virtual int SMESH_Hypothesis::GetDim ( ) const
virtualinherited

Referenced by SMESH_Gen::TAlgoStateError::Set().

Here is the caller graph for this function:

◆ GetStudyId()

int SMESH_Hypothesis::GetStudyId ( ) const
inherited

◆ NotifySubMeshesHypothesisModification()

virtual void SMESH_Hypothesis::NotifySubMeshesHypothesisModification ( )
virtualinherited

◆ GetShapeType()

virtual int SMESH_Hypothesis::GetShapeType ( ) const
virtualinherited

◆ GetLibName()

virtual const char* SMESH_Hypothesis::GetLibName ( ) const
virtualinherited

◆ SetLibName()

void SMESH_Hypothesis::SetLibName ( const char *  theLibName)
inherited

◆ SetParameters()

void SMESH_Hypothesis::SetParameters ( const char *  theParameters)
inherited

◆ GetParameters()

char* SMESH_Hypothesis::GetParameters ( ) const
inherited

◆ SetLastParameters()

void SMESH_Hypothesis::SetLastParameters ( const char *  theParameters)
inherited

◆ GetLastParameters()

char* SMESH_Hypothesis::GetLastParameters ( ) const
inherited

◆ ClearParameters()

void SMESH_Hypothesis::ClearParameters ( )
inherited

◆ IsAuxiliary()

virtual bool SMESH_Hypothesis::IsAuxiliary ( ) const
virtualinherited

Return true if me is an auxiliary hypothesis.

Return values
bool- auxiliary or not

An auxiliary hypothesis is optional, i.e. an algorithm can work without it and another hypothesis of the same dimention can be assigned to the shape

Definition at line 114 of file SMESH_Hypothesis.hxx.

◆ GetName()

const char* SMESHDS_Hypothesis::GetName ( ) const
inherited

◆ GetID()

int SMESHDS_Hypothesis::GetID ( ) const
inherited

◆ GetType()

int SMESHDS_Hypothesis::GetType ( ) const
inherited

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  save,
StdMeshers_AutomaticLength hyp 
)
friend

◆ operator>>

std::istream& operator>> ( std::istream &  load,
StdMeshers_AutomaticLength hyp 
)
friend

Field Documentation

◆ _TShapeToLength

std::map<const TopoDS_TShape*, double> StdMeshers_AutomaticLength::_TShapeToLength
protected

Definition at line 105 of file StdMeshers_AutomaticLength.hxx.

◆ _mesh

const SMESH_Mesh* StdMeshers_AutomaticLength::_mesh
protected

Definition at line 106 of file StdMeshers_AutomaticLength.hxx.

◆ _fineness

double StdMeshers_AutomaticLength::_fineness
protected

Definition at line 107 of file StdMeshers_AutomaticLength.hxx.

◆ _S0

double StdMeshers_AutomaticLength::_S0
protected

Definition at line 107 of file StdMeshers_AutomaticLength.hxx.

◆ _minLen

double StdMeshers_AutomaticLength::_minLen
protected

Definition at line 107 of file StdMeshers_AutomaticLength.hxx.

◆ _gen

SMESH_Gen* SMESH_Hypothesis::_gen
protectedinherited

Definition at line 118 of file SMESH_Hypothesis.hxx.

◆ _studyId

int SMESH_Hypothesis::_studyId
protectedinherited

Definition at line 119 of file SMESH_Hypothesis.hxx.

◆ _shapeType

int SMESH_Hypothesis::_shapeType
protectedinherited

Definition at line 120 of file SMESH_Hypothesis.hxx.

◆ _param_algo_dim

int SMESH_Hypothesis::_param_algo_dim
protectedinherited

Definition at line 121 of file SMESH_Hypothesis.hxx.

◆ _name

std::string SMESHDS_Hypothesis::_name
protectedinherited

Definition at line 52 of file SMESHDS_Hypothesis.hxx.

◆ _hypId

int SMESHDS_Hypothesis::_hypId
protectedinherited

Definition at line 53 of file SMESHDS_Hypothesis.hxx.

◆ _type

int SMESHDS_Hypothesis::_type
protectedinherited

Definition at line 54 of file SMESHDS_Hypothesis.hxx.