hydesign.openmdao_wrapper

Classes

ComponentWrapper

Class to inherit from when all output variables are explicit.

Module Contents

class hydesign.openmdao_wrapper.ComponentWrapper(inputs, outputs, function, gradient_function=None, additional_inputs=None, additional_outputs=None, partial_options=None, **kwargs)[source]

Bases: openmdao.core.explicitcomponent.ExplicitComponent

Class to inherit from when all output variables are explicit.

Parameters:

**kwargs (dict of keyword arguments) – Keyword arguments that will be mapped into the Component options.

_has_compute_partials[source]

If True, the instance overrides compute_partials.

Type:

bool

_vjp_hash[source]

Hash value for the last set of inputs to the compute_primal function.

Type:

int or None

_vjp_fun[source]

The vector-Jacobian product function.

Type:

function or None

inputs[source]
outputs[source]
function[source]
gradient_function = None[source]
partial_options = None[source]
kwargs[source]
input_keys[source]
all_input_keys[source]
output_keys[source]
n_func_eval = 0[source]
func_time_sum = 0[source]
n_grad_eval = 0[source]
grad_time_sum = 0[source]
setup()[source]

Declare inputs and outputs.

Available attributes:

name pathname comm options

property counter[source]
compute(inputs, outputs)[source]

Execute the wrapped function and write its results to outputs.

Parameters:
  • inputs (openmdao.api.Vector) – Input values provided by OpenMDAO.

  • outputs (openmdao.api.Vector) – Vector to populate with the function results.

compute_partials(inputs, J)[source]

Compute sub-jacobian parts. The model is assumed to be in an unscaled state.

Parameters:
  • inputs (Vector) – Unscaled, dimensional input variables read via inputs[key].

  • partials (Jacobian) – Sub-jac components written to partials[output_name, input_name]..

  • discrete_inputs (dict or None) – If not None, dict containing discrete input values.