Skip to content

Commit

Permalink
minor fix to work composite in mphys
Browse files Browse the repository at this point in the history
  • Loading branch information
ArshSaja committed Jan 11, 2023
1 parent 8bff09d commit 081bdac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pygeo/mphys/mphys_dvgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def nom_addGeoCompositeDV(self, dvName, ptSetName=None, u=None, scale=None, **kw
val = self.DVGeo.getValues()

# define the input
self.add_input(dvName, distributed=False, shape=self.DVGeo.getNDV(), val=val[dvName])
self.add_input(dvName, distributed=False, shape=self.DVGeo.getNDV(), val=val[dvName][0])

def nom_addVSPVariable(self, component, group, parm, add_input=True, **kwargs):
# VSP DVs are only added to VSP-based DVGeo objects
Expand Down
6 changes: 3 additions & 3 deletions pygeo/parameterization/BaseDVGeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ def mapXDictToDVGeo(self, inDict):
The mapped DVs in the same dictionary format
"""
# first make a copy so we don't modify in place
inDict = copy.deepcopy(inDict)
userVec = inDict.pop(self.DVComposite.name)
inDictBase = inDict
userVec = inDict[self.DVComposite.name]
outVec = self.mapVecToDVGeo(userVec)
outDict = self.convertSensitivityToDict(outVec.reshape(1, -1), out1D=True, useCompositeNames=False)
# now merge inDict and outDict
for key in inDict:
outDict[key] = inDict[key]
outDict[key] = inDictBase[key]
return outDict

def mapXDictToComp(self, inDict):
Expand Down

0 comments on commit 081bdac

Please sign in to comment.