fastoad.openmdao.problem module

class fastoad.openmdao.problem.FASTOADProblem(*args, **kwargs)[source]

Bases: openmdao.core.problem.Problem

Vanilla OpenMDAO Problem except that it can write its outputs to a file.

It also runs ValidityDomainChecker after each run_model() or run_driver() (but it does nothing if no check has been registered).

Initialize attributes.

Parameters
  • model (<System> or None) – The top-level <System>. If not specified, an empty <Group> will be created.

  • driver (<Driver> or None) – The driver for the problem. If not specified, a simple “Run Once” driver will be used.

  • comm (MPI.Comm or <FakeComm> or None) – The global communicator.

  • name (str) – Problem name. Can be used to specify a Problem instance when multiple Problems exist.

  • **options (named args) – All remaining named args are converted to options.

output_file_path

File path where write_outputs() will write outputs

additional_variables

Variables that are not part of the problem but that should be written in output file.

run_model(case_prefix=None, reset_iter_counts=True)[source]

Run the model by calling the root system’s solve_nonlinear.

Parameters
  • case_prefix (str or None) – Prefix to prepend to coordinates when recording.

  • reset_iter_counts (bool) – If True and model has been run previously, reset all iteration counters.

run_driver(case_prefix=None, reset_iter_counts=True)[source]

Run the driver on the model.

Parameters
  • case_prefix (str or None) – Prefix to prepend to coordinates when recording.

  • reset_iter_counts (bool) – If True and model has been run previously, reset all iteration counters.

Returns

Failure flag; True if failed to converge, False is successful.

Return type

boolean

write_outputs()[source]

Writes all outputs in the configured output file.