openmdao/jacobians/assembled_jacobian.py
def _init_view(self, system):
        """
        Determine the _ext_mtx for a sub-view of the assembled jacobian.

        Parameters
        ----------
        system : <System>
            The system being solved using a sub-view of the jacobian.
        """
        abs2meta = system._var_abs2meta
        in_ranges = self._in_ranges
        out_ranges = self._out_ranges

        input_names = system._var_abs_names['input']
        if input_names:
            min_in_offset = in_ranges[input_names[0]][0]
            max_in_offset = in_ranges[input_names[-1]][1]
        else:
            min_in_offset = sys.maxsize
            max_in_offset = 0

        output_names = system._var_abs_names['output']
        if output_names:
            min_res_offset = out_ranges[output_names[0]][0]
            max_res_offset = out_ranges[output_names[-1]][1]
        else:
            min_res_offset = sys.maxsize
            max_res_offset = 0

        ranges = self._view_ranges[system.pathname] = (
            min_res_offset, max_res_offset, min_in_offset, max_in_offset)

        ext_mtx = self._matrix_class(system.comm)
        conns = {} if isinstance(system, Component) else system._conn_global_abs_in2out

        iproc = system.comm.rank
        sizes = system._var_sizes['nonlinear']['input']
        abs2idx = system._var_allprocs_abs2idx['nonlinear']
        in_offset = {n: np.sum(sizes[iproc, :abs2idx[n]]) for n in
                     system._var_abs_names['input'] if n not in conns}

        subjacs_info = self._subjacs_info

        sizes = system._var_sizes['nonlinear']['output']
        for s in system.system_iter(recurse=True, include_self=True, typ=Component):
            for res_abs_name in s._var_abs_names['output']:
                res_offset = np.sum(sizes[iproc, :abs2idx[res_abs_name]])
                res_size = abs2meta[res_abs_name]['size']

                for in_abs_name in s._var_abs_names['input']:
                    if in_abs_name not in conns:
                        abs_key = (res_abs_name, in_abs_name)

                        if abs_key not in subjacs_info:
                            continue

                        info = subjacs_info[abs_key]
                        ext_mtx._add_submat(abs_key, info, res_offset - ranges[0],
                                            in_offset[in_abs_name] - ranges[2], None, info['shape'])

        if ext_mtx._submats:
            sizes = system._var_sizes
            iproc = system.comm.rank
            out_size = np.sum(sizes['nonlinear']['output'][iproc, :])
            in_size = np.sum(sizes['nonlinear']['input'][iproc, :])
            ext_mtx._build(out_size, in_size, in_ranges, out_ranges)
        else:
            ext_mtx = None

        self._ext_mtx[system.pathname] = ext_mtx

        Determine the _ext_mtx for a sub-view of the assembled jacobian.

        Parameters
        ----------
        system : <System>
            The system being solved using a sub-view of the jacobian.
        
Determine the _ext_mtx for a sub-view of the assembled jacobian.
Parameters

system : 
The system being solved using a sub-view of the jacobian.
Determine the _ext_mtx for a sub - view of the assembled jacobian . Parameters system : The system being solved using a sub - view of the jacobian .
def _init_view(self, system):
        abs2meta = system._var_abs2meta
        in_ranges = self._in_ranges
        out_ranges = self._out_ranges
        input_names = system._var_abs_names['input']
        if input_names:
            min_in_offset = in_ranges[input_names[0]][0]
            max_in_offset = in_ranges[input_names[-1]][1]
        else:
            min_in_offset = sys.maxsize
            max_in_offset = 0
        output_names = system._var_abs_names['output']
        if output_names:
            min_res_offset = out_ranges[output_names[0]][0]
            max_res_offset = out_ranges[output_names[-1]][1]
        else:
            min_res_offset = sys.maxsize
            max_res_offset = 0
        ranges = self._view_ranges[system.pathname] = (
            min_res_offset, max_res_offset, min_in_offset, max_in_offset)
        ext_mtx = self._matrix_class(system.comm)
        conns = {} if isinstance(system, Component) else system._conn_global_abs_in2out
        iproc = system.comm.rank
        sizes = system._var_sizes['nonlinear']['input']
        abs2idx = system._var_allprocs_abs2idx['nonlinear']
        in_offset = {n: np.sum(sizes[iproc, :abs2idx[n]]) for n in
                     system._var_abs_names['input'] if n not in conns}
        subjacs_info = self._subjacs_info
        sizes = system._var_sizes['nonlinear']['output']
        for s in system.system_iter(recurse=True, include_self=True, typ=Component):
            for res_abs_name in s._var_abs_names['output']:
                res_offset = np.sum(sizes[iproc, :abs2idx[res_abs_name]])
                res_size = abs2meta[res_abs_name]['size']
                for in_abs_name in s._var_abs_names['input']:
                    if in_abs_name not in conns:
                        abs_key = (res_abs_name, in_abs_name)
                        if abs_key not in subjacs_info:
                            continue
                        info = subjacs_info[abs_key]
                        ext_mtx._add_submat(abs_key, info, res_offset - ranges[0],
                                            in_offset[in_abs_name] - ranges[2], None, info['shape'])
        if ext_mtx._submats:
            sizes = system._var_sizes
            iproc = system.comm.rank
            out_size = np.sum(sizes['nonlinear']['output'][iproc, :])
            in_size = np.sum(sizes['nonlinear']['input'][iproc, :])
            ext_mtx._build(out_size, in_size, in_ranges, out_ranges)
        else:
            ext_mtx = None
        self._ext_mtx[system.pathname] = ext_mtx
