-
Notifications
You must be signed in to change notification settings - Fork 55
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
SVD composite DVs for VSP and ESP #170
Conversation
Codecov Report
@@ Coverage Diff @@
## main #170 +/- ##
==========================================
- Coverage 64.14% 63.78% -0.36%
==========================================
Files 47 47
Lines 11866 11954 +88
==========================================
+ Hits 7611 7625 +14
- Misses 4255 4329 +74
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Very nice, great that the SVD DVs can be used for other parameterizations now! I have some (primarily formatting) comments to start.
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.
You should add a test for the FFD stuff, and make sure the refactoring does not change the behaviour of that code.
Right! the option was not necessary, it was removed. |
So does this not happen for other composite DVs when used in MPhys? |
This is the same for all composite DV cases. The optimizer has the information on composite DVs only, it doesn't have the information on the default DVs from VSP. pyGeo does the transformation from composite to default DVs when the necessary changes are required inside it. |
If it would be the same for all composite DVs, shouldn't the |
Added the composite optionality to all DVGeo. |
pygeo/mphys/mphys_dvgeo.py
Outdated
# global DVs are only added to FFD-based DVGeo objects | ||
if self.geo_type != "ffd": | ||
raise RuntimeError(f"Only FFD-based DVGeo objects can use global DVs, not type:{self.geo_type}") | ||
|
||
# define the input | ||
self.add_input(dvName, distributed=False, shape=len(value)) | ||
# When composite DVs are used, input is not required for the default DVs | ||
if add_input: |
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.
I still think that the reason this step happens is unclear when you just read the code and don't have the context of the PR. Because add_input
is used IFF the DV is composite (correct me if I'm wrong), I think it would make more sense to have the variable name reflect that. Like if the variable name were isComposite
or something similar so the check becomes
if isComposite(): <do thing>
and then the comment can say that the initial setup of the composite DV makes the extra step necessary.
The |
Have we verified that the FFD DVGeo SVD tests also pass on the main branch before the PR? |
Yes I tested the same test with main branch. It was working. |
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.
I don't have time to review this PR in detail, it would be good if someone else can take a look.
Purpose
Expected time until merged
This PR includes the @nwu63 composite DV concept of FFD cases. A similar formulation is implemented to use the SVD transformation for VSP and ESP design variables. A test for VSP is also included.
Type of change
Testing
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