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.
- Parameters:
- record_viewer_databool, optional
If True, record data needed for visualization.
- 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.
- _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
Flag indicating if this recorder will record on multiple processes.
- _record_on_procbool or None
Flag indicating if this recorder will record on the current process (None if unspecified).
- _recording_rankslist
List of ranks on which this recorder will record if running under MPI.
- __init__(record_viewer_data=True)[source]
Initialize.
- Parameters:
- record_viewer_databool, optional
If True, record data needed for visualization.
- property parallel
Return True if this recorder is recording on multiple processes.
- 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.
- datadict
Dictionary containing desvars, objectives, constraints, responses, and System vars.
- metadatadict, optional
Dictionary containing execution metadata.
- **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_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.
- property record_on_process
Determine if recording should be performed on this process.
- 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, comm=None)[source]
Prepare for a new run.
- Parameters:
- recording_requesterobject
Object to which this recorder is attached.
- commMPI.Comm or <FakeComm> or None
The MPI communicator for the recorder (should be the comm for the Problem).