mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 12:40:33 +05:00
0021723: EDF SMESH: Calculation of Aspect Ratio
Use vtkMeshQuality::QuadAspectRatio()
This commit is contained in:
parent
d51770096b
commit
171b3e8882
@ -715,6 +715,26 @@ SMDSAbs_ElementType MinimumAngle::GetType() const
|
|||||||
Class : AspectRatio
|
Class : AspectRatio
|
||||||
Description : Functor for calculating aspect ratio
|
Description : Functor for calculating aspect ratio
|
||||||
*/
|
*/
|
||||||
|
double AspectRatio::GetValue( long theId )
|
||||||
|
{
|
||||||
|
double aVal = 0;
|
||||||
|
myCurrElement = myMesh->FindElement( theId );
|
||||||
|
if ( myCurrElement && myCurrElement->GetVtkType() == VTK_QUAD )
|
||||||
|
{
|
||||||
|
// issue 21723
|
||||||
|
vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myCurrElement->getMeshId()]->getGrid();
|
||||||
|
if ( vtkCell* avtkCell = grid->GetCell( myCurrElement->getVtkId() ))
|
||||||
|
aVal = Round( vtkMeshQuality::QuadAspectRatio( avtkCell ));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TSequenceOfXYZ P;
|
||||||
|
if ( GetPoints( myCurrElement, P ))
|
||||||
|
aVal = Round( GetValue( P ));
|
||||||
|
}
|
||||||
|
return aVal;
|
||||||
|
}
|
||||||
|
|
||||||
double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
||||||
{
|
{
|
||||||
// According to "Mesh quality control" by Nadir Bouhamau referring to
|
// According to "Mesh quality control" by Nadir Bouhamau referring to
|
||||||
|
@ -197,6 +197,7 @@ namespace SMESH{
|
|||||||
*/
|
*/
|
||||||
class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
|
class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{
|
||||||
public:
|
public:
|
||||||
|
virtual double GetValue( long theElementId );
|
||||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||||
virtual SMDSAbs_ElementType GetType() const;
|
virtual SMDSAbs_ElementType GetType() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user