pygeo/parameterization/DVGeo.py
def totalSensitivity(self, dIdpt, ptSetName, comm=None, config=None):
        """
        This function computes sensitivty information.

        Specificly, it computes the following:
        :math:`\\frac{dX_{pt}}{dX_{DV}}^T \\frac{dI}{d_{pt}}`

        Parameters
        ----------
        dIdpt : array of size (Npt, 3) or (N, Npt, 3)

            This is the total derivative of the objective or function
            of interest with respect to the coordinates in
            'ptSetName'. This can be a single array of size (Npt, 3)
            **or** a group of N vectors of size (Npt, 3, N). If you
            have many to do, it is faster to do many at once.

        ptSetName : str
            The name of set of points we are dealing with

        comm : MPI.IntraComm
            The communicator to use to reduce the final derivative. If
            comm is None, no reduction takes place.

        config : str or list
            Define what configurations this design variable will be applied to
            Use a string for a single configuration or a list for multiple
            configurations. The default value of None implies that the design
            variable appies to *ALL* configurations.


        Returns
        -------
        dIdxDict : dic
            The dictionary containing the derivatives, suitable for
            pyOptSparse

        Notes
        -----
        The ``child`` and ``nDVStore`` options are only used
        internally and should not be changed by the user.
        """

        # Make dIdpt at least 3D
        if len(dIdpt.shape) == 2:
            dIdpt = np.array([dIdpt])
        N = dIdpt.shape[0]

        # generate the total Jacobian self.JT
        self.computeTotalJacobian(ptSetName, config=config)

        # now that we have self.JT compute the Mat-Mat multiplication
        nDV = self._getNDV()
        dIdx_local = np.zeros((N, nDV), "d")
        for i in range(N):
            if self.JT[ptSetName] is not None:
                dIdx_local[i, :] = self.JT[ptSetName].dot(dIdpt[i, :, :].flatten())

        if comm:  # If we have a comm, globaly reduce with sum
            dIdx = comm.allreduce(dIdx_local, op=MPI.SUM)
        else:
            dIdx = dIdx_local

        # Now convert to dict:
        dIdx = self.convertSensitivityToDict(dIdx)

        return dIdx

        This function computes sensitivty information.

        Specificly, it computes the following:
        :math:`\\frac{dX_{pt}}{dX_{DV}}^T \\frac{dI}{d_{pt}}`

        Parameters
        ----------
        dIdpt : array of size (Npt, 3) or (N, Npt, 3)

            This is the total derivative of the objective or function
            of interest with respect to the coordinates in
            'ptSetName'. This can be a single array of size (Npt, 3)
            **or** a group of N vectors of size (Npt, 3, N). If you
            have many to do, it is faster to do many at once.

        ptSetName : str
            The name of set of points we are dealing with

        comm : MPI.IntraComm
            The communicator to use to reduce the final derivative. If
            comm is None, no reduction takes place.

        config : str or list
            Define what configurations this design variable will be applied to
            Use a string for a single configuration or a list for multiple
            configurations. The default value of None implies that the design
            variable appies to *ALL* configurations.


        Returns
        -------
        dIdxDict : dic
            The dictionary containing the derivatives, suitable for
            pyOptSparse

        Notes
        -----
        The ``child`` and ``nDVStore`` options are only used
        internally and should not be changed by the user.
        
This function computes sensitivty information.
Specificly, it computes the following.
This function computes sensitivty information . Specificly it computes the following .
def totalSensitivity(self, dIdpt, ptSetName, comm=None, config=None):
        if len(dIdpt.shape) == 2:
            dIdpt = np.array([dIdpt])
        N = dIdpt.shape[0]
        self.computeTotalJacobian(ptSetName, config=config)
        nDV = self._getNDV()
        dIdx_local = np.zeros((N, nDV), "d")
        for i in range(N):
            if self.JT[ptSetName] is not None:
                dIdx_local[i, :] = self.JT[ptSetName].dot(dIdpt[i, :, :].flatten())
        if comm:  
            dIdx = comm.allreduce(dIdx_local, op=MPI.SUM)
        else:
            dIdx = dIdx_local
        dIdx = self.convertSensitivityToDict(dIdx)
        return dIdx
