Version: 8.3.0
StdMeshers_CartesianParameters3D Class Reference

This hypothesis specifies. More...

#include <StdMeshers_CartesianParameters3D.hxx>

Inheritance diagram for StdMeshers_CartesianParameters3D:

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_CartesianParameters3D (int hypId, int studyId, SMESH_Gen *gen)
 
void SetGrid (std::vector< double > &xNodes, int axis) throw ( SALOME_Exception )
 Sets coordinates of node positions along an axis (countered from 0) More...
 
void GetGrid (std::vector< double > &xNodes, int axis) const throw ( SALOME_Exception )
 Return coordinates of node positions along the three axes. More...
 
void SetGridSpacing (std::vector< std::string > &spaceFunctions, std::vector< double > &internalPoints, const int axis) throw ( SALOME_Exception )
 Set grid spacing along the three axes. More...
 
void GetGridSpacing (std::vector< std::string > &spaceFunctions, std::vector< double > &internalPoints, const int axis) const throw ( SALOME_Exception )
 
bool IsGridBySpacing (const int axis) const throw ( SALOME_Exception )
 
void SetFixedPoint (const double p[3], bool toUnset)
 Set/unset a fixed point, at which a node will be created provided that grid is defined by spacing in all directions. More...
 
bool GetFixedPoint (double p[3]) const
 
void GetCoordinates (std::vector< double > &xNodes, std::vector< double > &yNodes, std::vector< double > &zNodes, const Bnd_Box &bndBox) const throw ( SALOME_Exception )
 Return coordinates of node positions along the three axes. More...
 
void SetAxisDirs (const double *the9DirComps) throw ( SALOME_Exception )
 Set custom direction of axes. More...
 
const double * GetAxisDirs () const
 
void SetSizeThreshold (const double threshold) throw ( SALOME_Exception )
 Set size threshold. More...
 
double GetSizeThreshold () const
 Return size threshold. More...
 
void SetToAddEdges (bool toAdd)
 Enables implementation of geometrical edges into the mesh. More...
 
bool GetToAddEdges () const
 
bool IsDefined () const
 Return true if parameters are well defined. More...
 
virtual std::ostream & SaveTo (std::ostream &save)
 Persistence methods. More...
 
virtual std::istream & LoadFrom (std::istream &load)
 
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Initialize my parameter values 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 void ComputeCoordinates (const double x0, const double x1, std::vector< std::string > &spaceFuns, std::vector< double > &points, std::vector< double > &coords, const std::string &axis, const double *xForced=0) throw (SALOME_Exception)
 Computes node coordinates by spacing functions. More...
 
static void ComputeOptimalAxesDirs (const TopoDS_Shape &shape, const bool isOrthogonal, double dirCoords[9])
 Returns axes at which number of hexahedra is maximal. More...
 
static bool IsStatusFatal (Hypothesis_Status theStatus)
 

Protected Attributes

std::vector< double > _coords [3]
 
std::vector< std::string > _spaceFunctions [3]
 
std::vector< double > _internalPoints [3]
 
double _axisDirs [9]
 
double _fixedPoint [3]
 
double _sizeThreshold
 
bool _toAddEdges
 
SMESH_Gen_gen
 
int _studyId
 
int _shapeType
 
int _param_algo_dim
 
std::string _name
 
int _hypId
 
hypothesis_type _type
 

Detailed Description

This hypothesis specifies.

  • Definition of the Cartesian grid
  • Size threshold

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_CartesianParameters3D::StdMeshers_CartesianParameters3D ( int  hypId,
int  studyId,
SMESH_Gen gen 
)

Member Function Documentation

static void StdMeshers_CartesianParameters3D::ComputeCoordinates ( const double  x0,
const double  x1,
std::vector< std::string > &  spaceFuns,
std::vector< double > &  points,
std::vector< double > &  coords,
const std::string &  axis,
const double *  xForced = 0 
) throw (SALOME_Exception)
static

Computes node coordinates by spacing functions.

Parameters
x0- lower coordinate
x1- upper coordinate
spaceFuns- space functions
points- internal points
coords- the computed coordinates
void StdMeshers_CartesianParameters3D::ComputeOptimalAxesDirs ( const TopoDS_Shape &  shape,
const bool  isOrthogonal,
double  dirCoords[9] 
)
static

Returns axes at which number of hexahedra is maximal.

References Abs(), Face, gpXYZ, and Handle().

Referenced by StdMeshers_CartesianParameters3D_i::ComputeOptimalAxesDirs().

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.

const double* StdMeshers_CartesianParameters3D::GetAxisDirs ( ) const
void StdMeshers_CartesianParameters3D::GetCoordinates ( std::vector< double > &  xNodes,
std::vector< double > &  yNodes,
std::vector< double > &  zNodes,
const Bnd_Box &  bndBox 
) const throw ( SALOME_Exception )

Return coordinates of node positions along the three axes.

If the grid is defined by spacing functions, the coordinates are computed

