mdolab / CMPLXFOIL

GNU General Public License v2.0
29 stars 20 forks source link

Fix crash in fortran layer #27

Closed eytanadler closed 2 months ago

eytanadler commented 2 months ago

Purpose

With particularly bad airfoil shapes, the IBLPAN function fails. Upon failure, it calls the STOP command. This kills not only the XFOIL instance, but also the whole Python script (not good during optimization...).

This PR removes the STOP command, instead setting fail flags accordingly and cleanly exiting back to the Python layer.

I also uncommented the residual printout in the real version of CMPLXFOIL so that the user gets some feedback on convergence behavior during the primal solve.

Expected time until merged

Now!

Type of change

Testing

Checklist

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 66.19%. Comparing base (7b16ff9) to head (b4070f8).

Files Patch % Lines
cmplxfoil/__init__.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #27 +/- ## ======================================= Coverage 66.19% 66.19% ======================================= Files 4 4 Lines 565 565 ======================================= Hits 374 374 Misses 191 191 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

A-CGray commented 2 months ago

Is it at all possible to add a test for this new behaviour? Or is it not possible to recreate a case where IBLPAN fails?

eytanadler commented 2 months ago

If it ever hits a STOP in Fortran, it will kill the program. That means that if the test ever fails, it won't be caught as a test failure and instead will kill the whole testing process. I can probably recreate a case, but if it fails it'll be very difficult to debug. Is that worth it? I think the fact that other regression tests still pass is a good sign that I haven't changed the underlying implementation.

On another note, do you have any idea what's wrong with readthedocs at first glance?