Skip to content

Commit

Permalink
Fixed commented lines and attr setting
Browse files Browse the repository at this point in the history
  • Loading branch information
DKilkenny committed Oct 13, 2020
1 parent 495d140 commit cd4703b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
7 changes: 0 additions & 7 deletions openmdao/approximation_schemes/approximation_scheme.py
Expand Up @@ -301,13 +301,6 @@ def _init_approximations(self, system):
def _compute_approximations(self, system, jac, total, under_cs):
from openmdao.core.component import Component

if hasattr(self, "progress_out_stream"):
self._progress_out = self.progress_out_stream
elif hasattr(system._approx_schemes, "progress_out_stream"):
self._progress_out = system._approx_schemes.progress_out_stream
else:
self._progress_out = None

# Set system flag that we're under approximation to true
system._set_approx_mode(True)

Expand Down
2 changes: 1 addition & 1 deletion openmdao/core/problem.py
Expand Up @@ -1445,7 +1445,7 @@ def check_totals(self, of=None, wrt=None, out_stream=_DEFAULT_OUT_STREAM, compac
Step type for finite difference, can be 'abs' for absolute', or 'rel' for relative.
Default is 'abs'.
show_progress : bool
Bool to show progress of check_totals
True to show progress of check_totals
Returns
-------
Expand Down
11 changes: 4 additions & 7 deletions openmdao/core/total_jac.py
Expand Up @@ -1489,21 +1489,18 @@ def compute_totals_approx(self, initialize=False, progress_out_stream=None):
method = list(model._approx_schemes)[0]
kwargs = model._owns_approx_jac_meta
model.approx_totals(method=method, **kwargs)
# if progress_out_stream is not None:
# model._approx_schemes[method].progress_out_stream = progress_out_stream
if progress_out_stream is not None:
model._approx_schemes[method]._progress_out = progress_out_stream
else:
model.approx_totals(method='fd')
# if progress_out_stream is not None:
# model._approx_schemes.progress_out_stream = progress_out_stream
if progress_out_stream is not None:
model._approx_schemes['fd']._progress_out = progress_out_stream

model._setup_jacobians(recurse=False)
model._setup_approx_partials()
if model._coloring_info['coloring'] is not None:
model._update_wrt_matches(model._coloring_info)

if progress_out_stream is not None:
model._approx_schemes.progress_out_stream = progress_out_stream

# Linearize Model
model._linearize(model._assembled_jac,
sub_do_ln=model._linear_solver._linearize_children())
Expand Down

0 comments on commit cd4703b

Please sign in to comment.