#18611 EDF 20669 - Quality of quadrangles

This commit is contained in:
eap 2020-01-16 13:52:52 +03:00
parent d2681a122c
commit ad718f9854

View File

@ -765,19 +765,9 @@ double AspectRatio::GetValue( long theId )
{ {
double aVal = 0; double aVal = 0;
myCurrElement = myMesh->FindElement( theId ); myCurrElement = myMesh->FindElement( theId );
if ( myCurrElement && myCurrElement->GetVtkType() == VTK_QUAD )
{
// issue 21723
vtkUnstructuredGrid* grid = const_cast<SMDS_Mesh*>( myMesh )->GetGrid();
if ( vtkCell* avtkCell = grid->GetCell( myCurrElement->GetVtkID() ))
aVal = Round( vtkMeshQuality::QuadAspectRatio( avtkCell ));
}
else
{
TSequenceOfXYZ P; TSequenceOfXYZ P;
if ( GetPoints( myCurrElement, P )) if ( GetPoints( myCurrElement, P ))
aVal = Round( GetValue( P )); aVal = Round( GetValue( P ));
}
return aVal; return aVal;
} }
@ -850,7 +840,7 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
// //
// alpha = sqrt( 1/32 ) // alpha = sqrt( 1/32 )
// L = max( L1, L2, L3, L4, D1, D2 ) // L = max( L1, L2, L3, L4, D1, D2 )
// C1 = sqrt( ( L1^2 + L1^2 + L1^2 + L1^2 ) / 4 ) // C1 = sqrt( L1^2 + L1^2 + L1^2 + L1^2 )
// C2 = min( S1, S2, S3, S4 ) // C2 = min( S1, S2, S3, S4 )
// Li - lengths of the edges // Li - lengths of the edges
// Di - lengths of the diagonals // Di - lengths of the diagonals
@ -861,10 +851,10 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
Max( aLen[ 2 ], Max( aLen[ 2 ],
Max( aLen[ 3 ], Max( aLen[ 3 ],
Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) ); Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
double C1 = sqrt( ( aLen[0] * aLen[0] + double C1 = sqrt( aLen[0] * aLen[0] +
aLen[1] * aLen[1] + aLen[1] * aLen[1] +
aLen[2] * aLen[2] + aLen[2] * aLen[2] +
aLen[3] * aLen[3] ) / 4. ); aLen[3] * aLen[3] );
double C2 = Min( anArea[ 0 ], double C2 = Min( anArea[ 0 ],
Min( anArea[ 1 ], Min( anArea[ 1 ],
Min( anArea[ 2 ], anArea[ 3 ] ) ) ); Min( anArea[ 2 ], anArea[ 3 ] ) ) );
@ -894,7 +884,7 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
// //
// alpha = sqrt( 1/32 ) // alpha = sqrt( 1/32 )
// L = max( L1, L2, L3, L4, D1, D2 ) // L = max( L1, L2, L3, L4, D1, D2 )
// C1 = sqrt( ( L1^2 + L1^2 + L1^2 + L1^2 ) / 4 ) // C1 = sqrt( L1^2 + L1^2 + L1^2 + L1^2 )
// C2 = min( S1, S2, S3, S4 ) // C2 = min( S1, S2, S3, S4 )
// Li - lengths of the edges // Li - lengths of the edges
// Di - lengths of the diagonals // Di - lengths of the diagonals
@ -905,10 +895,10 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
Max( aLen[ 2 ], Max( aLen[ 2 ],
Max( aLen[ 3 ], Max( aLen[ 3 ],
Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) ); Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
double C1 = sqrt( ( aLen[0] * aLen[0] + double C1 = sqrt( aLen[0] * aLen[0] +
aLen[1] * aLen[1] + aLen[1] * aLen[1] +
aLen[2] * aLen[2] + aLen[2] * aLen[2] +
aLen[3] * aLen[3] ) / 4. ); aLen[3] * aLen[3] );
double C2 = Min( anArea[ 0 ], double C2 = Min( anArea[ 0 ],
Min( anArea[ 1 ], Min( anArea[ 1 ],
Min( anArea[ 2 ], anArea[ 3 ] ) ) ); Min( anArea[ 2 ], anArea[ 3 ] ) ) );