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

Implemented restartAdjoint option #188

Merged
merged 3 commits into from
Feb 10, 2022
Merged

Conversation

sseraj
Copy link
Collaborator

@sseraj sseraj commented Feb 10, 2022

Purpose

I implemented the restartAdjoint option, which previously did nothing. The default behavior, which is to use the previous adjoint solution as the initial guess, is unchanged.

Using "restartAdjoint": False improved my optimization convergence slightly. I don't know if this will be helpful in general, but it's a nice option to have even if it is just for debugging.

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

Checklist

  • I have run flake8 and black to make sure the code adheres to PEP-8 and is consistently formatted
  • 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 February 10, 2022 16:24
@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #188 (dfca74e) into master (50ce904) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #188   +/-   ##
=======================================
  Coverage   43.10%   43.10%           
=======================================
  Files          15       15           
  Lines        3517     3519    +2     
=======================================
+ Hits         1516     1517    +1     
- Misses       2001     2002    +1     
Impacted Files Coverage Δ
adflow/pyADflow.py 67.44% <66.66%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50ce904...dfca74e. Read the comment docs.

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.

Nice! Did you notice significant increases in computational wall time?

@sseraj
Copy link
Collaborator Author

sseraj commented Feb 10, 2022

Nice! Did you notice significant increases in computational wall time?

For my case, there was no increase in wall time for the adjoint solution. This is because the adjoint convergence stalls before reaching the prescribed tolerance (due to #4), so the solver always runs for the maximum number of iterations. For a regular case where the adjoint converges normally, I would expect a slight increase in wall time.

@sseraj sseraj merged commit 9bfbeb2 into mdolab:master Feb 10, 2022
@sseraj sseraj deleted the restartAdjoint branch February 10, 2022 21:53
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.

3 participants