dump_recorder.py¶
Class definition for DumpRecorder, a recorder that prints human-readable text output to a stream.
-
class
openmdao.recorders.dump_recorder.
DumpRecorder
(out='stdout')[source]¶ Bases:
openmdao.recorders.base_recorder.BaseRecorder
Dumps cases in a “pretty” form to out, which may be a string or a file-like object (defaults to
stdout
). If out isstdout
orstderr
, then that standard stream is used. Otherwise, if out is a string, then a file with that name will be opened in the current directory. If out is None, cases will be ignored. When called under MPI, the dumprecorder writes to a separate file for each rank, with the rank number appended to each filename. In this case, only variables that exist on all processes can be printed.Args: out : stream
Output stream or file name to write the data.
Options: options[‘record_metadata’] : bool(True)
Tells recorder whether to record variable attribute metadata.
options[‘record_unknowns’] : bool(True)
Tells recorder whether to record the unknowns vector.
options[‘record_params’] : bool(False)
Tells recorder whether to record the params vector.
options[‘record_resids’] : bool(False)
Tells recorder whether to record the ressiduals vector.
options[‘record_derivs’] : bool(False)
Tells recorder whether to record derivatives that are requested by a Driver.
options[‘includes’] : list of strings
Patterns for variables to include in recording.
options[‘excludes’] : list of strings
Patterns for variables to exclude in recording (processed after includes).
-
record_derivatives
(derivs, metadata)[source]¶ Writes the derivatives that were calculated for the driver.
Args: derivs : dict
Dictionary containing derivatives
metadata : dict, optional
Dictionary containing execution metadata (e.g. iteration coordinate).
-
record_iteration
(params, unknowns, resids, metadata)[source]¶ Dump the given run data in a “pretty” form.
Args: params : VecWrapper
VecWrapper containing parameters. (p)
unknowns : VecWrapper
VecWrapper containing outputs and states. (u)
resids : VecWrapper
VecWrapper containing residuals. (r)
metadata : dict
Dictionary containing execution metadata (e.g. iteration coordinate).
-