Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a2963ad
Replace OpenMDAO's `assert_check_totals` in MPhys tests
A-CGray Dec 9, 2024
577f7a9
Merge branch 'main' of github.com:mdolab/pygeo
A-CGray Mar 3, 2025
afe0639
Merge branch 'main' of github.com:mdolab/pygeo
A-CGray Mar 11, 2025
ba19be7
Merge branch 'main' of github.com:mdolab/pygeo
A-CGray Mar 20, 2025
84a7e7e
Merge branch 'main' of github.com:mdolab/pygeo
A-CGray Jun 26, 2025
57b9296
Rename getValues to getDesignVars
A-CGray Jul 23, 2025
190af64
Cleanup DVGeo code
A-CGray Jul 23, 2025
40307e0
Should've been in older commit
A-CGray Jul 23, 2025
4304a31
Add getDVBounds method
A-CGray Jul 23, 2025
9986032
Add method for getting originally added point coordinates from DVGeo …
A-CGray Jul 24, 2025
d5f4b9f
Add least squares fit capability for all DVGeo's
A-CGray Jul 24, 2025
1e67f03
Cleaning up some comments
A-CGray Jul 24, 2025
d1ddfc8
flake8 fixes
A-CGray Jul 24, 2025
a37c6a8
Fix bug in `convertSensitivityToDict`
A-CGray Jul 25, 2025
4edeffe
More DVGeo cleanup
A-CGray Jul 25, 2025
d5462c3
Fix DVGeo `totalSensitivityProd`
A-CGray Jul 25, 2025
c0fc285
Ignore mphys test output
A-CGray Jul 25, 2025
7a81315
Return scipy least squares result
A-CGray Jul 25, 2025
9af0692
First stab at a fitting test, failing atm
A-CGray Jul 25, 2025
4e1636d
First test working
A-CGray Jul 28, 2025
e368eb7
`isort .`
A-CGray Jul 28, 2025
df468d1
Switch to older sparse matrix type
A-CGray Jul 28, 2025
7b92e48
Mod test
A-CGray Jul 29, 2025
1a5a5f5
Make comm an attribute of the base DVGeometry class
A-CGray Aug 19, 2025
da422f6
Make fitting work for distributed pointsets
A-CGray Aug 19, 2025
3e6b978
New test
A-CGray Aug 19, 2025
659e9ba
`isort .`
A-CGray Aug 19, 2025
df5dd88
flake8
A-CGray Aug 19, 2025
6e0e9f2
Merge branch 'main' into DVGeoFit
A-CGray Sep 2, 2025
8f11f64
Merge branch 'main' into DVGeoFit
A-CGray Sep 17, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ input_files
.isort.cfg
*.vscode
tests/reg_tests/reports/
tests/reg_tests/test_MPhys*
2 changes: 1 addition & 1 deletion doc/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ You can now hopefully appreciate the physical analogy of the control points as p

The code snippet below illustrates a few key methods of the public API.

* :meth:`getValues <.DVGeometry.getValues>` returns the current design variable values as a dictionary where the keys are the DV names.
* :meth:`getDesignVars <.DVGeometry.getDesignVars>` returns the current design variable values as a dictionary where the keys are the DV names.
* :meth:`setDesignVars <.DVGeometry.setDesignVars>` sets the design variables to new values using an input dictionary.
* :meth:`update <.DVGeometry.update>` recalculates the pointset locations given potentially updated design variable values.

Expand Down
10 changes: 5 additions & 5 deletions examples/c172_wing/runFFDExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_fresh_dvgeo():
DVGeo.addLocalDV("shape", lower=-0.5, upper=0.5, axis="y", scale=1.0)

# Perturb some local variables and observe the effect on the surface
dvdict = DVGeo.getValues()
dvdict = DVGeo.getDesignVars()
dvdict["shape"][DVGeo.getLocalIndex(0)[:, 1, 5]] += 0.15
dvdict["shape"][DVGeo.getLocalIndex(0)[3, 1, 1]] += 0.15
DVGeo.setDesignVars(dvdict)
Expand Down Expand Up @@ -104,7 +104,7 @@ def create_fresh_dvgeo():
shapes = [shape_1, shape_2]
DVGeo.addShapeFunctionDV("shape_func", shapes)

dvdict = DVGeo.getValues()
dvdict = DVGeo.getDesignVars()
dvdict["shape_func"] = np.array([0.3, 0.2])
DVGeo.setDesignVars(dvdict)

Expand Down Expand Up @@ -176,7 +176,7 @@ def sweep(val, geo):

# rst set DV
# set a twist distribution from -10 to +20 degrees along the span
dvdict = DVGeo.getValues()
dvdict = DVGeo.getDesignVars()
dvdict["twist"] = np.linspace(-10.0, 20.0, nrefaxpts)
DVGeo.setDesignVars(dvdict)
# write out the twisted wing and FFD
Expand All @@ -188,7 +188,7 @@ def sweep(val, geo):

# rst set DV 2
# now add some sweep and change the twist a bit
dvdict = DVGeo.getValues()
dvdict = DVGeo.getDesignVars()
dvdict["sweep"] = 30.0
dvdict["twist"] = np.linspace(0.0, 20.0, nrefaxpts)
DVGeo.setDesignVars(dvdict)
Expand Down Expand Up @@ -222,7 +222,7 @@ def chord(val, geo):
DVGeo.addLocalDV("thickness", axis="y", lower=-0.5, upper=0.5)

# change everything and the kitchen sink
dvdict = DVGeo.getValues()
dvdict = DVGeo.getDesignVars()
dvdict["twist"] = np.linspace(0.0, 20.0, nrefaxpts)
# scale_x should be set to 1 at baseline, unlike the others which perturb about 0
# the following will produce a longer wing root and shorter wing tip
Expand Down
2 changes: 1 addition & 1 deletion examples/deform_geometry/runScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def twist(val, geo):
DVGeo.addGlobalDV(dvName="twist", value=[0] * nRefAxPts, func=twist, lower=-10, upper=10, scale=1.0)

# Get Design Variables
dvDict = DVGeo.getValues()
dvDict = DVGeo.getDesignVars()

# Set First Twist Section to 5deg
dvDict["twist"][0] = 5
Expand Down
2 changes: 1 addition & 1 deletion examples/esp_airfoil/esp_airfoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# rst perturb DV start
# Perturb some local variables and observe the effect on the surface
dvdict = DVGeo.getValues()
dvdict = DVGeo.getDesignVars()
dvdict["camber_dv"] = 0.09
dvdict["maxloc_dv"] = 0.8
dvdict["thickness_dv"] = 0.2
Expand Down
2 changes: 1 addition & 1 deletion examples/ffd_cylinder/runFFDExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
upper_front_idx = DVGeo.getLocalIndex(0)[:, 1, 0]
upper_rear_idx = DVGeo.getLocalIndex(0)[:, 1, 1]

currentDV = DVGeo.getValues()["shape"]
currentDV = DVGeo.getDesignVars()["shape"]
newDV = currentDV.copy()

# add a constant offset (upward) to the lower points, plus a linear ramp and a trigonometric local change
Expand Down
2 changes: 1 addition & 1 deletion paper/Global-FFD-DV-Demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def taper(val, geo):
# Comment out one or the other
DVGeo.addLocalDV("local", lower=-0.5, upper=0.5, axis="y", scale=1)

dvDict = DVGeo.getValues()
dvDict = DVGeo.getDesignVars()
dvDictCopy = copy.deepcopy(dvDict)
dvDictCopy["twist"] = np.linspace(0, 50, nRefAxPts)[1:]
DVGeo.setDesignVars(dvDictCopy)
Expand Down
4 changes: 2 additions & 2 deletions pygeo/mphys/mphys_dvgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def nom_addGeoCompositeDV(

# call the dvgeo object and add this dv
DVGeo.addCompositeDV(dvName, ptSetName=ptSetName, u=u, scale=scale, prependName=False, **kwargs)
val = DVGeo.getValues()
val = DVGeo.getDesignVars()

# define the input
self.add_input(dvName, distributed=False, shape=DVGeo.getNDV(), val=val[dvName][0])
Expand Down Expand Up @@ -1089,7 +1089,7 @@ def compute_jacvec_product(self, inputs, d_inputs, d_outputs, mode):
# Compute the Jacobian vector product
if not global_all_zeros[0]:
if doFwd:
d_outputs[ptSetName] += DVGeo.totalSensitivityProd(seeds, ptSetName)
d_outputs[ptSetName] += DVGeo.totalSensitivityProd(seeds, ptSetName).flatten()
elif doRev:
# TODO totalSensitivityTransProd is broken. does not work with zero surface nodes on a proc
# xdot = DVGeo.totalSensitivityTransProd(dout, ptSetName)
Expand Down
Loading