Version: 8.3.0
StdMeshers_AutomaticLength Class Reference

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

#include <StdMeshers_AutomaticLength.hxx>

Inheritance diagram for StdMeshers_AutomaticLength:

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, HYP_INCOMPAT_HYPS
}
 
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 (SALOME_Exception)
 Computes segment for a given edge. More...
 
double GetLength (const SMESH_Mesh *aMesh, const double edgeLength) throw (SALOME_Exception)
 Computes segment length for an edge of given length. More...
 
void SetFineness (double theFineness) throw (SALOME_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
 
SMESH_GenGetGen () const
 
virtual int GetShapeType () const
 
virtual const char * GetLibName () const
 
virtual void NotifySubMeshesHypothesisModification ()
 
void SetLibName (const char *theLibName)
 
virtual bool DataDependOnParams () const
 The returned value is used by NotifySubMeshesHypothesisModification() to decide to call subMesh->AlgoStateEngine( MODIF_HYP, hyp ) or not if subMesh is ready to be computed (algo+hyp==OK) but not yet computed. More...
 
virtual bool IsAuxiliary () const
 Return true if me is an auxiliary hypothesis. More...
 
SMESH_MeshGetMeshByPersistentID (int id)
 Find a mesh with given persistent ID. More...
 
const char * GetName () const
 
int GetID () const
 
int GetType () const
 
bool IsSameName (const SMESHDS_Hypothesis &other) const
 Compare types of hypotheses. More...
 
virtual bool operator== (const SMESHDS_Hypothesis &other) const
 Equality. More...
 
bool operator!= (const SMESHDS_Hypothesis &other) 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
 
hypothesis_type _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) )

Member Enumeration Documentation

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 
HYP_INCOMPAT_HYPS 
Enumerator
PARAM_ALGO 
ALGO_0D 
ALGO_1D 
ALGO_2D 
ALGO_3D 

Constructor & Destructor Documentation

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

Member Function Documentation

virtual bool SMESH_Hypothesis::DataDependOnParams ( ) const
virtualinherited

The returned value is used by NotifySubMeshesHypothesisModification() to decide to call subMesh->AlgoStateEngine( MODIF_HYP, hyp ) or not if subMesh is ready to be computed (algo+hyp==OK) but not yet computed.

True result is reasonable for example if EventListeners depend on parameters of hypothesis.

Reimplemented in StdMeshers_ImportSource1D.

int SMESH_Hypothesis::GetDim ( ) const
virtualinherited
double StdMeshers_AutomaticLength::GetFineness ( ) const

Return mesh Fineness.

Return values
double- Fineness value [0.0-1.0]
SMESH_Gen* SMESH_Hypothesis::GetGen ( ) const
inherited
int SMESHDS_Hypothesis::GetID ( ) const
inherited
double StdMeshers_AutomaticLength::GetLength ( const SMESH_Mesh aMesh,
const TopoDS_Shape &  anEdge 
) throw (SALOME_Exception)

Computes segment for a given edge.

References theCoarseConst, and theFineConst.

Referenced by SetParametersByMesh().

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

Computes segment length for an edge of given length.

References theCoarseConst, and theFineConst.

virtual const char* SMESH_Hypothesis::GetLibName ( ) const
virtualinherited
SMESH_Mesh * SMESH_Hypothesis::GetMeshByPersistentID ( int  id)
inherited

Find a mesh with given persistent ID.

References studyContextStruct::mapMesh.

int SMESH_Hypothesis::GetShapeType ( ) const
virtualinherited
int SMESH_Hypothesis::GetStudyId ( ) const
inherited
int SMESHDS_Hypothesis::GetType ( ) const
inherited
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 dimension can be assigned to the shape

References SMESHDS_Hypothesis::GetType().

bool SMESHDS_Hypothesis::IsSameName ( const SMESHDS_Hypothesis other) const
inherited

Compare types of hypotheses.

References SMESHDS_Hypothesis::_name.

Referenced by StdMeshers_Regular_1D::CheckHypothesis().

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

Implements SMESHDS_Hypothesis.

References _fineness.

Referenced by operator>>().

void SMESH_Hypothesis::NotifySubMeshesHypothesisModification ( )
virtualinherited
bool SMESHDS_Hypothesis::operator!= ( const SMESHDS_Hypothesis other) const
inherited
bool SMESHDS_Hypothesis::operator== ( const SMESHDS_Hypothesis other) const
virtualinherited

Equality.

