openmdao/core/total_jac.py
def simul_coloring_jac_setter(self, inds, mode):
        """
        Set the appropriate part of the total jacobian for simul coloring input indices.

        Parameters
        ----------
        inds : list of int
            Total jacobian row or column indices.
        mode : str
            Direction of derivative solution.
        """
        row_col_map = self.simul_coloring[mode][1]
        fwd = mode == 'fwd'

        J = self.J
        deriv_idxs, _ = self.solvec_map[mode]

        # because simul_coloring cannot be used with vectorized derivs (matmat) or parallel
        # deriv coloring, vecname will always be 'linear', and we don't need to check
        # vecname for each index.
        scatter = self.jac_scatters[mode]['linear']

        if scatter is None:
            deriv_val = self.output_vec[mode]['linear']._data
            reduced_derivs = deriv_val[deriv_idxs['linear']]
        else:
            self.jac_petsc[mode].array[:] = 0.
            scatter.scatter(self.soln_petsc[mode]['linear'][0],
                            self.jac_petsc[mode], addv=False, mode=False)
            reduced_derivs = self.jac_petsc[mode].array

        if fwd:
            for i in inds:
                J[row_col_map[i], i] = reduced_derivs[row_col_map[i]]
        else:
            for i in inds:
                J[i, row_col_map[i]] = reduced_derivs[row_col_map[i]]

        Set the appropriate part of the total jacobian for simul coloring input indices.

        Parameters
        ----------
        inds : list of int
            Total jacobian row or column indices.
        mode : str
            Direction of derivative solution.
        
Set the appropriate part of the total jacobian for simul coloring input indices.
Parameters

inds : list of int
Total jacobian row or column indices.
mode : str
Direction of derivative solution.
Set the appropriate part of the total jacobian for simul coloring input indices . Parameters inds : list of int Total jacobian row or column indices . mode : str Direction of derivative solution .
def simul_coloring_jac_setter(self, inds, mode):
        row_col_map = self.simul_coloring[mode][1]
        fwd = mode == 'fwd'
        J = self.J
        deriv_idxs, _ = self.solvec_map[mode]
        scatter = self.jac_scatters[mode]['linear']
        if scatter is None:
            deriv_val = self.output_vec[mode]['linear']._data
            reduced_derivs = deriv_val[deriv_idxs['linear']]
        else:
            self.jac_petsc[mode].array[:] = 0.
            scatter.scatter(self.soln_petsc[mode]['linear'][0],
                            self.jac_petsc[mode], addv=False, mode=False)
            reduced_derivs = self.jac_petsc[mode].array
        if fwd:
            for i in inds:
                J[row_col_map[i], i] = reduced_derivs[row_col_map[i]]
        else:
            for i in inds:
                J[i, row_col_map[i]] = reduced_derivs[row_col_map[i]]
def simul_coloring_jac_setter ( self , inds , mode ) : row_col_map = self . simul_coloring [ mode ] [ 1 ] fwd = mode == 'fwd' J = self . J deriv_idxs , _ = self . solvec_map [ mode ] scatter = self . jac_scatters [ mode ] [ 'linear' ] if scatter is None : deriv_val = self . output_vec [ mode ] [ 'linear' ] . _data reduced_derivs = deriv_val [ deriv_idxs [ 'linear' ] ] else : self . jac_petsc [ mode ] . array [ : ] = 0. scatter . scatter ( self . soln_petsc [ mode ] [ 'linear' ] [ 0 ] , self . jac_petsc [ mode ] , addv = False , mode = False ) reduced_derivs = self . jac_petsc [ mode ] . array if fwd : for i in inds : J [ row_col_map [ i ] , i ] = reduced_derivs [ row_col_map [ i ] ] else : for i in inds : J [ i , row_col_map [ i ] ] = reduced_derivs [ row_col_map [ i ] ]
Set the appropriate part of the total jacobian for simul coloring input indices.
Set the appropriate part of the total jacobian for simul coloring input indices .
"""
        Set the appropriate part of the total jacobian for simul coloring input indices.

        Parameters
        ----------
        inds : list of int
            Total jacobian row or column indices.
        mode : str
            Direction of derivative solution.
        """ # because simul_coloring cannot be used with vectorized derivs (matmat) or parallel # deriv coloring, vecname will always be 'linear', and we don't need to check # vecname for each index.
self
inds
mode