Changed the registration of AD input variables in CDiscAdjFluidIteration #1492
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a small issue I noticed when I worked on some features for the discrete adjoint driver.
In CDiscAdjFluidIteration::RegisterInput the inputs for the AD tape are registered.
At the moment if kind_recording == RECORDING::SOLUTION_AND_MESH is set it only registers the flow variables and has no difference to RECORDING::SOLUTION_VARIABLES. If I understand the logic for this enum option correctly, it should register the flow variables and the mesh coordinates from geometry. I.e. if you want to add unctions to the driver, which can evaluate derivatives w.r.t. flow and geometry in one tape evaluation, you should use this option.
In addition, I change an out-of-date comment.
Proposed Changes
Register the geometry variables as inputs in the discrete adjoint flow iteration if 'kind_recording == RECORDING::SOLUTION_AND_MESH'.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.