openmdao/solvers/linesearch/backtracking.py
def _iter_initialize(self):
        """
        Perform any necessary pre-processing operations.

        Returns
        -------
        float
            initial error.
        float
            error at the first iteration.
        """
        system = self._system
        self.alpha = self.options['alpha']

        u = system._outputs
        du = system._vectors['output']['linear']
        self.alpha = 1.

        self._run_apply()
        norm0 = self._iter_get_norm()
        if norm0 == 0.0:
            norm0 = 1.0

        u.add_scal_vec(self.alpha, du)

        if self.options['print_bound_enforce']:
            _print_violations(u, system._lower_bounds, system._upper_bounds)

        if self.options['bound_enforcement'] == 'vector':
            u._enforce_bounds_vector(du, self.alpha, system._lower_bounds, system._upper_bounds)
        elif self.options['bound_enforcement'] == 'scalar':
            u._enforce_bounds_scalar(du, self.alpha, system._lower_bounds, system._upper_bounds)
        elif self.options['bound_enforcement'] == 'wall':
            u._enforce_bounds_wall(du, self.alpha, system._lower_bounds, system._upper_bounds)

        try:
            cache = self._solver_info.save_cache()

            self._run_apply()
            norm = self._iter_get_norm()

        except AnalysisError as err:
            self._solver_info.restore_cache(cache)

            if self.options['retry_on_analysis_error']:
                self._analysis_error_raised = True
            else:
                exc = sys.exc_info()
                reraise(*exc)

            norm = np.nan

        return norm0, norm

        Perform any necessary pre-processing operations.

        Returns
        -------
        float
            initial error.
        float
            error at the first iteration.
        
Perform any necessary pre-processing operations.
Returns

float
initial error.
float
error at the first iteration.
Perform any necessary pre - processing operations . Returns float initial error . float error at the first iteration .
def _iter_initialize(self):
        system = self._system
        self.alpha = self.options['alpha']
        u = system._outputs
        du = system._vectors['output']['linear']
        self.alpha = 1.
        self._run_apply()
        norm0 = self._iter_get_norm()
        if norm0 == 0.0:
            norm0 = 1.0
        u.add_scal_vec(self.alpha, du)
        if self.options['print_bound_enforce']:
            _print_violations(u, system._lower_bounds, system._upper_bounds)
        if self.options['bound_enforcement'] == 'vector':
            u._enforce_bounds_vector(du, self.alpha, system._lower_bounds, system._upper_bounds)
        elif self.options['bound_enforcement'] == 'scalar':
            u._enforce_bounds_scalar(du, self.alpha, system._lower_bounds, system._upper_bounds)
        elif self.options['bound_enforcement'] == 'wall':
            u._enforce_bounds_wall(du, self.alpha, system._lower_bounds, system._upper_bounds)
        try:
            cache = self._solver_info.save_cache()
            self._run_apply()
            norm = self._iter_get_norm()
        except AnalysisError as err:
            self._solver_info.restore_cache(cache)
            if self.options['retry_on_analysis_error']:
                self._analysis_error_raised = True
            else:
                exc = sys.exc_info()
                reraise(*exc)
            norm = np.nan
        return norm0, norm
def _iter_initialize ( self ) : system = self . _system self . alpha = self . options [ 'alpha' ] u = system . _outputs du = system . _vectors [ 'output' ] [ 'linear' ] self . alpha = 1. self . _run_apply ( ) norm0 = self . _iter_get_norm ( ) if norm0 == 0.0 : norm0 = 1.0 u . add_scal_vec ( self . alpha , du ) if self . options [ 'print_bound_enforce' ] : _print_violations ( u , system . _lower_bounds , system . _upper_bounds ) if self . options [ 'bound_enforcement' ] == 'vector' : u . _enforce_bounds_vector ( du , self . alpha , system . _lower_bounds , system . _upper_bounds ) elif self . options [ 'bound_enforcement' ] == 'scalar' : u . _enforce_bounds_scalar ( du , self . alpha , system . _lower_bounds , system . _upper_bounds ) elif self . options [ 'bound_enforcement' ] == 'wall' : u . _enforce_bounds_wall ( du , self . alpha , system . _lower_bounds , system . _upper_bounds ) try : cache = self . _solver_info . save_cache ( ) self . _run_apply ( ) norm = self . _iter_get_norm ( ) except AnalysisError as err : self . _solver_info . restore_cache ( cache ) if self . options [ 'retry_on_analysis_error' ] : self . _analysis_error_raised = True else : exc = sys . exc_info ( ) reraise ( * exc ) norm = np . nan return norm0 , norm
Perform any necessary pre-processing operations.
Perform any necessary pre - processing operations .
"""
        Perform any necessary pre-processing operations.

        Returns
        -------
        float
            initial error.
        float
            error at the first iteration.
        """
self