Version: 8.3.0
StdMeshers_NumberOfSegments Class Reference

This class represents hypothesis for 1d algorithm. More...

#include <StdMeshers_NumberOfSegments.hxx>

Inheritance diagram for StdMeshers_NumberOfSegments:

Public Types

enum  DistrType { DT_Regular, DT_Scale, DT_TabFunc, DT_ExprFunc }
 This enumeration presents available types of distribution. More...
 
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_NumberOfSegments (int hypId, int studyId, SMESH_Gen *gen)
 
virtual ~StdMeshers_NumberOfSegments ()
 
const std::vector< double > & BuildDistributionExpr (const char *, int, int) throw ( SALOME_Exception )
 
const std::vector< double > & BuildDistributionTab (const std::vector< double > &, int, int) throw ( SALOME_Exception )
 
void SetNumberOfSegments (int segmentsNumber) throw (SALOME_Exception)
 Set the number of segments. More...
 
int GetNumberOfSegments () const
 Get the number of segments. More...
 
void SetDistrType (DistrType typ) throw (SALOME_Exception)
 Set distribution type. More...
 
DistrType GetDistrType () const
 Get distribution type. More...
 
virtual void SetScaleFactor (double scaleFactor) throw (SALOME_Exception)
 Set scale factor for scale distribution. More...
 
double GetScaleFactor () const throw (SALOME_Exception)
 Get scale factor for scale distribution. More...
 
void SetTableFunction (const std::vector< double > &table) throw (SALOME_Exception)
 Set table function for distribution DT_TabFunc. More...
 
const std::vector< double > & GetTableFunction () const throw (SALOME_Exception)
 Get table function for distribution DT_TabFunc. More...
 
void SetExpressionFunction (const char *expr) throw (SALOME_Exception)
 Set expression function for distribution DT_ExprFunc. More...
 
const char * GetExpressionFunction () const throw (SALOME_Exception)
 Get expression function for distribution DT_ExprFunc. More...
 
void SetConversionMode (int conv) throw (SALOME_Exception)
 Set conversion mode. More...
 
int ConversionMode () const throw (SALOME_Exception)
 Returns conversion mode. More...
 
void SetReversedEdges (std::vector< int > &ids)
 
void SetObjectEntry (const char *entry)
 
const char * GetObjectEntry ()
 
const std::vector< int > & GetReversedEdges () const
 
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Initialize number of segments 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 std::ostream & SaveTo (std::ostream &save)
 
virtual std::istream & LoadFrom (std::istream &load)
 
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 std::string CheckExpressionFunction (const std::string &expr, const int convMode) throw (SALOME_Exception)
 Checks validity of the expression of the function f(t), e.g. More...
 
static bool IsStatusFatal (Hypothesis_Status theStatus)
 

Protected Attributes

int _numberOfSegments
 an edge will be split on to this number of segments More...
 
DistrType _distrType
 the type of distribution of density function More...
 
double _scaleFactor
 the scale parameter for DT_Scale More...
 
std::vector< double > _table
 
std::vector< double > _distr
 the table for DT_TabFunc, a sequence of pairs of numbers More...
 
std::string _func
 the expression of the function for DT_ExprFunc More...
 
int _convMode
 flag of conversion mode: 0=exponent, 1=cut negative More...
 
std::vector< int_edgeIDs
 list of reversed edges ids More...
 
std::string _objEntry
 Entry of the main object to reverse edges. More...
 
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_NumberOfSegments &hyp)
 
std::istream & operator>> (std::istream &load, StdMeshers_NumberOfSegments &hyp)
 

Detailed Description

This class represents hypothesis for 1d algorithm.

It provides parameters for subdivision an edge by various distribution types, considering the given number of resulting segments

Member Enumeration Documentation

This enumeration presents available types of distribution.

Enumerator
DT_Regular 

equidistant distribution

DT_Scale 

scale distribution

DT_TabFunc 

distribution with density function presented by table

DT_ExprFunc 

distribution with density function presented by expression

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_NumberOfSegments::StdMeshers_NumberOfSegments ( int  hypId,
int  studyId,
SMESH_Gen gen 
)
StdMeshers_NumberOfSegments::~StdMeshers_NumberOfSegments ( )
virtual

Member Function Documentation

const std::vector<double>& StdMeshers_NumberOfSegments::BuildDistributionExpr ( const char *  ,
int  ,
int   
) throw ( SALOME_Exception )
const std::vector<double>& StdMeshers_NumberOfSegments::BuildDistributionTab ( const std::vector< double > &  ,
int  ,
int   
) throw ( SALOME_Exception )
std::string StdMeshers_NumberOfSegments::CheckExpressionFunction ( const std::string &  expr,
const int  convMode 
) throw (SALOME_Exception)
static

Checks validity of the expression of the function f(t), e.g.

"sin(t)". In case of validity returns a cleaned expression

Parameters
convMode- 0 for "Exponent mode", 1 for "Cut negative mode"

References process().

int StdMeshers_NumberOfSegments::ConversionMode ( ) const throw (SALOME_Exception)

Returns conversion mode.

Throws SALOME_Exception if distribution type is not functional

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
DistrType StdMeshers_NumberOfSegments::GetDistrType ( ) const

Get distribution type.

const char* StdMeshers_NumberOfSegments::GetExpressionFunction ( ) const throw (SALOME_Exception)

