Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POEM 81: Implement Submodel Component #2817

Merged
merged 160 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
85bb643
Subproblem implementation attempt
nsteffen Feb 14, 2023
023daf6
Changed how model is passed to problem and fixed displaying n2
nsteffen Feb 14, 2023
bf76c3a
cleaned up comments and check final value
nsteffen Feb 14, 2023
9da0758
Cleaned up code and made more descriptive comments
nsteffen Feb 15, 2023
e212108
Cleaned up example code and SubproblemComp
nsteffen Feb 15, 2023
0f512bc
changed args for SubproblemComp
nsteffen Feb 15, 2023
ec5d6bc
Merge pull request #9 from nsteffen/subprob_test
nsteffen Feb 15, 2023
59db55f
moved SubproblemComp and changed init args
nsteffen Feb 16, 2023
ac7867f
added default behavior for io
nsteffen Feb 16, 2023
79a33fa
added star option for io
nsteffen Feb 16, 2023
1de5d39
clarified io comment
nsteffen Feb 16, 2023
d2a7fbb
changed io behavior back
nsteffen Feb 16, 2023
ab37ce0
changed example to specify io
nsteffen Feb 16, 2023
7664e2c
changed io behavior for both comp and example
nsteffen Feb 16, 2023
4ccbd4e
updated with changes from POEM
nsteffen Feb 17, 2023
ed2891b
changed dirs/naming and updated from POEM081
nsteffen Feb 17, 2023
2b08823
made get_model_vars and updated setup and doc strings
nsteffen Feb 21, 2023
5293999
changed public func to _get_model_vars and fixed doc string
nsteffen Feb 21, 2023
c4f6b11
included subproblem_comp in setup.py
nsteffen Feb 21, 2023
1fd6768
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen Feb 21, 2023
6f401d2
updated get_model_vars, set_complex_step_mode, and test
nsteffen Feb 22, 2023
578996a
changed list_inputs/outputs to model_input/output_names
nsteffen Feb 27, 2023
455ca4a
changed list_inputs/outputs to model_input/output_names in attributes…
nsteffen Feb 27, 2023
681b5b8
added subproblemcomp to api
nsteffen Feb 28, 2023
345bad7
fixed get_model_vars checks and made test_variable_alias test
nsteffen Feb 28, 2023
701f1b5
updated docstrings and made test for subsystems with same name variables
nsteffen Mar 1, 2023
468a224
fixed error in new test
nsteffen Mar 1, 2023
84123e6
cleaned up test and made initial docs
nsteffen Mar 1, 2023
f0209ad
fixed test
nsteffen Mar 1, 2023
3e39da6
added wildcard option, test for that option, and updated docs
nsteffen Mar 2, 2023
5c5a509
cleaned up comments
nsteffen Mar 2, 2023
59f2c47
fixed docs
nsteffen Mar 2, 2023
81a55ba
added option to list io as None and use unconnected io from list_inpu…
nsteffen Mar 2, 2023
a2942a7
cleaned up wildcard part
nsteffen Mar 2, 2023
6a28448
fixed None case for io to only consider indep vars
nsteffen Mar 2, 2023
fa9d98b
Merge pull request #12 from OpenMDAO/master
nsteffen Mar 6, 2023
e42edce
Subproblem implementation attempt
nsteffen Feb 14, 2023
5f16795
Changed how model is passed to problem and fixed displaying n2
nsteffen Feb 14, 2023
12a755a
cleaned up comments and check final value
nsteffen Feb 14, 2023
d3057ca
Cleaned up code and made more descriptive comments
nsteffen Feb 15, 2023
932d9d5
Cleaned up example code and SubproblemComp
nsteffen Feb 15, 2023
1419764
changed args for SubproblemComp
nsteffen Feb 15, 2023
ad16eae
moved SubproblemComp and changed init args
nsteffen Feb 16, 2023
4692b8d
added default behavior for io
nsteffen Feb 16, 2023
64f0317
added star option for io
nsteffen Feb 16, 2023
db0d301
clarified io comment
nsteffen Feb 16, 2023
4c0c092
changed io behavior back
nsteffen Feb 16, 2023
c9e7865
changed example to specify io
nsteffen Feb 16, 2023
17b08cc
changed io behavior for both comp and example
nsteffen Feb 16, 2023
9156be3
updated with changes from POEM
nsteffen Feb 17, 2023
f2ead90
changed dirs/naming and updated from POEM081
nsteffen Feb 17, 2023
56d280f
made get_model_vars and updated setup and doc strings
nsteffen Feb 21, 2023
1223a98
changed public func to _get_model_vars and fixed doc string
nsteffen Feb 21, 2023
41c2cdf
included subproblem_comp in setup.py
nsteffen Feb 21, 2023
f98e55d
updated get_model_vars, set_complex_step_mode, and test
nsteffen Feb 22, 2023
4f3a88b
changed list_inputs/outputs to model_input/output_names
nsteffen Feb 27, 2023
9ad7e08
changed list_inputs/outputs to model_input/output_names in attributes…
nsteffen Feb 27, 2023
e691b96
added subproblemcomp to api
nsteffen Feb 28, 2023
9ba5eb1
fixed get_model_vars checks and made test_variable_alias test
nsteffen Feb 28, 2023
f525845
updated docstrings and made test for subsystems with same name variables
nsteffen Mar 1, 2023
3fdc9e0
fixed error in new test
nsteffen Mar 1, 2023
98613b5
cleaned up test and made initial docs
nsteffen Mar 1, 2023
2a4aad1
fixed test
nsteffen Mar 1, 2023
2bbd414
added wildcard option, test for that option, and updated docs
nsteffen Mar 2, 2023
640f1cb
cleaned up comments
nsteffen Mar 2, 2023
89152a7
fixed docs
nsteffen Mar 2, 2023
58fb131
added option to list io as None and use unconnected io from list_inpu…
nsteffen Mar 2, 2023
b55378c
cleaned up wildcard part
nsteffen Mar 2, 2023
3f902b9
fixed None case for io to only consider indep vars
nsteffen Mar 2, 2023
cd69da7
handle 'DEVNULL' in use_proc_files()
swryan Feb 27, 2023
477b54b
allow warnings from jupyter-book build
swryan Mar 3, 2023
512a565
pin jupyter-book==0.14; remove nbconvert dependency
swryan Mar 3, 2023
81d39ae
remove --keep-going flag
swryan Mar 3, 2023
b8bb626
fix for MPI bug when dist vec has zero entry
naylor-b Mar 2, 2023
3437609
turn off coveralls on CI
naylor-b Mar 2, 2023
b8e5161
put coveralls back
naylor-b Mar 2, 2023
3456e39
added a skip if pyoptsparse not installed
naylor-b Mar 2, 2023
4af83a6
Merge branch 'subprob' of https://github.com/nsteffen/OpenMDAO into s…
nsteffen Mar 6, 2023
92d6b1f
Updated docs
nsteffen Mar 7, 2023
a7de50c
removed isinstance(p.driver, Driver) test
nsteffen Mar 7, 2023
04712cd
initial implementation of sparsity
nsteffen Mar 9, 2023
16e5198
second iteration for sparsity
nsteffen Mar 9, 2023
e169616
fixed pep8 with second iteration
nsteffen Mar 9, 2023
ba1ea88
getting subprob to use coloring
naylor-b Mar 10, 2023
23d60a3
Merge branch 'OpenMDAO:master' into subprob
nsteffen Mar 10, 2023
eb5a720
fixing issue when self.coloring is None
naylor-b Mar 10, 2023
70bc869
Merge branch 'nate' of https://github.com/naylor-b/OpenMDAO into subprob
nsteffen Mar 10, 2023
821a49f
included add_input/output, cleaned code, made new test, and updated docs
nsteffen Mar 14, 2023
5a3c13e
fixed test_multiple_setups, test_add_io_after_setup, and formatting
nsteffen Mar 14, 2023
88c21cb
fixed docstrings
nsteffen Mar 14, 2023
49ffbd0
fixed pep8
nsteffen Mar 14, 2023
f88a46b
added check for setup status to add_input/output
nsteffen Mar 14, 2023
ab36477
first iteration implementing add_design_vars, constraints, and object…
nsteffen Mar 14, 2023
07c65fb
fixed _setup_var_data so no error is thrown when io isn't declared yet
nsteffen Mar 14, 2023
7c91db6
updated docs
nsteffen Mar 14, 2023
b856f70
fixed test asserts
nsteffen Mar 15, 2023
4257c59
removed add_design_var/constraints functions and updated docs
nsteffen Mar 15, 2023
549e2ba
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen Mar 15, 2023
23dd980
changed name to submodel instead of subproblem
nsteffen Mar 15, 2023
de6011f
got rid of driver argument and calls
nsteffen Mar 15, 2023
6ed8a50
changed assertTrue to assertEqual
nsteffen Mar 17, 2023
eec02ce
now supports repeated prom names and names with dots
nsteffen Mar 27, 2023
58275ee
initial commit
nsteffen Mar 31, 2023
b4dfe8b
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen Apr 6, 2023
be383a6
recent changes to fix design_var problems
nsteffen Apr 7, 2023
d3b04c0
recent version
nsteffen Apr 11, 2023
bbbde85
fixed naming errors
nsteffen Apr 13, 2023
f22b5ca
seems to work now
nsteffen Apr 13, 2023
262669c
cleaned up comments
nsteffen Apr 17, 2023
eccaf18
changed no coloring option
nsteffen Apr 18, 2023
8614dee
brach_submodel_test working with dense derivatives. calling driver._c…
robfalck Apr 19, 2023
5109f4c
quieter
robfalck Apr 19, 2023
c739f07
polynomial controls working, squelched the solver prints in the submo…
robfalck Apr 19, 2023
e70941c
removed unneccessary mapping
nsteffen Apr 24, 2023
d166a65
cleaned up code and made problem an argument
nsteffen Apr 24, 2023
b9ea7f8
made submodelcomp work for tests
nsteffen Apr 25, 2023
9b1c237
cleaned up comments
nsteffen Apr 25, 2023
67f0506
cleaned up more comments
nsteffen Apr 25, 2023
35d6402
changed compute method
nsteffen Apr 25, 2023
0797d27
cleaned up comments and docstrings
nsteffen Apr 26, 2023
10dd63f
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen Apr 26, 2023
56849e2
Merge branch 'OpenMDAO:master' into new_submodel
nsteffen Apr 26, 2023
a9ce2fc
Merge pull request #14 from nsteffen/new_submodel
nsteffen Apr 26, 2023
4714e89
fixed docstring and list_indep_var issue
nsteffen Apr 26, 2023
90d904e
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into ne…
nsteffen Apr 26, 2023
d91f28d
updated branch
nsteffen Apr 26, 2023
3411d6b
Merge branch 'new_submodel' of https://github.com/nsteffen/OpenMDAO i…
nsteffen Apr 26, 2023
8a70eee
fixed docstring and list_indep_var for submodelcomp
nsteffen Apr 26, 2023
e28eae5
Merge pull request #15 from nsteffen/new_submodel
nsteffen Apr 26, 2023
55e81f5
Merge branch 'subprob' of https://github.com/nsteffen/OpenMDAO into s…
nsteffen Apr 26, 2023
a1a4dc8
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen Apr 26, 2023
1ef40fb
changed run_driver to driver.run and Bret fixed naming issues
nsteffen Apr 28, 2023
41ccebb
find vars on subsytem automatically
nsteffen May 2, 2023
2332a35
intermeditate step
nsteffen May 2, 2023
7ddfdf1
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen May 2, 2023
4574a0a
added and used it to clear inner problem driver
nsteffen May 3, 2023
805e0a3
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen May 3, 2023
99143ed
attempted to make it work for coloring
nsteffen May 3, 2023
59d658f
fixed naming issues with driver vars
nsteffen May 3, 2023
2bc3fc5
changed driver and model abs and prom mappings to try to work with co…
nsteffen May 3, 2023
0ac8ca0
got rid of model arg so model has to be added as prob susbsys
nsteffen May 4, 2023
63ec1a3
made it so that model has to be added to subprob as subsys
nsteffen May 4, 2023
59870d3
fixed wildcard case
nsteffen May 5, 2023
94c8344
made it so it won't try to add same design vars for multiple setups
nsteffen May 8, 2023
676e270
updated tests and docs, cleaned up comments, removed var extraction f…
nsteffen May 10, 2023
d83d852
updated docstrings and comments
nsteffen May 10, 2023
ee491fd
another docstring fix
nsteffen May 10, 2023
1c20638
removed model from parameters in docstring
nsteffen May 10, 2023
822dc47
got rid of automatic promoting and updated docs and tests
nsteffen May 10, 2023
dcb7765
accidentally added brach_submodel_test.py
nsteffen May 11, 2023
4f35163
fixed default reports behavior
nsteffen May 11, 2023
5f7e640
removed brach_submodel_test.py
nsteffen May 11, 2023
8c430c2
Merge branch 'subprob' of https://github.com/nsteffen/OpenMDAO into s…
nsteffen May 11, 2023
02635b4
made 'of' loop in an else branch in total_jac
nsteffen May 11, 2023
06061d3
Merge branch 'master' of https://github.com/OpenMDAO/OpenMDAO into su…
nsteffen May 12, 2023
fb93d5b
got rid of self.is_set_up and made test for multiple submodel setups
nsteffen May 15, 2023
8b87dbf
updated add_input/output to be able to set val, units, etc. to what t…
nsteffen May 17, 2023
4a0c587
added '.' in docstring
nsteffen May 17, 2023
6b0d1b1
changed if not _problem_meta to if _problem_meta is None
nsteffen May 18, 2023
99f9ffb
updated for add_input too
nsteffen May 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openmdao/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import MultiFiMetaModelUnStructuredComp
from openmdao.components.mux_comp import MuxComp
from openmdao.components.vector_magnitude_comp import VectorMagnitudeComp
from openmdao.components.submodel_comp import SubmodelComp