References SMESHDS_Hypothesis::_name.

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

Implements SMESHDS_Hypothesis.

References _fineness.

Referenced by operator<<().

void StdMeshers_AutomaticLength::SetFineness ( double  theFineness) throw (SALOME_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)

void SMESH_Hypothesis::SetLibName ( const char *  theLibName)
inherited
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.

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.

References _fineness, _TShapeToLength, Edge, SMESH_Algo::EdgeLength(), GetLength(), SMESHDS_Mesh::MeshElements(), SMESHDS_SubMesh::NbElements(), theCoarseConst, and theFineConst.

Friends And Related Function Documentation

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

Field Documentation

double StdMeshers_AutomaticLength::_fineness
protected
SMESH_Gen* SMESH_Hypothesis::_gen
protectedinherited
int SMESHDS_Hypothesis::_hypId
protectedinherited
const SMESH_Mesh* StdMeshers_AutomaticLength::_mesh
protected
double StdMeshers_AutomaticLength::_minLen
protected
std::string SMESHDS_Hypothesis::_name
protectedinherited

Referenced by SMESHDS_Hypothesis::IsSameName(), SMESHDS_Hypothesis::operator==(), StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(), StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength(), StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(), StdMeshers_CartesianParameters3D::StdMeshers_CartesianParameters3D(), StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(), StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D(), StdMeshers_Deflection1D::StdMeshers_Deflection1D(), StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(), StdMeshers_Geometric1D::StdMeshers_Geometric1D(), StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(), StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(), StdMeshers_Import_1D::StdMeshers_Import_1D(), StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(), StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(), StdMeshers_ImportSource2D::StdMeshers_ImportSource2D(), StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(), StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D(), StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(), StdMeshers_LocalLength::StdMeshers_LocalLength(), StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(), StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(), StdMeshers_MaxLength::StdMeshers_MaxLength(), StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(), StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(), StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(), StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D(), StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(), StdMeshers_PolygonPerFace_2D::StdMeshers_PolygonPerFace_2D(), StdMeshers_Prism_3D::StdMeshers_Prism_3D(), StdMeshers_Projection_1D::StdMeshers_Projection_1D(), StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(), StdMeshers_Projection_2D::StdMeshers_Projection_2D(), StdMeshers_Projection_3D::StdMeshers_Projection_3D(), StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(), StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(), StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(), StdMeshers_Propagation::StdMeshers_Propagation(), StdMeshers_PropagOfDistribution::StdMeshers_PropagOfDistribution(), StdMeshers_QuadFromMedialAxis_1D2D::StdMeshers_QuadFromMedialAxis_1D2D(), StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D(), StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(), StdMeshers_QuadranglePreference::StdMeshers_QuadranglePreference(), StdMeshers_QuadraticMesh::StdMeshers_QuadraticMesh(), StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(), StdMeshers_RadialQuadrangle_1D2D::StdMeshers_RadialQuadrangle_1D2D(), StdMeshers_Regular_1D::StdMeshers_Regular_1D(), StdMeshers_StartEndLength::StdMeshers_StartEndLength(), StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(), and StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D().

int SMESH_Hypothesis::_param_algo_dim
protectedinherited

Referenced by SMESH_Hypothesis::SMESH_Hypothesis(), StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(), StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength(), StdMeshers_CartesianParameters3D::StdMeshers_CartesianParameters3D(), StdMeshers_Deflection1D::StdMeshers_Deflection1D(), StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(), StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(), StdMeshers_ImportSource2D::StdMeshers_ImportSource2D(), StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(), StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D(), StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(), StdMeshers_LocalLength::StdMeshers_LocalLength(), StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(), StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(), StdMeshers_MaxLength::StdMeshers_MaxLength(), StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(), StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(), StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D(), StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(), StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(), StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(), StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(), StdMeshers_Propagation::StdMeshers_Propagation(), StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(), StdMeshers_QuadranglePreference::StdMeshers_QuadranglePreference(), StdMeshers_QuadraticMesh::StdMeshers_QuadraticMesh(), StdMeshers_Reversible1D::StdMeshers_Reversible1D(), StdMeshers_StartEndLength::StdMeshers_StartEndLength(), StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(), and StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D().

double StdMeshers_AutomaticLength::_S0
protected
int SMESH_Hypothesis::_studyId
protectedinherited
std::map<const TopoDS_TShape*, double> StdMeshers_AutomaticLength::_TShapeToLength
protected

Referenced by SetParametersByMesh().