MDA settings
mdo_framework.core.mda
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
MDASettings
Bases: BaseModel
How the strongly coupled tools are solved.
The default runs the coupled tools one after the other (Gauss-Seidel).
Running them in parallel requires inner_mda_name="MDAJacobi" and tools
declared thread_safe.
Attributes:
| Name | Type | Description |
|---|---|---|
inner_mda_name |
Literal['MDAGaussSeidel', 'MDAJacobi', 'MDANewtonRaphson']
|
GEMSEO algorithm that solves each coupled group. |
tolerance |
PositiveFloat
|
Normalized residual at which the coupled group has converged. |
max_mda_iter |
PositiveInt
|
Maximum number of iterations of the algorithm. |
max_consecutive_unsuccessful_iterations |
PositiveInt
|
Number of consecutive iterations without residual decrease after which the algorithm stops. |
n_processes |
PositiveInt
|
Number of threads running the coupled tools at the same
time. Above 1 only for |
accept_tolerance |
PositiveFloat | None
|
Largest normalized residual of a stopped algorithm
that is still accepted. |
Source code in src/mdo_framework/core/mda.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 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 | |
residual_limit
property
Largest normalized residual of an accepted coupled group.
StrictMDAChain
Bases: MDAChain
MDAChain that raises instead of returning unconverged states.
GEMSEO only logs a warning when an algorithm stops above its tolerance and
returns the last iterate. Every coupled group of this chain is checked
once it has run, so each evaluation of the discipline either converged or
raised MDANotConvergedError.
Source code in src/mdo_framework/core/mda.py
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 | |
__init__(disciplines, settings)
Build the chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
disciplines
|
Sequence[Discipline]
|
The disciplines to chain; the coupled ones are solved
together by the algorithm of |
required |
settings
|
MDASettings
|
How the coupled groups are solved and accepted. |
required |
Source code in src/mdo_framework/core/mda.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
disable_caches()
Stop the chain, its algorithms and nested processes from caching.
A cached process replays its outputs for inputs it has already seen, so a stochastic tool inside it would be called only once. The caches of the tools themselves are left to the tools.
Source code in src/mdo_framework/core/mda.py
132 133 134 135 136 137 138 139 140 | |
build_mda(disciplines, settings=None)
Chain the disciplines, solving the coupled ones as the settings say.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
disciplines
|
Sequence[Discipline]
|
The disciplines of the study. |
required |
settings
|
MDASettings | None
|
How to solve and accept the coupled groups; the sequential Gauss-Seidel defaults when omitted. |
None
|
Returns:
| Type | Description |
|---|---|
StrictMDAChain
|
A discipline whose evaluation raises |
StrictMDAChain
|
coupled group stops above its accepted residual. |
Source code in src/mdo_framework/core/mda.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |