From 081bdacfc1ac1406768b4e222d54714f0b56a8bc Mon Sep 17 00:00:00 2001 From: arshsaja Date: Wed, 11 Jan 2023 15:58:37 -0500 Subject: [PATCH] minor fix to work composite in mphys --- pygeo/mphys/mphys_dvgeo.py | 2 +- pygeo/parameterization/BaseDVGeo.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pygeo/mphys/mphys_dvgeo.py b/pygeo/mphys/mphys_dvgeo.py index e1f0812d..7cf4c542 100644 --- a/pygeo/mphys/mphys_dvgeo.py +++ b/pygeo/mphys/mphys_dvgeo.py @@ -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 diff --git a/pygeo/parameterization/BaseDVGeo.py b/pygeo/parameterization/BaseDVGeo.py index 50579568..31839850 100644 --- a/pygeo/parameterization/BaseDVGeo.py +++ b/pygeo/parameterization/BaseDVGeo.py @@ -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):