openmdao/core/total_jac.py
def par_deriv_matmat_input_setter(self, inds, imeta, mode):
        """
        Set -1's into the input vector in the matrix matrix with parallel deriv case.

        Parameters
        ----------
        inds : list of ndarray of int
            Total jacobian row or column indices.
        imeta : dict
            Dictionary of iteration metadata.
        mode : str
            Direction of derivative solution.

        Returns
        -------
        set
            Set of relevant system names.
        list of str or None
            vec_names or None if linear solve caching is inactive.
        int or None
            key used for storage of cached linear solve (if active, else None).
        """
        input_vec = self.input_vec[mode]
        in_idx_map = self.in_idx_map[mode]
        in_loc_idxs = self.in_loc_idxs[mode]

        all_rel_systems = set()
        cache = False

        vec_names = set()
        for matmat_idxs in inds:
            vec_name, rel_systems, cache_lin_sol = in_idx_map[matmat_idxs[0]]
            if cache_lin_sol:
                vec_names.add(vec_name)
            cache |= cache_lin_sol
            _update_rel_systems(all_rel_systems, rel_systems)

            self._zero_vecs(vec_name, mode)

            dinputs = input_vec[vec_name]
            ncol = dinputs._ncol

            for col, i in enumerate(matmat_idxs):
                loc_idx = in_loc_idxs[i]
                if loc_idx != -1:

                    # We apply a -1 here because the derivative of the output is minus the
                    # derivative of the residual in openmdao.
                    if ncol > 1:
                        dinputs._data[loc_idx, col] = -1.0
                    else:
                        dinputs._data[loc_idx] = -1.0

        if cache:
            return all_rel_systems, sorted(vec_names), (inds[0][0], mode)
        else:
            return all_rel_systems, None, None

        Set -1's into the input vector in the matrix matrix with parallel deriv case.

        Parameters
        ----------
        inds : list of ndarray of int
            Total jacobian row or column indices.
        imeta : dict
            Dictionary of iteration metadata.
        mode : str
            Direction of derivative solution.

        Returns
        -------
        set
            Set of relevant system names.
        list of str or None
            vec_names or None if linear solve caching is inactive.
        int or None
            key used for storage of cached linear solve (if active, else None).
        
1's into the input vector in the matrix matrix with parallel deriv case.
Parameters

inds : list of ndarray of int
Total jacobian row or column indices.
imeta : dict
Dictionary of iteration metadata.
mode : str
Direction of derivative solution.

Returns

set
Set of relevant system names.
list of str or None
vec_names or None if linear solve caching is inactive.
int or None
key used for storage of cached linear solve (if active, else None).
1 ' s into the input vector in the matrix matrix with parallel deriv case . Parameters inds : list of ndarray of int Total jacobian row or column indices . imeta : dict Dictionary of iteration metadata . mode : str Direction of derivative solution . Returns set Set of relevant system names . list of str or None vec_names or None if linear solve caching is inactive . int or None key used for storage of cached linear solve ( if active else None ) .
def par_deriv_matmat_input_setter(self, inds, imeta, mode):
        input_vec = self.input_vec[mode]
        in_idx_map = self.in_idx_map[mode]
        in_loc_idxs = self.in_loc_idxs[mode]
        all_rel_systems = set()
        cache = False
        vec_names = set()
        for matmat_idxs in inds:
            vec_name, rel_systems, cache_lin_sol = in_idx_map[matmat_idxs[0]]
            if cache_lin_sol:
                vec_names.add(vec_name)
            cache |= cache_lin_sol
            _update_rel_systems(all_rel_systems, rel_systems)
            self._zero_vecs(vec_name, mode)
            dinputs = input_vec[vec_name]
            ncol = dinputs._ncol
            for col, i in enumerate(matmat_idxs):
                loc_idx = in_loc_idxs[i]
                if loc_idx != -1:
                    if ncol > 1:
                        dinputs._data[loc_idx, col] = -1.0
                    else:
                        dinputs._data[loc_idx] = -1.0
        if cache:
            return all_rel_systems, sorted(vec_names), (inds[0][0], mode)
        else:
            return all_rel_systems, None, None
def par_deriv_matmat_input_setter ( self , inds , imeta , mode ) : input_vec = self . input_vec [ mode ] in_idx_map = self . in_idx_map [ mode ] in_loc_idxs = self . in_loc_idxs [ mode ] all_rel_systems = set ( ) cache = False vec_names = set ( ) for matmat_idxs in inds : vec_name , rel_systems , cache_lin_sol = in_idx_map [ matmat_idxs [ 0 ] ] if cache_lin_sol : vec_names . add ( vec_name ) cache |= cache_lin_sol _update_rel_systems ( all_rel_systems , rel_systems ) self . _zero_vecs ( vec_name , mode ) dinputs = input_vec [ vec_name ] ncol = dinputs . _ncol for col , i in enumerate ( matmat_idxs ) : loc_idx = in_loc_idxs [ i ] if loc_idx != - 1 : if ncol > 1 : dinputs . _data [ loc_idx , col ] = - 1.0 else : dinputs . _data [ loc_idx ] = - 1.0 if cache : return all_rel_systems , sorted ( vec_names ) , ( inds [ 0 ] [ 0 ] , mode ) else : return all_rel_systems , None , None
Set -1's into the input vector in the matrix matrix with parallel deriv case.
Set - 1 ' s into the input vector in the matrix matrix with parallel deriv case .
"""
        Set -1's into the input vector in the matrix matrix with parallel deriv case.

        Parameters
        ----------
        inds : list of ndarray of int
            Total jacobian row or column indices.
        imeta : dict
            Dictionary of iteration metadata.
        mode : str
            Direction of derivative solution.

        Returns
        -------
        set
            Set of relevant system names.
        list of str or None
            vec_names or None if linear solve caching is inactive.
        int or None
            key used for storage of cached linear solve (if active, else None).
        """ # We apply a -1 here because the derivative of the output is minus the # derivative of the residual in openmdao.
self
inds
imeta
mode