openmdao/core/total_jac.py
def _do_scaling(self, J):
        """
        Apply scalers to the jacobian if the driver defined any.

        Parameters
        ----------
        J : dict
            Jacobian to be scaled.
        """
        # use promoted names for design vars and responses
        desvars = self.prom_design_vars
        responses = self.prom_responses

        if self.return_format in ('dict', 'array'):
            for prom_out, odict in iteritems(J):
                oscaler = responses[prom_out]['scaler']

                for prom_in, val in iteritems(odict):
                    iscaler = desvars[prom_in]['scaler']

                    # Scale response side
                    if oscaler is not None:
                        val[:] = (oscaler * val.T).T

                    # Scale design var side
                    if iscaler is not None:
                        val *= 1.0 / iscaler

        elif self.return_format == 'flat_dict':
            for tup, val in iteritems(J):
                prom_out, prom_in = tup
                oscaler = responses[prom_out]['scaler']
                iscaler = desvars[prom_in]['scaler']

                # Scale response side
                if oscaler is not None:
                    val[:] = (oscaler * val.T).T

                # Scale design var side
                if iscaler is not None:
                    val *= 1.0 / iscaler
        else:
            raise RuntimeError("Derivative scaling by the driver only supports the 'dict' and "
                               "'array' formats at present.")

        Apply scalers to the jacobian if the driver defined any.

        Parameters
        ----------
        J : dict
            Jacobian to be scaled.
        
Apply scalers to the jacobian if the driver defined any.
Parameters

J : dict
Jacobian to be scaled.
Apply scalers to the jacobian if the driver defined any . Parameters J : dict Jacobian to be scaled .
def _do_scaling(self, J):
        desvars = self.prom_design_vars
        responses = self.prom_responses
        if self.return_format in ('dict', 'array'):
            for prom_out, odict in iteritems(J):
                oscaler = responses[prom_out]['scaler']
                for prom_in, val in iteritems(odict):
                    iscaler = desvars[prom_in]['scaler']
                    if oscaler is not None:
                        val[:] = (oscaler * val.T).T
                    if iscaler is not None:
                        val *= 1.0 / iscaler
        elif self.return_format == 'flat_dict':
            for tup, val in iteritems(J):
                prom_out, prom_in = tup
                oscaler = responses[prom_out]['scaler']
                iscaler = desvars[prom_in]['scaler']
                if oscaler is not None:
                    val[:] = (oscaler * val.T).T
                if iscaler is not None:
                    val *= 1.0 / iscaler
        else:
            raise RuntimeError("Derivative scaling by the driver only supports the 'dict' and "
                               "'array' formats at present.")
def _do_scaling ( self , J ) : desvars = self . prom_design_vars responses = self . prom_responses if self . return_format in ( 'dict' , 'array' ) : for prom_out , odict in iteritems ( J ) : oscaler = responses [ prom_out ] [ 'scaler' ] for prom_in , val in iteritems ( odict ) : iscaler = desvars [ prom_in ] [ 'scaler' ] if oscaler is not None : val [ : ] = ( oscaler * val . T ) . T if iscaler is not None : val *= 1.0 / iscaler elif self . return_format == 'flat_dict' : for tup , val in iteritems ( J ) : prom_out , prom_in = tup oscaler = responses [ prom_out ] [ 'scaler' ] iscaler = desvars [ prom_in ] [ 'scaler' ] if oscaler is not None : val [ : ] = ( oscaler * val . T ) . T if iscaler is not None : val *= 1.0 / iscaler else : raise RuntimeError ( "Derivative scaling by the driver only supports the 'dict' and " "'array' formats at present." )
Apply scalers to the jacobian if the driver defined any.
Apply scalers to the jacobian if the driver defined any .
"""
        Apply scalers to the jacobian if the driver defined any.

        Parameters
        ----------
        J : dict
            Jacobian to be scaled.
        """ # use promoted names for design vars and responses # Scale response side # Scale design var side # Scale response side # Scale design var side
self
J