def totalSensitivity ( self , dIdpt , ptSetName , comm = None , config = None ) : if len ( dIdpt . shape ) == 2 : dIdpt = np . array ( [ dIdpt ] ) N = dIdpt . shape [ 0 ] self . computeTotalJacobian ( ptSetName , config = config ) nDV = self . _getNDV ( ) dIdx_local = np . zeros ( ( N , nDV ) , "d" ) for i in range ( N ) : if self . JT [ ptSetName ] is not None : dIdx_local [ i , : ] = self . JT [ ptSetName ] . dot ( dIdpt [ i , : , : ] . flatten ( ) ) if comm : dIdx = comm . allreduce ( dIdx_local , op = MPI . SUM ) else : dIdx = dIdx_local dIdx = self . convertSensitivityToDict ( dIdx ) return dIdx
This function computes sensitivty information.
This function computes sensitivty information .
"""
        This function computes sensitivty information.

        Specificly, it computes the following:
        :math:`\\frac{dX_{pt}}{dX_{DV}}^T \\frac{dI}{d_{pt}}`

        Parameters
        ----------
        dIdpt : array of size (Npt, 3) or (N, Npt, 3)

            This is the total derivative of the objective or function
            of interest with respect to the coordinates in
            'ptSetName'. This can be a single array of size (Npt, 3)
            **or** a group of N vectors of size (Npt, 3, N). If you
            have many to do, it is faster to do many at once.

        ptSetName : str
            The name of set of points we are dealing with

        comm : MPI.IntraComm
            The communicator to use to reduce the final derivative. If
            comm is None, no reduction takes place.

        config : str or list
            Define what configurations this design variable will be applied to
            Use a string for a single configuration or a list for multiple
            configurations. The default value of None implies that the design
            variable appies to *ALL* configurations.


        Returns
        -------
        dIdxDict : dic
            The dictionary containing the derivatives, suitable for
            pyOptSparse

        Notes
        -----
        The ``child`` and ``nDVStore`` options are only used
        internally and should not be changed by the user.
        """ # Make dIdpt at least 3D # generate the total Jacobian self.JT # now that we have self.JT compute the Mat-Mat multiplication # If we have a comm, globaly reduce with sum # Now convert to dict:
self
dIdpt
ptSetName
comm
config
math


dIdpt : array of size (Npt, 3) or (N, Npt, 3)

This is the total derivative of the objective or function
of interest with respect to the coordinates in
'ptSetName'. This can be a single array of size (Npt, 3)
or** a group of N vectors of size (Npt, 3, N). If you
have many to do, it is faster to do many at once.

ptSetName : str
The name of set of points we are dealing with

comm : MPI.IntraComm
The communicator to use to reduce the final derivative. If
comm is None, no reduction takes place.

config : str or list
Define what configurations this design variable will be applied to
Use a string for a single configuration or a list for multiple
configurations. The default value of None implies that the design
variable appies to *ALL* configurations.

Returns

dIdxDict : dic
The dictionary containing the derivatives, suitable for
pyOptSparse

Notes

The ``child`` and ``nDVStore`` options are only used
internally and should not be changed by the user.
dIdpt : array of size ( Npt 3 ) or ( N Npt 3 ) This is the total derivative of the objective or function of interest with respect to the coordinates in ' ptSetName ' . This can be a single array of size ( Npt 3 ) or ** a group of N vectors of size ( Npt 3 N ) . If you have many to do it is faster to do many at once . ptSetName : str The name of set of points we are dealing with comm : MPI . IntraComm The communicator to use to reduce the final derivative . If comm is None no reduction takes place . config : str or list Define what configurations this design variable will be applied to Use a string for a single configuration or a list for multiple configurations . The default value of None implies that the design variable appies to * ALL * configurations . Returns dIdxDict : dic The dictionary containing the derivatives suitable for pyOptSparse Notes The ` ` child ` ` and ` ` nDVStore ` ` options are only used internally and should not be changed by the user .