mdolab / adflow

ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
Other
229 stars 100 forks source link

Option to specify number of leading zeros in solution filename number #345

Closed eytanadler closed 9 months ago

eytanadler commented 9 months ago

Purpose

In the existing version, the output file numbering is hard coded to be three digits long (e.g. 003). If there are more than 999 output files, the number is extended to four digits. This messes with file sorting in some cases because the 1001th case can come between the 101st and 102nd, depending on the sorting algorithm.

This PR adds a new option, writeSolutionDigits, to manually specify the number of digits in the output filename to get around this sorting problem.

Expected time until merged

A few days

Type of change

Testing

Run a case that writes out solution files. Try changing the writeSolutionDigits option to something other than the default of 3 and observe that the output filenames change.

Checklist

eytanadler commented 9 months ago

Can you also update the failed mesh solution counter?

Yes chef!

codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 41.49%. Comparing base (65c0fc5) to head (1922c66).

Files Patch % Lines
adflow/pyADflow.py 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #345 +/- ## ========================================== + Coverage 41.46% 41.49% +0.02% ========================================== Files 13 13 Lines 4064 4066 +2 ========================================== + Hits 1685 1687 +2 Misses 2379 2379 ```

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

eytanadler commented 9 months ago

@eirikurj if you're ok mixing PRs, I'm happy to make these minor changes in #343.

eirikurj commented 8 months ago

In general I do prefer a separate PR, even if these are just small changes. But since #343 is small as well, I guess its fine.