case_recorder.py

Class definition for CaseRecorder, the base class for all recorders.

class openmdao.recorders.case_recorder.CaseRecorder(record_viewer_data=True)[source]

Bases: object

Base class for all case recorders and is not a functioning case recorder on its own.

Attributes
_record_viewer_databool

Flag indicating whether to record data needed to generate N2 diagram.

_counterint

A global counter for execution order, used in iteration coordinate.

_inputsdict

System inputs values, post-filtering, to be used by a derived recorder.

_outputsdict

System or Solver output values, post-filtering, to be used by a derived recorder.

_residsdict

System or Solver residual values, post-filtering, to be used by a derived recorder.

_abs_errorfloat

Solver abs_error value, to be used by a derived recorder.

_rel_errorfloat

Solver abs_error value, to be used by a derived recorder.

_iteration_coordinatestr

The unique iteration coordinate of where an iteration originates.

_parallelbool

Designates if the current recorder is parallel-recording-capable.

__init__(record_viewer_data=True)[source]

Initialize.

Parameters
record_viewer_databool, optional

If True, record data needed for visualization.

record_derivatives(recording_requester, data, metadata, **kwargs)[source]

Route the record_derivatives call to the proper method.

Parameters
recording_requesterobject

System, Solver, Driver in need of recording.

datadict

Dictionary containing derivatives keyed by ‘of,wrt’ to be recorded.

metadatadict

Dictionary containing execution metadata.

**kwargskeyword args

Some implementations of record_derivatives need additional args.

record_derivatives_driver(recording_requester, data, metadata)[source]

Record derivatives data from a Driver.

Parameters
recording_requesterDriver

Driver in need of recording.

datadict

Dictionary containing derivatives keyed by ‘of,wrt’ to be recorded.

metadatadict

Dictionary containing execution metadata.

record_iteration(recording_requester, data, metadata, **kwargs)[source]

Route the record_iteration call to the proper method.

Parameters
recording_requesterobject

System, Solver, Driver in need of recording.

metadatadict, optional

Dictionary containing execution metadata.

datadict

Dictionary containing desvars, objectives, constraints, responses, and System vars.

**kwargskeyword args

Some implementations of record_iteration need additional args.

record_iteration_driver(recording_requester, data, metadata)[source]

Record data and metadata from a Driver.

Parameters
recording_requesterDriver

Driver in need of recording.

datadict

Dictionary containing desvars, objectives, constraints, responses, and System vars.

metadatadict

Dictionary containing execution metadata.

record_iteration_problem(recording_requester, data, metadata)[source]

Record data and metadata from a Problem.

Parameters
recording_requesterProblem

Problem in need of recording.

datadict

Dictionary containing desvars, objectives, constraints.

metadatadict

Dictionary containing execution metadata.

record_iteration_solver(recording_requester, data, metadata)[source]

Record data and metadata from a Solver.

Parameters
recording_requesterSolver

Solver in need of recording.

datadict

Dictionary containing outputs, residuals, and errors.

metadatadict

Dictionary containing execution metadata.

record_iteration_system(recording_requester, data, metadata)[source]

Record data and metadata from a System.

Parameters
recording_requesterSystem

System in need of recording.

datadict

Dictionary containing inputs, outputs, and residuals.

metadatadict

Dictionary containing execution metadata.

record_metadata(recording_requester)[source]

Route the record_metadata call to the proper method.

Parameters
recording_requesterobject

The object that would like to record its metadata.

record_metadata_solver(solver, run_number=None)[source]

Record solver metadata.

Parameters
solverSolver

The Solver for which to record metadata.

run_numberint or None

Number indicating which run the metadata is associated with. None for the first run, 1 for the second, etc.

record_metadata_system(system, run_number=None)[source]

Record system metadata.

Parameters
systemSystem

The System for which to record metadata.

run_numberint or None

Number indicating which run the metadata is associated with. None for the first run, 1 for the second, etc.

record_viewer_data(model_viewer_data)[source]

Record model viewer data.

Parameters
model_viewer_datadict

Data required to visualize the model.

shutdown()[source]

Shut down the recorder.

startup(recording_requester)[source]

Prepare for a new run and calculate inclusion lists.

Parameters
recording_requesterobject

Object to which this recorder is attached.