openmdao/core/problem.py
def final_setup(self):
        """
        Perform final setup phase on problem in preparation for run.

        This is the second phase of setup, and is done automatically at the start of `run_driver`
        and `run_model`. At the beginning of final_setup, we have a model hierarchy with defined
        variables, solvers, case_recorders, and derivative settings. During this phase, the vectors
        are created and populated, the drivers and solvers are initialized, and the recorders are
        started, and the rest of the framework is prepared for execution.
        """
        driver = self.driver

        response_size, desvar_size = driver._update_voi_meta(self.model)

        # update mode if it's been set to 'auto'
        if self._orig_mode == 'auto':
            mode = 'rev' if response_size < desvar_size else 'fwd'
            self._mode = mode
        else:
            mode = self._orig_mode

        if self._setup_status < 2:
            self.model._final_setup(self.comm, 'full',
                                    force_alloc_complex=self._force_alloc_complex)

        driver._setup_driver(self)

        coloring_info = driver._simul_coloring_info
        if coloring_info and coloring._use_sparsity:
            # if we're using simultaneous derivatives then our effective size is less
            # than the full size
            if 'fwd' in coloring_info and 'rev' in coloring_info:
                pass  # we're doing both!
            elif mode in coloring_info:
                lists = coloring_info[mode][0]
                if lists:
                    size = len(lists[0])  # lists[0] is the uncolored row/col indices
                    size += len(lists) - 1
                if mode == 'fwd':
                    desvar_size = size
                else:  # rev
                    response_size = size

        if ((mode == 'fwd' and desvar_size > response_size) or
                (mode == 'rev' and response_size > desvar_size)):
            simple_warning("Inefficient choice of derivative mode.  You chose '%s' for a "
                           "problem with %d design variables and %d response variables "
                           "(objectives and nonlinear constraints)." %
                           (mode, desvar_size, response_size), RuntimeWarning)

        # we only want to set up recording once, after problem setup
        if self._setup_status == 1:
            driver._setup_recording()
            self._setup_recording()
            record_viewer_data(self)

        # Now that setup has been called, we can set the iprints.
        for items in self._solver_print_cache:
            self.set_solver_print(level=items[0], depth=items[1], type_=items[2])

        if self._check and self.comm.rank == 0:
            check_config(self, self._logger)

        if self._setup_status < 2:
            self._setup_status = 2
            self._set_initial_conditions()

        # check for post-setup hook
        if Problem._post_setup_func is not None:
            Problem._post_setup_func(self)

        Perform final setup phase on problem in preparation for run.

        This is the second phase of setup, and is done automatically at the start of `run_driver`
        and `run_model`. At the beginning of final_setup, we have a model hierarchy with defined
        variables, solvers, case_recorders, and derivative settings. During this phase, the vectors
        are created and populated, the drivers and solvers are initialized, and the recorders are
        started, and the rest of the framework is prepared for execution.
        
