-
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
Merged
Merged
Custom ptsets #89
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b14bd16
added custom pointset option to setdvgeo
anilyil 31fb353
Merge branch 'main' into custom_ptsets
anilyil 7e24c4e
set attribute even when dvgeo is not set
anilyil 97741de
Merge branch 'main' into custom_ptsets
hajdik a71bb6a
updated docstring
anilyil 01c54d9
address sabet's comments
anilyil 11ffab5
simplify code
anilyil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,8 +54,9 @@ | |
self.families = CaseInsensitiveDict() | ||
self._updateGeomInfo = False | ||
|
||
# Initialize kwargs for addPointSet | ||
# Initialize kwargs for addPointSet and customPointSetFamilies | ||
self.pointSetKwargs = None | ||
self.customPointSetFamilies = None | ||
|
||
def setMesh(self, mesh): | ||
""" | ||
|
@@ -79,7 +80,7 @@ | |
pts = self.getSurfaceCoordinates(self.meshFamilyGroup) | ||
self.mesh.setSurfaceDefinition(pts, conn, faceSizes) | ||
|
||
def setDVGeo(self, DVGeo, pointSetKwargs=None): | ||
def setDVGeo(self, DVGeo, pointSetKwargs=None, customPointSetFamilies=None): | ||
""" | ||
Set the DVGeometry object that will manipulate 'geometry' in | ||
this object. Note that <SOLVER> does not **strictly** need a | ||
|
@@ -94,6 +95,20 @@ | |
pointSetKwargs : dict | ||
Keyword arguments to be passed to the DVGeo addPointSet call. | ||
Useful for DVGeometryMulti, specifying FFD projection tolerances, etc. | ||
These arguments are used for all point sets added by this solver. | ||
|
||
customPointSetFamilies : dict of dicts | ||
This argument is used to split up the surface points added to the DVGeo by the solver into potentially | ||
multiple subsets. The keys of the dictionary will be used to determine what families should be | ||
added to the dvgeo object as separate point sets. The values of each key is another dictionary, which can be empty. | ||
If desired, the inner dictionaries can contain custom kwargs for the addPointSet call for each surface family, | ||
specified by the keys of the top level dictionary. | ||
The surface families need to be all part of the designSurfaceFamily. | ||
Useful for DVGeometryMulti, specifying FFD projection tolerances, etc. | ||
If this is provided together with pointSetKwargs, the regular pointSetKwargs | ||
will be appended to each component's dictionary. If the same argument | ||
is also provided in pointSetKwargs, the value specified in customPointSetFamilies | ||
will be used. | ||
|
||
Examples | ||
-------- | ||
|
@@ -103,11 +118,15 @@ | |
|
||
self.DVGeo = DVGeo | ||
|
||
# save the common kwargs dict. default is empty | ||
if pointSetKwargs is None: | ||
self.pointSetKwargs = {} | ||
else: | ||
self.pointSetKwargs = pointSetKwargs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code avoids mutable defaults, so we should keep it like this. |
||
|
||
# save if we have customPointSetFamilies. this default is not mutable so we can just set it as is. | ||
self.customPointSetFamilies = customPointSetFamilies | ||
|
||
def getTriangulatedMeshSurface(self, groupName=None, **kwargs): | ||
""" | ||
This function returns a trianguled verision of the surface | ||
|
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.
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.