pygeo/parameterization/DVGeo.py
def computeTotalJacobianCS(self, ptSetName, config=None):
        """Return the total point jacobian in CSR format since we
        need this for TACS"""

        self._finalize()
        self.curPtSet = ptSetName

        if not (self.JT[ptSetName] is None):
            return

        if self.isChild:
            refFFDCoef = copy.copy(self.FFD.coef)
            refCoef = copy.copy(self.coef)

        if self.nPts[ptSetName] is None:
            self.nPts[ptSetName] = len(self.update(ptSetName).flatten())
        for child in self.children:
            child.nPts[ptSetName] = self.nPts[ptSetName]

        DVGlobalCount, DVLocalCount, DVSecLocCount, DVSpanLocCount = self._getDVOffsets()

        h = 1e-40j

        self.JT[ptSetName] = np.zeros([self.nDV_T, self.nPts[ptSetName]])
        self._complexifyCoef()
        for key in self.DV_listGlobal:
            for j in range(self.DV_listGlobal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()

                refVal = self.DV_listGlobal[key].value[j]

                self.DV_listGlobal[key].value[j] += h

                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)

                self.JT[ptSetName][DVGlobalCount, :] = deriv

                DVGlobalCount += 1
                self.DV_listGlobal[key].value[j] = refVal

        self._unComplexifyCoef()
        for key in self.DV_listSpanwiseLocal:
            for j in range(self.DV_listSpanwiseLocal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()

                refVal = self.DV_listSpanwiseLocal[key].value[j]

                self.DV_listSpanwiseLocal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)

                self.JT[ptSetName][DVSpanLocCount, :] = deriv

                DVSpanLocCount += 1
                self.DV_listSpanwiseLocal[key].value[j] = refVal

        for key in self.DV_listSectionLocal:
            for j in range(self.DV_listSectionLocal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()

                refVal = self.DV_listSectionLocal[key].value[j]

                self.DV_listSectionLocal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)

                self.JT[ptSetName][DVSecLocCount, :] = deriv

                DVSecLocCount += 1
                self.DV_listSectionLocal[key].value[j] = refVal

        for key in self.DV_listLocal:
            for j in range(self.DV_listLocal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()

                refVal = self.DV_listLocal[key].value[j]

                self.DV_listLocal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)

                self.JT[ptSetName][DVLocalCount, :] = deriv

                DVLocalCount += 1
                self.DV_listLocal[key].value[j] = refVal

        for iChild in range(len(self.children)):
            child = self.children[iChild]
            child._finalize()

            # In the updates applied previously, the FFD points on the children
            # will have been set as deltas. We need to set them as absolute
            # coordinates based on the changes in the parent before moving down
            # to the next level
            self.applyToChild(iChild)

            # Now get jacobian from child and add to parent jacobian
            child.computeTotalJacobianCS(ptSetName, config=config)
            self.JT[ptSetName] = self.JT[ptSetName] + child.JT[ptSetName]

        return
Return the total point jacobian in CSR format since we
        need this for TACS
Return the total point jacobian in CSR format since we
need this for TACS
Return the total point jacobian in CSR format since we need this for TACS
def computeTotalJacobianCS(self, ptSetName, config=None):
        self._finalize()
        self.curPtSet = ptSetName
        if not (self.JT[ptSetName] is None):
            return
        if self.isChild:
            refFFDCoef = copy.copy(self.FFD.coef)
            refCoef = copy.copy(self.coef)
        if self.nPts[ptSetName] is None:
            self.nPts[ptSetName] = len(self.update(ptSetName).flatten())
        for child in self.children:
            child.nPts[ptSetName] = self.nPts[ptSetName]
        DVGlobalCount, DVLocalCount, DVSecLocCount, DVSpanLocCount = self._getDVOffsets()
        h = 1e-40j
        self.JT[ptSetName] = np.zeros([self.nDV_T, self.nPts[ptSetName]])
        self._complexifyCoef()
        for key in self.DV_listGlobal:
            for j in range(self.DV_listGlobal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()
                refVal = self.DV_listGlobal[key].value[j]
                self.DV_listGlobal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)
                self.JT[ptSetName][DVGlobalCount, :] = deriv
                DVGlobalCount += 1
                self.DV_listGlobal[key].value[j] = refVal
        self._unComplexifyCoef()
        for key in self.DV_listSpanwiseLocal:
            for j in range(self.DV_listSpanwiseLocal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()
                refVal = self.DV_listSpanwiseLocal[key].value[j]
                self.DV_listSpanwiseLocal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)
                self.JT[ptSetName][DVSpanLocCount, :] = deriv
                DVSpanLocCount += 1
                self.DV_listSpanwiseLocal[key].value[j] = refVal
        for key in self.DV_listSectionLocal:
            for j in range(self.DV_listSectionLocal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()
                refVal = self.DV_listSectionLocal[key].value[j]
                self.DV_listSectionLocal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)
                self.JT[ptSetName][DVSecLocCount, :] = deriv
                DVSecLocCount += 1
                self.DV_listSectionLocal[key].value[j] = refVal
        for key in self.DV_listLocal:
            for j in range(self.DV_listLocal[key].nVal):
                if self.isChild:
                    self.FFD.coef = refFFDCoef.copy()
                    self.coef = refCoef.copy()
                    self.refAxis.coef = refCoef.copy()
                    self.refAxis._updateCurveCoef()
                refVal = self.DV_listLocal[key].value[j]
                self.DV_listLocal[key].value[j] += h
                deriv = np.imag(self._update_deriv_cs(ptSetName, config=config).flatten()) / np.imag(h)
                self.JT[ptSetName][DVLocalCount, :] = deriv
                DVLocalCount += 1
                self.DV_listLocal[key].value[j] = refVal
        for iChild in range(len(self.children)):
            child = self.children[iChild]
            child._finalize()
            self.applyToChild(iChild)
            child.computeTotalJacobianCS(ptSetName, config=config)
            self.JT[ptSetName] = self.JT[ptSetName] + child.JT[ptSetName]
        return