Perform final setup phase on problem in preparation for run.
This is the second phase of setup, and is done automatically at the start of `run_driver`
and `run_model`. At the beginning of final_setup, we have a model hierarchy with defined
variables, solvers, case_recorders, and derivative settings. During this phase, the vectors
are created and populated, the drivers and solvers are initialized, and the recorders are
started, and the rest of the framework is prepared for execution.
Perform final setup phase on problem in preparation for run . This is the second phase of setup and is done automatically at the start of ` run_driver ` and ` run_model ` . At the beginning of final_setup we have a model hierarchy with defined variables solvers case_recorders and derivative settings . During this phase the vectors are created and populated the drivers and solvers are initialized and the recorders are started and the rest of the framework is prepared for execution .
def final_setup(self):
        driver = self.driver
        response_size, desvar_size = driver._update_voi_meta(self.model)
        if self._orig_mode == 'auto':
            mode = 'rev' if response_size < desvar_size else 'fwd'
            self._mode = mode
        else:
            mode = self._orig_mode
        if self._setup_status < 2:
            self.model._final_setup(self.comm, 'full',
                                    force_alloc_complex=self._force_alloc_complex)
        driver._setup_driver(self)
        coloring_info = driver._simul_coloring_info
        if coloring_info and coloring._use_sparsity:
            if 'fwd' in coloring_info and 'rev' in coloring_info:
                pass  
            elif mode in coloring_info:
                lists = coloring_info[mode][0]
                if lists:
                    size = len(lists[0])  
                    size += len(lists) - 1
                if mode == 'fwd':
                    desvar_size = size
                else:  
                    response_size = size
        if ((mode == 'fwd' and desvar_size > response_size) or
                (mode == 'rev' and response_size > desvar_size)):
            simple_warning("Inefficient choice of derivative mode.  You chose '%s' for a "
                           "problem with %d design variables and %d response variables "
                           "(objectives and nonlinear constraints)." %
                           (mode, desvar_size, response_size), RuntimeWarning)
        if self._setup_status == 1:
            driver._setup_recording()
            self._setup_recording()
            record_viewer_data(self)
        for items in self._solver_print_cache:
            self.set_solver_print(level=items[0], depth=items[1], type_=items[2])
        if self._check and self.comm.rank == 0:
            check_config(self, self._logger)
        if self._setup_status < 2:
            self._setup_status = 2
            self._set_initial_conditions()
        if Problem._post_setup_func is not None:
            Problem._post_setup_func(self)
def final_setup ( self ) : driver = self . driver response_size , desvar_size = driver . _update_voi_meta ( self . model ) if self . _orig_mode == 'auto' : mode = 'rev' if response_size < desvar_size else 'fwd' self . _mode = mode else : mode = self . _orig_mode if self . _setup_status < 2 : self . model . _final_setup ( self . comm , 'full' , force_alloc_complex = self . _force_alloc_complex ) driver . _setup_driver ( self ) coloring_info = driver . _simul_coloring_info if coloring_info and coloring . _use_sparsity : if 'fwd' in coloring_info and 'rev' in coloring_info : pass elif mode in coloring_info : lists = coloring_info [ mode ] [ 0 ] if lists : size = len ( lists [ 0 ] ) size += len ( lists ) - 1 if mode == 'fwd' : desvar_size = size else : response_size = size if ( ( mode == 'fwd' and desvar_size > response_size ) or ( mode == 'rev' and response_size > desvar_size ) ) : simple_warning ( "Inefficient choice of derivative mode.  You chose '%s' for a " "problem with %d design variables and %d response variables " "(objectives and nonlinear constraints)." % ( mode , desvar_size , response_size ) , RuntimeWarning ) if self . _setup_status == 1 : driver . _setup_recording ( ) self . _setup_recording ( ) record_viewer_data ( self ) for items in self . _solver_print_cache : self . set_solver_print ( level = items [ 0 ] , depth = items [ 1 ] , type_ = items [ 2 ] ) if self . _check and self . comm . rank == 0 : check_config ( self , self . _logger ) if self . _setup_status < 2 : self . _setup_status = 2 self . _set_initial_conditions ( ) if Problem . _post_setup_func is not None : Problem . _post_setup_func ( self )
Perform final setup phase on problem in preparation for run.
Perform final setup phase on problem in preparation for run .
"""
        Perform final setup phase on problem in preparation for run.

        This is the second phase of setup, and is done automatically at the start of `run_driver`
        and `run_model`. At the beginning of final_setup, we have a model hierarchy with defined
        variables, solvers, case_recorders, and derivative settings. During this phase, the vectors
        are created and populated, the drivers and solvers are initialized, and the recorders are
        started, and the rest of the framework is prepared for execution.
        """ # update mode if it's been set to 'auto' # if we're using simultaneous derivatives then our effective size is less # than the full size # we're doing both! # lists[0] is the uncolored row/col indices # rev # we only want to set up recording once, after problem setup # Now that setup has been called, we can set the iprints. # check for post-setup hook
self