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:

force_fd : bool(False)

Set to True to finite difference this system.

step_size : float(1e-06)

Default finite difference stepsize

step_type : str(‘absolute’)

Set to absolute, relative

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.

external_input_files : list([])

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

env_vars : dict({})

Environment variables required by the command

external_output_files : list([])

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

command : list([])

command to be executed

timeout : float(0.0)

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

check_external_outputs : bool(True)

Check that all input or output external files exist

poll_delay : float(0.0)

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

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