bag.mdao.core
This module defines core BAG openmdao classes.
Module Contents
Classes
A class that builds new OpenMDAO groups. |
- class bag.mdao.core.GroupBuilder[source]
Bases:
object
A class that builds new OpenMDAO groups.
This class provides a simple interface to define new variables as function of other variables, and it tracks the variable dependencies using a directed acyclic graph.
- _add_node(name, ndim, **kwargs)[source]
Helper method to add a node and keep track of input variables.
- get_variable_info(name)[source]
Returns the range and dimension of the given variable.
- Parameters:
name (str) – variable name.
- Returns:
min (float) – minimum value.
max (float) – maximum value.
ndim (int) – variable dimension.
- add_fun(var_name, fun_list, params, param_ranges, vector_params=None)[source]
Add a new variable defined by the given list of functions.
- Parameters:
var_name (str) – variable name.
fun_list (list[bag.math.interpolate.Interpolator]) – list of functions, one for each dimension.
params (list[str]) – list of parameter names. Parameter names may repeat, in which case the same parameter will be used for multiple arguments of the function.
param_ranges (dict[str, (float, float)]) – a dictionary of parameter valid range.
vector_params (set[str]) – set of parameters that are vector instead of scalar. If a parameter is a vector, it will be the same size as the output, and each function only takes in the corresponding element of the parameter.
- set_input_limit(var, equals=None, lower=None, upper=None)[source]
Sets the limit on the given input variable.
- build(debug=False)[source]
Returns a OpenMDAO Group from the variable graph.
- Parameters:
debug (bool) – True to print debug messages.
- Returns:
grp (omdao.Group) – the OpenMDAO group that computes all variables.
input_bounds (dict[str, any]) – a dictionary from input variable name to (min, max, ndim) tuple.