Get expression function for distribution DT_ExprFunc.

Throws SALOME_Exception if distribution type is not DT_ExprFunc

SMESH_Gen* SMESH_Hypothesis::GetGen ( ) const
inherited
int SMESHDS_Hypothesis::GetID ( ) const
inherited
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 StdMeshers_NumberOfSegments::GetNumberOfSegments ( ) const

Get the number of segments.

const char* StdMeshers_NumberOfSegments::GetObjectEntry ( )
const std::vector<int>& StdMeshers_NumberOfSegments::GetReversedEdges ( ) const
double StdMeshers_NumberOfSegments::GetScaleFactor ( ) const throw (SALOME_Exception)

Get scale factor for scale distribution.

Throws SALOME_Exception if distribution type is not DT_Scale

int SMESH_Hypothesis::GetShapeType ( ) const
virtualinherited
int SMESH_Hypothesis::GetStudyId ( ) const
inherited
const std::vector<double>& StdMeshers_NumberOfSegments::GetTableFunction ( ) const throw (SALOME_Exception)

Get table function for distribution DT_TabFunc.

Throws SALOME_Exception if distribution type is not DT_TabFunc

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_NumberOfSegments::LoadFrom ( std::istream &  load)
virtual

Implements SMESHDS_Hypothesis.

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_NumberOfSegments::SaveTo ( std::ostream &  save)
virtual

Implements SMESHDS_Hypothesis.

void StdMeshers_NumberOfSegments::SetConversionMode ( int  conv) throw (SALOME_Exception)

Set conversion mode.

When it is 0, it means "exponent mode": the function of distribution of density is used as an exponent of 10, i,e, 10^f(t). When it is 1, it means "cut negative mode". The function of distribution is used as F(t), where F(t0)=f(t0), if f(t0)>=0, otherwise F(t0) = 0. This mode is sensible only when function distribution is used (DT_TabFunc or DT_ExprFunc)

Throws SALOME_Exception if distribution type is not functional

void StdMeshers_NumberOfSegments::SetDistrType ( DistrType  typ) throw (SALOME_Exception)

Set distribution type.

void StdMeshers_NumberOfSegments::SetExpressionFunction ( const char *  expr) throw (SALOME_Exception)

Set expression function for distribution DT_ExprFunc.

Parameters
expr- string containing the expression of the function f(t), e.g. "sin(t)"

Throws SALOME_Exception if distribution type is not DT_ExprFunc

void SMESH_Hypothesis::SetLibName ( const char *  theLibName)
inherited
void StdMeshers_NumberOfSegments::SetNumberOfSegments ( int  segmentsNumber) throw (SALOME_Exception)

Set the number of segments.

Parameters
segmentsNumber- must be greater than zero
void StdMeshers_NumberOfSegments::SetObjectEntry ( const char *  entry)
bool StdMeshers_NumberOfSegments::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.

References SMESH_Hypothesis::TDefaults::_nbSegments.

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

Initialize number of segments 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 SMESHDS_Mesh::MeshElements(), and SMESHDS_SubMesh::NbElements().

void StdMeshers_NumberOfSegments::SetReversedEdges ( std::vector< int > &  ids)
void StdMeshers_NumberOfSegments::SetScaleFactor ( double  scaleFactor) throw (SALOME_Exception)
virtual

Set scale factor for scale distribution.

Parameters
scaleFactor- positive value different from 1

Throws SALOME_Exception if distribution type is not DT_Scale, or scaleFactor is not a positive value different from 1

References PRECISION.

void StdMeshers_NumberOfSegments::SetTableFunction ( const std::vector< double > &  table) throw (SALOME_Exception)

Set table function for distribution DT_TabFunc.

Parameters
table- this vector contains the pairs (parameter, value) following each by other, so the number of elements in the vector must be even. The parameters must be in range [0,1] and sorted in increase order. The values of function must be positive.

Throws SALOME_Exception if distribution type is not DT_TabFunc

References Handle(), OCC_CATCH_SIGNALS, and PRECISION.

Friends And Related Function Documentation

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

Field Documentation

int StdMeshers_NumberOfSegments::_convMode
protected

flag of conversion mode: 0=exponent, 1=cut negative

std::vector<double> StdMeshers_NumberOfSegments::_distr
protected

the table for DT_TabFunc, a sequence of pairs of numbers

DistrType StdMeshers_NumberOfSegments::_distrType
protected

the type of distribution of density function

std::vector<int> StdMeshers_NumberOfSegments::_edgeIDs
protected

list of reversed edges ids

std::string StdMeshers_NumberOfSegments::_func
protected

the expression of the function for DT_ExprFunc

SMESH_Gen* SMESH_Hypothesis::_gen
protectedinherited
int SMESHDS_Hypothesis::_hypId
protectedinherited
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_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_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 StdMeshers_NumberOfSegments::_numberOfSegments
protected

an edge will be split on to this number of segments

std::string StdMeshers_NumberOfSegments::_objEntry
protected

Entry of the main object to reverse edges.

int SMESH_Hypothesis::_param_algo_dim
protectedinherited

Referenced by SMESH_Hypothesis::SMESH_Hypothesis(), StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(), StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength::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_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_NumberOfSegments::_scaleFactor
protected

the scale parameter for DT_Scale

int SMESH_Hypothesis::_studyId
protectedinherited
std::vector<double> StdMeshers_NumberOfSegments::_table
protected