This class represents hypothesis for 1d algorithm. More...
#include <StdMeshers_NumberOfSegments.hxx>
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_Gen * | GetGen () 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_Mesh * | GetMeshByPersistentID (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) |
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
|
inherited |
|
inherited |
StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments | ( | int | hypId, |
int | studyId, | ||
SMESH_Gen * | gen | ||
) |
References SMESHDS_Hypothesis::_name, and SMESH_Hypothesis::_param_algo_dim.
|
virtual |
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 ) |
|
static |
Checks validity of the expression of the function f(t), e.g.
"sin(t)". In case of validity returns a cleaned expression
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
|
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.
|
virtualinherited |
Referenced by SMESH_Gen::TAlgoStateError::Set().
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
|
inherited |
Referenced by StdMeshers_Hexa_3D::Compute().
|
inherited |
Referenced by SMESHDS_Document::AddHypothesis().
|
virtualinherited |
|
inherited |
Find a mesh with given persistent ID.
References studyContextStruct::mapMesh.
|
inherited |
Referenced by StdMeshers_Projection_3D::CheckHypothesis(), StdMeshers_Projection_2D::CheckHypothesis(), StdMeshers_Projection_1D::CheckHypothesis(), StdMeshers_Import_1D2D::CheckHypothesis(), StdMeshers_Import_1D::CheckHypothesis(), StdMeshers_RadialQuadrangle_1D2D::CheckHypothesis(), StdMeshers_RadialPrism_3D::CheckHypothesis(), StdMeshers_Regular_1D::CheckHypothesis(), StdMeshers_MEFISTO_2D::CheckHypothesis(), and StdMeshers_Quadrangle_2D::CheckHypothesis().
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
|
virtualinherited |
|
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
|
inherited |
Referenced by checkConformIgnoredAlgos(), SMESH_Hypothesis::IsAuxiliary(), and SMESH_Mesh::IsUsedHypothesis().
|
virtualinherited |
Return true if me is an auxiliary hypothesis.
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().
|
inherited |
Compare types of hypotheses.
References SMESHDS_Hypothesis::_name.
Referenced by StdMeshers_Regular_1D::CheckHypothesis().
|
staticinherited |
|
virtual |
Implements SMESHDS_Hypothesis.
|
virtualinherited |
References studyContextStruct::mapMesh.
Referenced by StdMeshers_Reversible1D::SetReversedEdges(), and StdMeshers_ProjectionSource2D::SetSourceMesh().
|
inherited |
|
virtualinherited |
Equality.
References SMESHDS_Hypothesis::_name.
|
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.
expr | - string containing the expression of the function f(t), e.g. "sin(t)" |
Throws SALOME_Exception if distribution type is not DT_ExprFunc
|
inherited |
void StdMeshers_NumberOfSegments::SetNumberOfSegments | ( | int | segmentsNumber | ) | throw (SALOME_Exception) |
Set the number of segments.
segmentsNumber | - must be greater than zero |
void StdMeshers_NumberOfSegments::SetObjectEntry | ( | const char * | entry | ) |
|
virtual |
Initialize my parameter values by default parameters.
bool | - true if parameter values have been successfully defined |
Implements SMESH_Hypothesis.
References SMESH_Hypothesis::TDefaults::_nbSegments.
|
virtual |
Initialize number of segments by the mesh built on the geometry.
theMesh | - the built mesh |
theShape | - the geometry of interest |
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 | ) |
|
virtual |
Set scale factor for scale distribution.
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.
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.
|
friend |
|
friend |
|
protected |
flag of conversion mode: 0=exponent, 1=cut negative
|
protected |
the table for DT_TabFunc, a sequence of pairs of numbers
|
protected |
the type of distribution of density function
|
protected |
list of reversed edges ids
|
protected |
the expression of the function for DT_ExprFunc
|
protectedinherited |
Referenced by SMESH_Hypothesis::SMESH_Hypothesis().
|
protectedinherited |
|
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().
|
protected |
an edge will be split on to this number of segments
|
protected |
Entry of the main object to reverse edges.
|
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().
|
protected |
the scale parameter for DT_Scale
|
protectedinherited |
Referenced by SMESH_0D_Algo::SMESH_0D_Algo(), SMESH_1D_Algo::SMESH_1D_Algo(), SMESH_2D_Algo::SMESH_2D_Algo(), SMESH_3D_Algo::SMESH_3D_Algo(), SMESH_Hypothesis::SMESH_Hypothesis(), StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(), StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(), 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_Prism_3D::StdMeshers_Prism_3D(), StdMeshers_Projection_1D::StdMeshers_Projection_1D(), StdMeshers_Projection_3D::StdMeshers_Projection_3D(), StdMeshers_QuadFromMedialAxis_1D2D::StdMeshers_QuadFromMedialAxis_1D2D(), 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().
|
protectedinherited |
Referenced by SMESH_Hypothesis::SMESH_Hypothesis().
|
protected |
|
protectedinherited |