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

Fixed a bug that was causing matrix-shaped states to have connection errors. #441

Merged
merged 7 commits into from
Nov 6, 2020

Conversation

robfalck
Copy link
Contributor

@robfalck robfalck commented Nov 5, 2020

Summary

Matrix-shaped states are encountering connection errors in various components.
This fix uses OpenMDAO's slicer to connect these components correctly regardless of their dimension.
Similar changes were required in simulation.
Adds a new test: test_cannonball_matrix_states.py, which packs the state for two-dimensional ballistic trajectories [x, y, vx, vy] as a 2 x 2 matrix [[x, y], [vx, vy]].

Related Issues

Status

  • Ready for merge

Backwards incompatibilities

None

New Dependencies

None


src_idxs = src_idxs_mat[map_input_indices_to_disc, :]

if options['shape'] == (1,):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice not to have to do all that anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! om.slicer is so much nicer than figuring out how to build src_indices for arbitrary shapes

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.065% when pulling 432358e on robfalck:matrix_states into 70fe3a8 on OpenMDAO:master.

@robfalck robfalck merged commit fcd0533 into OpenMDAO:master Nov 6, 2020
@robfalck robfalck deleted the matrix_states branch December 17, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

N-dimensional states cause connection errors
3 participants