GraphProblemBuilder
mdo_framework.core.translator.GraphProblemBuilder
Builds a GEMSEO MDA from a typed study schema.
Source code in src/mdo_framework/core/translator.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
__init__(schema)
Initializes the builder with the given study schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
StudySchema
|
Typed description of the variables and tools, as returned
by |
required |
Source code in src/mdo_framework/core/translator.py
57 58 59 60 61 62 63 64 65 | |
build_problem(tool_registry, mda_settings=None)
Constructs a GEMSEO MDA from the study schema.
Each tool gets its own defaults: the value of its fixed parameters, the initial guess of its state variables, and 0.0 for a coupling variable without an initial guess. Design variables have no default. The MDA gathers the defaults of its disciplines.
The coupled tools are solved one after the other (Gauss-Seidel) unless
mda_settings says otherwise. Evaluating the returned MDA raises
MDANotConvergedError if a coupled group does not converge. If any
tool is not deterministic, no process around the tools caches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_registry
|
Mapping[str, Callable]
|
Dictionary mapping tool names to Python functions. |
required |
mda_settings
|
MDASettings | None
|
How to solve the coupled tools; sequential defaults
when omitted. Evaluating them in parallel requires every coupled
tool to be declared |
None
|
Returns:
| Type | Description |
|---|---|
StrictMDAChain
|
An instantiated GEMSEO MDA Discipline object. |
Raises:
| Type | Description |
|---|---|
StudyValidationError
|
If a tool has no registered function or the
registered function cannot take the tool's inputs by keyword, or
if the MDA runs in parallel and a coupled tool is not declared
|
ValueError
|
If two tools produce the same output. |
Source code in src/mdo_framework/core/translator.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |