external_code.py

class openmdao.components.external_code.ExternalCode[source]

Bases: openmdao.core.component.Component

Run an external code as a component

Default stdin is the ‘null’ device, default stdout is the console, and default stderr is error.out.

Options:

fd_options[‘force_fd’] : bool(False)

Set to True to finite difference this system.

fd_options[‘form’] : str(‘forward’)

Finite difference mode. (forward, backward, central) You can also set to ‘complex_step’ to peform the complex step method if your components support it.

fd_options[‘step_size’] : float(1e-06)

Default finite difference stepsize

fd_options[‘step_type’] : str(‘absolute’)

Set to absolute, relative

options[‘check_external_outputs’] : bool(True)

Check that all input or output external files exist

options[‘command’] : list([])

command to be executed

options[‘env_vars’] : dict({})

Environment variables required by the command

options[‘external_input_files’] : list([])

(optional) list of input file names to check the pressence of before solve_nonlinear

options[‘external_output_files’] : list([])

(optional) list of input file names to check the pressence of after solve_nonlinear

options[‘poll_delay’] : float(0.0)

Delay between polling for command completion. A value of zero will use an internally computed default

options[‘timeout’] : float(0.0)

Maximum time to wait for command completion. A value of zero implies an infinite wait

check_setup(out_stream=<open file '<stdout>', mode 'w'>)[source]

Write a report to the given stream indicating any potential problems found with the current configuration of this Problem.

Args:out_stream : a file-like object, optional
solve_nonlinear(params, unknowns, resids)[source]

Runs the component