pymapdl icon indicating copy to clipboard operation
pymapdl copied to clipboard

Better error handling by expanding error types

Open germa89 opened this issue 3 years ago • 1 comments

Description of the feature

Current state

Currently most of the errors presented in the MAPDL logs are handled as RuntimeErrors. This might be convenient, because it simplifies the implementation, but it is not for error handling.

As detailed in https://github.com/pyansys/pymapdl/discussions/1230, currently we cannot do:

try:
    mapdl.solve()
except NonConvergence:
    pass # keep going.

Steps for implementing the feature

Ideally there should be an exception type for each possible Ansys MAPDL error.

This is a bit of work, but it is worthy.

Pinging @FredAns to know if there is a dict or database for MAPDL errors, and warnings.

List of errors

violate_shape_error_limits

*** ERROR ***                           CP =       0.969   TIME= 13:30:36
 Previous testing revealed that 14 of the 38745 selected elements
 violate shape error limits.  Please review error messages on the
 output or error file (or issue the CHECK command), then delete or
 unselect those elements.

warping_factor

*** ERROR *** CP = 32.219 TIME= 00:32:58
Brick element 456 has a face with a warping factor of 0.4387, which
exceeds the error limit of 0.4.

germa89 avatar Jun 30 '22 12:06 germa89

Hi @germa89 ! Agree with you we need to improve the error handling. We have this initiative starting end of summer to improve the log/monitoring of MAPDL in PyAnsys. Warning and Error Feeback is part of the scope. Actually there's no formalized table of errors we can rely on for now.

FredAns avatar Jul 01 '22 12:07 FredAns