-
Notifications
You must be signed in to change notification settings - Fork 26
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
Custom ptsets #89
Custom ptsets #89
Conversation
Codecov Report
@@ Coverage Diff @@
## main #89 +/- ##
==========================================
- Coverage 35.44% 35.42% -0.03%
==========================================
Files 26 26
Lines 2584 2586 +2
==========================================
Hits 916 916
- Misses 1668 1670 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
LGTM, I opened a separate PR for the flake8 issues. Once that is merged this is good to go, so we can move on to the related ADflow PR. |
baseclasses/solvers/pyAero_solver.py
Outdated
@@ -95,6 +96,13 @@ def setDVGeo(self, DVGeo, pointSetKwargs=None): | |||
Keyword arguments to be passed to the DVGeo addPointSet call. | |||
Useful for DVGeometryMulti, specifying FFD projection tolerances, etc. | |||
|
|||
customPointSetKwargs : dict of dicts |
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.
Doesn't match the input argument name. But thinking about it, could we separate the specification of the multiple pointsets from their options? e.g have customPointSetFamilies
just be a list of the families to put in separate ptsets, and then add a customPointSetKwargs
argument to specify the options for each one?
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.
Then you would need to specify the ptset names twice. This way its the least amount of code duplication when prescribing. I will reword the docstring but basically the ptsetkwargs will be shared across all ptsets (e.g. nIter=200) and then each family gets its custom args that are applied on top. This approach also avoids using kwargs for multiple purposes depending on a list vs a dictionary that is provided. We use that approach a lot but its not clear what the behavior is. This way there is no ambiguity. I will also explain the order these are applied so if the same option is provided in both one overwrites the other.
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.
OK, I'm fine with just the docstring changes
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.
Bump, @anilyil
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.
Pushed some changes. please take a look
if pointSetKwargs is None: | ||
self.pointSetKwargs = {} | ||
else: | ||
self.pointSetKwargs = pointSetKwargs |
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.
This code avoids mutable defaults, so we should keep it like this.
customPointSetFamilies : dict of dicts | ||
Keyword arguments to be passed to the DVGeo addPointSet call for each surface family, | ||
specified by the keys. The surface families need to be all part of the designSurfaceFamily. | ||
Useful for DVGeometryMulti, specifying FFD projection tolerances, etc. |
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 feel like the three lines above do not emphasize the main purpose of this argument, which is to have subsets of the CFD surface as separate point sets. I would rephrase this to first talk about what the keys are and what they do, then talk about how the values are dictionaries of keyword arguments.
Purpose
This PR adds capability to set custom pointsets when adding DVGeo to the aero solver. The custom pointsets are provided in a dict where keys are the corresponding family names in the solver and values are the custom kwargs passed with those pointsets. See the relevant ADflow PR: mdolab/adflow#299
Expected time until merged
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