def computeTotalJacobianCS ( self , ptSetName , config = None ) : self . _finalize ( ) self . curPtSet = ptSetName if not ( self . JT [ ptSetName ] is None ) : return if self . isChild : refFFDCoef = copy . copy ( self . FFD . coef ) refCoef = copy . copy ( self . coef ) if self . nPts [ ptSetName ] is None : self . nPts [ ptSetName ] = len ( self . update ( ptSetName ) . flatten ( ) ) for child in self . children : child . nPts [ ptSetName ] = self . nPts [ ptSetName ] DVGlobalCount , DVLocalCount , DVSecLocCount , DVSpanLocCount = self . _getDVOffsets ( ) h = 1e-40j self . JT [ ptSetName ] = np . zeros ( [ self . nDV_T , self . nPts [ ptSetName ] ] ) self . _complexifyCoef ( ) for key in self . DV_listGlobal : for j in range ( self . DV_listGlobal [ key ] . nVal ) : if self . isChild : self . FFD . coef = refFFDCoef . copy ( ) self . coef = refCoef . copy ( ) self . refAxis . coef = refCoef . copy ( ) self . refAxis . _updateCurveCoef ( ) refVal = self . DV_listGlobal [ key ] . value [ j ] self . DV_listGlobal [ key ] . value [ j ] += h deriv = np . imag ( self . _update_deriv_cs ( ptSetName , config = config ) . flatten ( ) ) / np . imag ( h ) self . JT [ ptSetName ] [ DVGlobalCount , : ] = deriv DVGlobalCount += 1 self . DV_listGlobal [ key ] . value [ j ] = refVal self . _unComplexifyCoef ( ) for key in self . DV_listSpanwiseLocal : for j in range ( self . DV_listSpanwiseLocal [ key ] . nVal ) : if self . isChild : self . FFD . coef = refFFDCoef . copy ( ) self . coef = refCoef . copy ( ) self . refAxis . coef = refCoef . copy ( ) self . refAxis . _updateCurveCoef ( ) refVal = self . DV_listSpanwiseLocal [ key ] . value [ j ] self . DV_listSpanwiseLocal [ key ] . value [ j ] += h deriv = np . imag ( self . _update_deriv_cs ( ptSetName , config = config ) . flatten ( ) ) / np . imag ( h ) self . JT [ ptSetName ] [ DVSpanLocCount , : ] = deriv DVSpanLocCount += 1 self . DV_listSpanwiseLocal [ key ] . value [ j ] = refVal for key in self . DV_listSectionLocal : for j in range ( self . DV_listSectionLocal [ key ] . nVal ) : if self . isChild : self . FFD . coef = refFFDCoef . copy ( ) self . coef = refCoef . copy ( ) self . refAxis . coef = refCoef . copy ( ) self . refAxis . _updateCurveCoef ( ) refVal = self . DV_listSectionLocal [ key ] . value [ j ] self . DV_listSectionLocal [ key ] . value [ j ] += h deriv = np . imag ( self . _update_deriv_cs ( ptSetName , config = config ) . flatten ( ) ) / np . imag ( h ) self . JT [ ptSetName ] [ DVSecLocCount , : ] = deriv DVSecLocCount += 1 self . DV_listSectionLocal [ key ] . value [ j ] = refVal for key in self . DV_listLocal : for j in range ( self . DV_listLocal [ key ] . nVal ) : if self . isChild : self . FFD . coef = refFFDCoef . copy ( ) self . coef = refCoef . copy ( ) self . refAxis . coef = refCoef . copy ( ) self . refAxis . _updateCurveCoef ( ) refVal = self . DV_listLocal [ key ] . value [ j ] self . DV_listLocal [ key ] . value [ j ] += h deriv = np . imag ( self . _update_deriv_cs ( ptSetName , config = config ) . flatten ( ) ) / np . imag ( h ) self . JT [ ptSetName ] [ DVLocalCount , : ] = deriv DVLocalCount += 1 self . DV_listLocal [ key ] . value [ j ] = refVal for iChild in range ( len ( self . children ) ) : child = self . children [ iChild ] child . _finalize ( ) self . applyToChild ( iChild ) child . computeTotalJacobianCS ( ptSetName , config = config ) self . JT [ ptSetName ] = self . JT [ ptSetName ] + child . JT [ ptSetName ] return
Return the total point jacobian in CSR format since we
need this for TACS
Return the total point jacobian in CSR format since we need this for TACS
"""Return the total point jacobian in CSR format since we
        need this for TACS""" # In the updates applied previously, the FFD points on the children # will have been set as deltas. We need to set them as absolute # coordinates based on the changes in the parent before moving down # to the next level # Now get jacobian from child and add to parent jacobian
self
ptSetName
config