inmem_recorder.py

Class definition for InMemoryRecorder, a recorder that records values in a memory resident object. Note that this is primarily for testing, and using it for real problems could use up large amounts of memory.

class openmdao.recorders.inmem_recorder.InMemoryRecorder[source]

Bases: openmdao.recorders.base_recorder.BaseRecorder

Recorder that saves cases in memory. Note, this may take up large amounts of memory, so it is not recommended for large models or models with lots of iterations.

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(True)

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]

Record the given run data in memory.

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).

record_metadata(group)[source]

Dump the metadata of the given group in a “pretty” form.

Args:

group : System

System containing vectors