def _init_view ( self , system ) : abs2meta = system . _var_abs2meta in_ranges = self . _in_ranges out_ranges = self . _out_ranges input_names = system . _var_abs_names [ 'input' ] if input_names : min_in_offset = in_ranges [ input_names [ 0 ] ] [ 0 ] max_in_offset = in_ranges [ input_names [ - 1 ] ] [ 1 ] else : min_in_offset = sys . maxsize max_in_offset = 0 output_names = system . _var_abs_names [ 'output' ] if output_names : min_res_offset = out_ranges [ output_names [ 0 ] ] [ 0 ] max_res_offset = out_ranges [ output_names [ - 1 ] ] [ 1 ] else : min_res_offset = sys . maxsize max_res_offset = 0 ranges = self . _view_ranges [ system . pathname ] = ( min_res_offset , max_res_offset , min_in_offset , max_in_offset ) ext_mtx = self . _matrix_class ( system . comm ) conns = { } if isinstance ( system , Component ) else system . _conn_global_abs_in2out iproc = system . comm . rank sizes = system . _var_sizes [ 'nonlinear' ] [ 'input' ] abs2idx = system . _var_allprocs_abs2idx [ 'nonlinear' ] in_offset = { n : np . sum ( sizes [ iproc , : abs2idx [ n ] ] ) for n in system . _var_abs_names [ 'input' ] if n not in conns } subjacs_info = self . _subjacs_info sizes = system . _var_sizes [ 'nonlinear' ] [ 'output' ] for s in system . system_iter ( recurse = True , include_self = True , typ = Component ) : for res_abs_name in s . _var_abs_names [ 'output' ] : res_offset = np . sum ( sizes [ iproc , : abs2idx [ res_abs_name ] ] ) res_size = abs2meta [ res_abs_name ] [ 'size' ] for in_abs_name in s . _var_abs_names [ 'input' ] : if in_abs_name not in conns : abs_key = ( res_abs_name , in_abs_name ) if abs_key not in subjacs_info : continue info = subjacs_info [ abs_key ] ext_mtx . _add_submat ( abs_key , info , res_offset - ranges [ 0 ] , in_offset [ in_abs_name ] - ranges [ 2 ] , None , info [ 'shape' ] ) if ext_mtx . _submats : sizes = system . _var_sizes iproc = system . comm . rank out_size = np . sum ( sizes [ 'nonlinear' ] [ 'output' ] [ iproc , : ] ) in_size = np . sum ( sizes [ 'nonlinear' ] [ 'input' ] [ iproc , : ] ) ext_mtx . _build ( out_size , in_size , in_ranges , out_ranges ) else : ext_mtx = None self . _ext_mtx [ system . pathname ] = ext_mtx
Determine the _ext_mtx for a sub-view of the assembled jacobian.
Determine the _ext_mtx for a sub - view of the assembled jacobian .
"""
        Determine the _ext_mtx for a sub-view of the assembled jacobian.

        Parameters
        ----------
        system : <System>
            The system being solved using a sub-view of the jacobian.
        """
self
system