pygeo/parameterization/DVGeo.py
def _attachedPtJacobian(self, config):
        """
        Compute the derivative of the the attached points
        """
        nDV = self._getNDVGlobalSelf()

        self._getDVOffsets()

        h = 1.0e-40j
        oneoverh = 1.0 / 1e-40
        # Just do a CS loop over the coef
        # First sum the actual number of globalDVs
        if nDV != 0:  # check this
            # create a jacobian the size of nPtAttached full by self.nDV_T, the total number of
            # dvs
            Jacobian = np.zeros((self.nPtAttachFull * 3, self.nDV_T))

            # Create the storage arrays for the information that must be
            # passed to the children
            for iChild in range(len(self.children)):
                N = self.FFD.embededVolumes["child%d_axis" % (iChild)].N
                # Derivative of reference axis points wrt global DVs at this level
                self.children[iChild].dXrefdXdvg = np.zeros((N * 3, self.nDV_T))

                N = self.FFD.embededVolumes["child%d_coef" % (iChild)].N
                # derivative of the control points wrt the global DVs at this level
                self.children[iChild].dCcdXdvg = np.zeros((N * 3, self.nDV_T))

            # We need to save the reference state so that we can always start
            # from the same place when calling _update_deriv
            refFFDCoef = copy.copy(self.FFD.coef)
            refCoef = copy.copy(self.coef)

            iDV = self.nDVG_count
            for key in self.DV_listGlobal:
                if (
                    self.DV_listGlobal[key].config is None
                    or config is None
                    or any(c0 == config for c0 in self.DV_listGlobal[key].config)
                ):
                    nVal = self.DV_listGlobal[key].nVal
                    for j in range(nVal):

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

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

                        # Reset coefficients
                        self.FFD.coef = refFFDCoef.astype("D")  # ffd coefficients
                        self.coef = refCoef.astype("D")
                        self.refAxis.coef = refCoef.astype("D")
                        self._complexifyCoef()  # Make sure coefficients are complex
                        self.refAxis._updateCurveCoef()

                        deriv = oneoverh * np.imag(self._update_deriv(iDV, h, oneoverh, config=config)).flatten()
                        # reset the FFD and axis
                        self._unComplexifyCoef()
                        self.FFD.coef = self.FFD.coef.real.astype("d")

                        np.put(Jacobian[0::3, iDV], self.ptAttachInd, deriv[0::3])
                        np.put(Jacobian[1::3, iDV], self.ptAttachInd, deriv[1::3])
                        np.put(Jacobian[2::3, iDV], self.ptAttachInd, deriv[2::3])

                        iDV += 1

                        self.DV_listGlobal[key].value[j] = refVal
                else:
                    iDV += self.DV_listGlobal[key].nVal
        else:
            Jacobian = None

        return Jacobian

        Compute the derivative of the the attached points
        
Compute the derivative of the the attached points
Compute the derivative of the the attached points
def _attachedPtJacobian(self, config):
        nDV = self._getNDVGlobalSelf()
        self._getDVOffsets()
        h = 1.0e-40j
        oneoverh = 1.0 / 1e-40
        if nDV != 0:  
            Jacobian = np.zeros((self.nPtAttachFull * 3, self.nDV_T))
            for iChild in range(len(self.children)):
                N = self.FFD.embededVolumes["child%d_axis" % (iChild)].N
                self.children[iChild].dXrefdXdvg = np.zeros((N * 3, self.nDV_T))
                N = self.FFD.embededVolumes["child%d_coef" % (iChild)].N
                self.children[iChild].dCcdXdvg = np.zeros((N * 3, self.nDV_T))
            refFFDCoef = copy.copy(self.FFD.coef)
            refCoef = copy.copy(self.coef)
            iDV = self.nDVG_count
            for key in self.DV_listGlobal:
                if (
                    self.DV_listGlobal[key].config is None
                    or config is None
                    or any(c0 == config for c0 in self.DV_listGlobal[key].config)
                ):
                    nVal = self.DV_listGlobal[key].nVal
                    for j in range(nVal):
                        refVal = self.DV_listGlobal[key].value[j]
                        self.DV_listGlobal[key].value[j] += h
                        self.FFD.coef = refFFDCoef.astype("D")  
                        self.coef = refCoef.astype("D")
                        self.refAxis.coef = refCoef.astype("D")
                        self._complexifyCoef()  
                        self.refAxis._updateCurveCoef()
                        deriv = oneoverh * np.imag(self._update_deriv(iDV, h, oneoverh, config=config)).flatten()
                        self._unComplexifyCoef()
                        self.FFD.coef = self.FFD.coef.real.astype("d")
                        np.put(Jacobian[0::3, iDV], self.ptAttachInd, deriv[0::3])
                        np.put(Jacobian[1::3, iDV], self.ptAttachInd, deriv[1::3])
                        np.put(Jacobian[2::3, iDV], self.ptAttachInd, deriv[2::3])
                        iDV += 1
                        self.DV_listGlobal[key].value[j] = refVal
                else:
                    iDV += self.DV_listGlobal[key].nVal
        else:
            Jacobian = None
        return Jacobian