References me.

int SMESH_Hypothesis::GetDim ( ) const
virtualinherited
bool StdMeshers_CartesianParameters3D::GetFixedPoint ( double  p[3]) const
SMESH_Gen* SMESH_Hypothesis::GetGen ( ) const
inherited
void StdMeshers_CartesianParameters3D::GetGrid ( std::vector< double > &  xNodes,
int  axis 
) const throw ( SALOME_Exception )

Return coordinates of node positions along the three axes.

void StdMeshers_CartesianParameters3D::GetGridSpacing ( std::vector< std::string > &  spaceFunctions,
std::vector< double > &  internalPoints,
const int  axis 
) const throw ( SALOME_Exception )
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 SMESH_Hypothesis::GetShapeType ( ) const
virtualinherited
double StdMeshers_CartesianParameters3D::GetSizeThreshold ( ) const

Return size threshold.

Referenced by StdMeshers_CartesianParameters3D_i::GetSizeThreshold().

int SMESH_Hypothesis::GetStudyId ( ) const
inherited
bool StdMeshers_CartesianParameters3D::GetToAddEdges ( ) const
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 StdMeshers_CartesianParameters3D::IsDefined ( ) const

Return true if parameters are well defined.

bool StdMeshers_CartesianParameters3D::IsGridBySpacing ( const int  axis) const throw ( SALOME_Exception )
bool SMESHDS_Hypothesis::IsSameName ( const SMESHDS_Hypothesis other) const
inherited

Compare types of hypotheses.

References SMESHDS_Hypothesis::_name.

Referenced by StdMeshers_Regular_1D::CheckHypothesis().

std::istream & StdMeshers_CartesianParameters3D::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.

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

Persistence methods.

Implements SMESHDS_Hypothesis.

void StdMeshers_CartesianParameters3D::SetAxisDirs ( const double *  the9DirComps) throw ( SALOME_Exception )

Set custom direction of axes.

References Abs().

void StdMeshers_CartesianParameters3D::SetFixedPoint ( const double  p[3],
bool  toUnset 
)

Set/unset a fixed point, at which a node will be created provided that grid is defined by spacing in all directions.

Referenced by StdMeshers_CartesianParameters3D_i::SetFixedPoint(), and StdMeshers_CartesianParameters3D().

void StdMeshers_CartesianParameters3D::SetGrid ( std::vector< double > &  xNodes,
int  axis 
) throw ( SALOME_Exception )

Sets coordinates of node positions along an axis (countered from 0)

void StdMeshers_CartesianParameters3D::SetGridSpacing ( std::vector< std::string > &  spaceFunctions,
std::vector< double > &  internalPoints,
const int  axis 
) throw ( SALOME_Exception )

Set grid spacing along the three axes.

Parameters
spaceFunctions- functions defining spacing values at given point on axis
internalPoints- points dividing a grid into parts along each direction

Parameter t of spaceFunction f(t) is a position [0,1] within bounding box of the shape to mesh

void SMESH_Hypothesis::SetLibName ( const char *  theLibName)
inherited
bool StdMeshers_CartesianParameters3D::SetParametersByDefaults ( const TDefaults dflts,
const SMESH_Mesh theMesh = 0 
)
virtual

Initialize my parameter values by default parameters.

Implements SMESH_Hypothesis.

References SMESH_Hypothesis::TDefaults::_elemLength.

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

Initialize my parameter values by the mesh built on the geometry.

Implements SMESH_Hypothesis.

void StdMeshers_CartesianParameters3D::SetSizeThreshold ( const double  threshold) throw ( SALOME_Exception )

Set size threshold.

A polyhedral cell got by cutting an initial hexahedron by geometry boundary is considered small and is removed if it's size is times less than the size of the initial hexahedron.

void StdMeshers_CartesianParameters3D::SetToAddEdges ( bool  toAdd)

Enables implementation of geometrical edges into the mesh.

If this feature is disabled, sharp edges of the shape are lost ("smoothed") in the mesh if they don't coincide with the grid lines

Referenced by StdMeshers_CartesianParameters3D_i::SetToAddEdges().

Field Documentation

double StdMeshers_CartesianParameters3D::_axisDirs[9]
protected
std::vector<double> StdMeshers_CartesianParameters3D::_coords[3]
protected
double StdMeshers_CartesianParameters3D::_fixedPoint[3]
protected
SMESH_Gen* SMESH_Hypothesis::_gen
protectedinherited
int SMESHDS_Hypothesis::_hypId
protectedinherited
std::vector<double> StdMeshers_CartesianParameters3D::_internalPoints[3]
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_AutomaticLength(), StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(), 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_AutomaticLength(), 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_CartesianParameters3D::_sizeThreshold
protected
std::vector<std::string> StdMeshers_CartesianParameters3D::_spaceFunctions[3]
protected
int SMESH_Hypothesis::_studyId
protectedinherited
bool StdMeshers_CartesianParameters3D::_toAddEdges
protected