# Solvers
Expand Down
467 changes: 467 additions & 0 deletions openmdao/components/submodel_comp.py

Large diffs are not rendered by default.

442 changes: 442 additions & 0 deletions openmdao/components/tests/test_submodel_comp.py

Large diffs are not rendered by default.

28 changes: 19 additions & 9 deletions openmdao/core/total_jac.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,25 @@ def __init__(self, problem, of, wrt, use_abs_names, return_format, approx=False,
self.simul_coloring = driver._coloring_info['coloring']

# if we don't get wrt and of from driver, turn off coloring
if self.simul_coloring is not None and \
(prom_wrt != driver_wrt or prom_of != driver_of):
msg = ("compute_totals called using a different list of design vars and/or "
"responses than those used to define coloring, so coloring will "
"be turned off.\ncoloring design vars: %s, current design vars: "
"%s\ncoloring responses: %s, current responses: %s." %
(driver_wrt, wrt, driver_of, of))
issue_warning(msg, category=DerivativesWarning)
self.simul_coloring = None
if self.simul_coloring is not None:
ok = True
if prom_wrt != driver_wrt:
ok = False
else:
# TODO: there's some weirdness here where sometimes the
# of vars are absolute and sometimes they're not...
for pof, aof, dof in zip(prom_of, of, driver_of):
if pof != dof and aof != dof:
ok = False
break
if not ok:
msg = ("compute_totals called using a different list of design vars and/or "
"responses than those used to define coloring, so coloring will "
"be turned off.\ncoloring design vars: %s, current design vars: "
"%s\ncoloring responses: %s, current responses: %s." %
(driver_wrt, wrt, driver_of, of))
issue_warning(msg, category=DerivativesWarning)
self.simul_coloring = None

if not isinstance(self.simul_coloring, Coloring):
self.simul_coloring = None
Expand Down
Loading