def _attachedPtJacobian ( self , config ) : nDV = self . _getNDVGlobalSelf ( ) self . _getDVOffsets ( ) h = 1.0e-40j oneoverh = 1.0 / 1e-40 if nDV != 0 : Jacobian = np . zeros ( ( self . nPtAttachFull * 3 , self . nDV_T ) ) for iChild in range ( len ( self . children ) ) : N = self . FFD . embededVolumes [ "child%d_axis" % ( iChild ) ] . N self . children [ iChild ] . dXrefdXdvg = np . zeros ( ( N * 3 , self . nDV_T ) ) N = self . FFD . embededVolumes [ "child%d_coef" % ( iChild ) ] . N self . children [ iChild ] . dCcdXdvg = np . zeros ( ( N * 3 , self . nDV_T ) ) refFFDCoef = copy . copy ( self . FFD . coef ) refCoef = copy . copy ( self . coef ) iDV = self . nDVG_count for key in self . DV_listGlobal : if ( self . DV_listGlobal [ key ] . config is None or config is None or any ( c0 == config for c0 in self . DV_listGlobal [ key ] . config ) ) : nVal = self . DV_listGlobal [ key ] . nVal for j in range ( nVal ) : refVal = self . DV_listGlobal [ key ] . value [ j ] self . DV_listGlobal [ key ] . value [ j ] += h self . FFD . coef = refFFDCoef . astype ( "D" ) self . coef = refCoef . astype ( "D" ) self . refAxis . coef = refCoef . astype ( "D" ) self . _complexifyCoef ( ) self . refAxis . _updateCurveCoef ( ) deriv = oneoverh * np . imag ( self . _update_deriv ( iDV , h , oneoverh , config = config ) ) . flatten ( ) self . _unComplexifyCoef ( ) self . FFD . coef = self . FFD . coef . real . astype ( "d" ) np . put ( Jacobian [ 0 : : 3 , iDV ] , self . ptAttachInd , deriv [ 0 : : 3 ] ) np . put ( Jacobian [ 1 : : 3 , iDV ] , self . ptAttachInd , deriv [ 1 : : 3 ] ) np . put ( Jacobian [ 2 : : 3 , iDV ] , self . ptAttachInd , deriv [ 2 : : 3 ] ) iDV += 1 self . DV_listGlobal [ key ] . value [ j ] = refVal else : iDV += self . DV_listGlobal [ key ] . nVal else : Jacobian = None return Jacobian
Compute the derivative of the the attached points
Compute the derivative of the the attached points
"""
        Compute the derivative of the the attached points
        """ # Just do a CS loop over the coef # First sum the actual number of globalDVs # check this # create a jacobian the size of nPtAttached full by self.nDV_T, the total number of # dvs # Create the storage arrays for the information that must be # passed to the children # Derivative of reference axis points wrt global DVs at this level # derivative of the control points wrt the global DVs at this level # We need to save the reference state so that we can always start # from the same place when calling _update_deriv # Reset coefficients # ffd coefficients # Make sure coefficients are complex # reset the FFD and axis
self
config