if ( myMesh == 0 )
return false;
- return GetPoints( myMesh->FindElement( theId ), theRes );
+ const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
+ if ( !anElem || anElem->GetType() != this->GetType() )
+ return false;
+
+ return GetPoints( anElem, theRes );
}
bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
{
theRes.clear();
- if ( anElem == 0)
+ if ( anElem == 0 )
return false;
theRes.reserve( anElem->NbNodes() );
return SMDSAbs_Volume;
}
-
+//=======================================================================
/*
Class : MaxElementLength2D
Description : Functor calculating maximum length of 2D element
double MaxElementLength2D::GetValue( long theElementId )
{
TSequenceOfXYZ P;
- if( GetPoints( theElementId, P ) && myMesh->FindElement( theElementId )->GetType() == SMDSAbs_Face) {
- GetValue(P);
- }
- return 0.;
+ return GetPoints( theElementId, P ) ? GetValue(P) : 0.0;
}
double MaxElementLength2D::GetBadRate( double Value, int /*nbNodes*/ ) const
return SMDSAbs_Face;
}
+//=======================================================================
/*
Class : MaxElementLength3D
Description : Functor calculating maximum length of 3D element
return SMDSAbs_Volume;
}
-
+//=======================================================================
/*
Class : MinimumAngle
Description : Functor for calculation of minimum angle