-
Notifications
You must be signed in to change notification settings - Fork 57
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
Adding DVGeometryMulti to MPhys #230
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #230 +/- ##
==========================================
- Coverage 65.47% 65.35% -0.12%
==========================================
Files 47 47
Lines 12265 12286 +21
==========================================
Hits 8030 8030
- Misses 4235 4256 +21 ☔ View full report in Codecov by Sentry. |
I didn't add the |
Additional note: when adding a global DV the input was being added twice to OpenMDAO. This bug is fixed here too. |
It turns out PR #201 broke the naming convention for child FFDs by prepending the child name by default. This meant that MPhys would not connect the OM variable to the DVGeo variable because the names would not match. I fixed that in this PR by setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. I just have a few minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this look good, but one big picture comment: it looks like the logical check to find the correct dvgeo is repeated in several places. Instead, I think you can reduce duplication by using "nom_getDVGeo" before each DV addition. That way you wont need to duplicate the code that finds the right DVGeo. Is this correct? If you also think this makes sense, I say go for it. If not, I am fine with merging as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few comments
There is some weird behavior in the derivatives: the first check totals is fine, but a second check totals after a design perturbation makes the second function derivative wrong. This only happens when there is an intersection. I can't exclude this being an issue with DAFoam (or even IDwarp), but I do not have the bandwidth to look more into this now. Converting to a draft. |
This is good to go. The issues with derivatives are coming from other code components, not DVGeo, and they are not unique to this PR. We should merge this in so it does not go stale again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Is there a corresponding addIntersection call? If not, how are you handling it?
Instead of having a pass-through call in MPhys, I just call the DVGeo method directly. For example:
Is this fine with you? |
Yeah this is fine I guess. The add intersection call itself does not modify openmdao i/o so thats ok |
Purpose
Adding DVGeometryMulti to MPhys. I added pass-through functions and modified the
compute
andcompute_jacvec_product
calls as needed.Expected time until merged
1 week.
Type of change
Testing
I tried this on my optimization and it appears to work (local analysis and derivatives on HPC). I would appreciate others verifying this on their cases.
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable