Skip to content

Commit

Permalink
Added surface area constraint function to pyGeo MPhys wrapper (#237)
Browse files Browse the repository at this point in the history
* Added surface area constraint function to DVGeo MPhys wrapper

* Added DVGeoName and compNames arguments

* Made surface area surfaceName consistent with almost all other methods

* Smack the rendition
  • Loading branch information
eytanadler authored Feb 20, 2024
1 parent 7043a74 commit 6f179fb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pygeo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.13.0"
__version__ = "1.13.1"

from .pyNetwork import pyNetwork
from .pyGeo import pyGeo
Expand Down
66 changes: 62 additions & 4 deletions pygeo/mphys/mphys_dvgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,18 @@ def nom_addThicknessConstraints1D(
)
self.add_output(name, distributed=False, val=np.ones(nCon), shape=nCon)

def nom_addVolumeConstraint(self, name, leList, teList, nSpan=10, nChord=10, scaled=True, surfaceName="default"):
def nom_addVolumeConstraint(
self,
name,
leList,
teList,
nSpan=10,
nChord=10,
scaled=True,
surfaceName="default",
DVGeoName="default",
compNames=None,
):
"""
Add a DVCon volume constraint to the problem
Wrapper for :meth:`addVolumeConstraint <.DVConstraints.addVolumeConstraint>`
Expand All @@ -582,14 +593,55 @@ def nom_addVolumeConstraint(self, name, leList, teList, nSpan=10, nChord=10, sca
See wrapped
surfaceName : str, optional
See wrapped
DVGeoName : str, optional
See wrapped
compNames : list, optional
See wrapped
"""

self.DVCon.addVolumeConstraint(
leList, teList, nSpan=nSpan, nChord=nChord, scaled=scaled, name=name, surfaceName=surfaceName
leList,
teList,
nSpan=nSpan,
nChord=nChord,
scaled=scaled,
name=name,
surfaceName=surfaceName,
DVGeoName=DVGeoName,
compNames=compNames,
)
self.add_output(name, distributed=False, val=1.0)

def nom_addProjectedAreaConstraint(self, name, axis, scaled=True, surface_name="default"):
def nom_addSurfaceAreaConstraint(
self, name, scaled=True, surfaceName="default", DVGeoName="default", compNames=None
):
"""
Add a DVCon surface area constraint to the problem
Wrapper for :meth:`addSurfaceAreaConstraint <.DVConstraints.addSurfaceAreaConstraint>`
Input parameters are identical to those in wrapped function unless otherwise specified
Parameters
----------
name :
See wrapped
scaled : bool, optional
See wrapped
surfaceName : str, optional
See wrapped
DVGeoName : str, optional
See wrapped
compNames : list, optional
See wrapped
"""

self.DVCon.addSurfaceAreaConstraint(
name=name, scaled=scaled, surfaceName=surfaceName, DVGeoName=DVGeoName, compNames=compNames
)
self.add_output(name, distributed=False, val=1.0)

def nom_addProjectedAreaConstraint(
self, name, axis, scaled=True, surface_name="default", DVGeoName="default", compNames=None
):
"""
Add a DVCon projected area constraint to the problem
Wrapper for :meth:`addProjectedAreaConstraint <.DVConstraints.addProjectedAreaConstraint>`
Expand All @@ -605,9 +657,15 @@ def nom_addProjectedAreaConstraint(self, name, axis, scaled=True, surface_name="
See wrapped
surface_name : str, optional
See wrapped
DVGeoName : str, optional
See wrapped
compNames : list, optional
See wrapped
"""

self.DVCon.addProjectedAreaConstraint(axis, name=name, scaled=scaled, surfaceName=surface_name)
self.DVCon.addProjectedAreaConstraint(
axis, name=name, scaled=scaled, surfaceName=surface_name, DVGeoName=DVGeoName, compNames=compNames
)
self.add_output(name, distributed=False, val=1.0)

def nom_add_LETEConstraint(self, name, volID, faceID, topID=None, childName=None):
Expand Down

0 comments on commit 6f179fb

Please sign in to comment.