Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to turn off negative volume print out #276

Merged
merged 3 commits into from
Mar 25, 2023
Merged

Conversation

sseraj
Copy link
Collaborator

@sseraj sseraj commented Mar 24, 2023

Purpose

I added an option to turn off printing of the negative volume indices and coordinates. The printout is useful for debugging, but I find that it mainly pollutes the output during production runs.

Setting the option printNegativeVolumes to False will mean that messages like the following will not be printed:

#
#                      Error
# Negative volumes found in the grid.
# A list of the negative volumes is printed below
#
#
# Block domain.00006 contains the following negative volumes
#--------------------------------------------------------------------
#
# Indices (2,25,38), coordinates ( 4.114E+01, 8.003E+00,-6.111E-01), Volume: -1.080E-04
# Indices (3,25,38), coordinates ( 4.117E+01, 8.005E+00,-5.494E-01), Volume: -2.248E-05
# Indices (2,23,39), coordinates ( 4.241E+01, 9.122E+00,-5.432E-01), Volume: -3.067E-04
# Indices (3,23,39), coordinates ( 4.245E+01, 9.110E+00,-4.905E-01), Volume: -2.873E-04
# Indices (4,23,39), coordinates ( 4.249E+01, 9.106E+00,-4.271E-01), Volume: -1.384E-04
# Indices (2,24,39), coordinates ( 4.179E+01, 8.530E+00,-5.689E-01), Volume: -3.465E-04
# Indices (3,24,39), coordinates ( 4.183E+01, 8.528E+00,-5.090E-01), Volume: -2.921E-04
# Indices (4,24,39), coordinates ( 4.187E+01, 8.537E+00,-4.401E-01), Volume: -1.667E-04
# Indices (2,25,39), coordinates ( 4.112E+01, 8.013E+00,-6.323E-01), Volume: -9.895E-04
                                             .
                                             .
                                             .

The returnFail error message will still be printed, so it is still clear that negative volumes have been encountered:

#
#--------------------------- !!! Error !!! ----------------------------
#* returnFail called by processor 0
#* Run-time error in procedure metric
#* Error message: Negative volumes present in grid.
#*
#----------------------------------------------------------------------
#

Expected time until merged

1 week

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I tested it on a wing case with geometry changes that cause negative volumes, and the option behaves as expected.

Checklist

  • I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@sseraj sseraj requested a review from a team as a code owner March 24, 2023 19:52
@sseraj sseraj requested review from lamkina and eirikurj March 24, 2023 19:52
@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #276 (d6e3cfc) into main (b17f071) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #276   +/-   ##
=======================================
  Coverage   40.77%   40.77%           
=======================================
  Files          13       13           
  Lines        3882     3882           
=======================================
  Hits         1583     1583           
  Misses       2299     2299           
Impacted Files Coverage Δ
adflow/pyADflow.py 66.62% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

marcomangano
marcomangano previously approved these changes Mar 24, 2023
Copy link
Contributor

@marcomangano marcomangano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relatable, LGTM

@anilyil anilyil self-requested a review March 25, 2023 16:15
Copy link
Contributor

@anilyil anilyil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. I suggest we make the default False. Nobody reads this and gets any use out of it. The better way is to just visualize the negative volumes in tecplot.

@sseraj sseraj merged commit 9874e80 into main Mar 25, 2023
@sseraj sseraj deleted the neg-vol-print branch March 25, 2023 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants