Simcenter MAGNET Suite Possible issue in Simcenter MAGNET 2212.0002: getFieldInElement() and getFieldInFieldElement() don't check validity of element index

2023-12-14T20:58:59.000-0500
MAGNET Electric MAGNET MAGNET Thermal

Summary

getFieldInElement() and getFieldInFieldElement() don't check validity of element index. Please upgrade to the latest release of Simcenter MAGNET to avoid this issue altogether.


Details

The Field scripting commands
 
  • getFieldInElement (geometric element index, value array)
  • getFieldInFieldElement (geometric element Index, field element index, value array)
presently do not check the element index for an invalid value. In our test involving an invalid element index, getFieldInElement() did not return the expected invalid argument exception in scripting. Rather, the output "value array" was set to the very low |B| value of 1.22e-319, and the function itself had a return value of True. If at least the function had a return value of False, it would be easier to detect an invalid element index.


Workaround: We don't recommend trying to recognize an output array of very low values. Avoid the issue at the source by using the command Mesh.getNumberOfElements() to deduce the valid range of element indices. The minimum value is zero, and the maximum value is one less than the number of elements.

KB Article ID# KB000128226_EN_US

Contents

SummaryDetails

Associated Components

Simcenter MAGNET Electric