Skip to content
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

Fix formatting #223

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 37 additions & 22 deletions pygeo/parameterization/DVGeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ class DVGeometry(BaseDVGeometry):
First list contains the min and max bounds for the u parameter, second v, third w.
This parameter can also be set after initialization using the `setVolBounds` method.
For example if the FFD has 3 volumes, setting volBounds to:
>>> volBounds = {
>>> 0: [[0., 0.5], [0., 1.], [0., 1.]],
>>> 1: [[0., 1.], [0.5, 1.], [0., 1.]]
>>> }

>>> volBounds = {
>>> 0: [[0., 0.5], [0., 1.], [0., 1.]],
>>> 1: [[0., 1.], [0.5, 1.], [0., 1.]]
>>> }

will set the parametric bounds of the first and second volumes, while the third
volume can still embed points using the usual bounds of 0 to 1 for all parametric
directions. In this example, the first volume only embeds points if the u coordinate
Expand All @@ -98,22 +100,33 @@ class DVGeometry(BaseDVGeometry):
Examples
--------
The general sequence of operations for using DVGeometry is as follows::
>>> from pygeo import DVGeometry
>>> DVGeo = DVGeometry('FFD_file.fmt')
>>> # Embed a set of coordinates Xpt into the object
>>> DVGeo.addPointSet(Xpt, 'myPoints')
>>> # Associate a 'reference axis' for large-scale manipulation
>>> DVGeo.addRefAxis('wing_axis', axis_curve)
>>> # Define a global design variable function:
>>> def twist(val, geo):
>>> geo.rot_z['wing_axis'].coef[:] = val[:]
>>> # Now add this as a global variable:
>>> DVGeo.addGlobalDV('wing_twist', 0.0, twist, lower=-10, upper=10)
>>> # Now add local (shape) variables
>>> DVGeo.addLocalDV('shape', lower=-0.5, upper=0.5, axis='y')
>>> from pygeo import DVGeometry
>>> DVGeo = DVGeometry('FFD_file.fmt')
>>> # Embed a set of coordinates Xpt into the object
>>> DVGeo.addPointSet(Xpt, 'myPoints')
>>> # Associate a 'reference axis' for large-scale manipulation
>>> DVGeo.addRefAxis('wing_axis', axis_curve)
>>> # Define a global design variable function:
>>> def twist(val, geo):
>>> geo.rot_z['wing_axis'].coef[:] = val[:]
>>> # Now add this as a global variable:
>>> DVGeo.addGlobalDV('wing_twist', 0.0, twist, lower=-10, upper=10)
>>> # Now add local (shape) variables
>>> DVGeo.addLocalDV('shape', lower=-0.5, upper=0.5, axis='y')
"""

def __init__(self, fileName, *args, isComplex=False, child=False, faceFreeze=None, name=None, kmax=4, volBounds=None, **kwargs):
def __init__(
self,
fileName,
*args,
isComplex=False,
child=False,
faceFreeze=None,
name=None,
kmax=4,
volBounds=None,
**kwargs,
):
super().__init__(fileName=fileName, name=name)

self.DV_listGlobal = OrderedDict() # Global Design Variable List
Expand Down Expand Up @@ -3247,10 +3260,12 @@ def setVolBounds(self, volBounds):
First list contains the min and max bounds for the u parameter, second v, third w.
This parameter can also be set after initialization using the `setVolBounds` method.
For example if the FFD has 3 volumes, setting volBounds to:
>>> volBounds = {
>>> 0: [[0., 0.5], [0., 1.], [0., 1.]],
>>> 1: [[0., 1.], [0.5, 1.], [0., 1.]]
>>> }

>>> volBounds = {
>>> 0: [[0., 0.5], [0., 1.], [0., 1.]],
>>> 1: [[0., 1.], [0.5, 1.], [0., 1.]]
>>> }

will set the parametric bounds of the first and second volumes, while the third
volume can still embed points using the usual bounds of 0 to 1 for all parametric
directions. In this example, the first volume only embeds points if the u coordinate
Expand Down