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

Refinement update #379

Merged
merged 29 commits into from
Sep 11, 2020

Conversation

kaushikponnapalli
Copy link
Contributor

Summary

Added hp refinement based on "Adaptive mesh refinement method for optimal control using non-smoothness detection and mesh size reduction" by Liu, Hager, and Rao as new refinement scheme.
New scheme allows for detection of where the problem is non-smooth and splits segments rather than simply raise order.
This algorithm is also more efficient in that it also eliminates unnecessary segments and reduces segment order in each iteration so re-solving the problem is less expensive.

Related Issues

Status

  • Ready for merge

Backwards incompatibilities

None

New Dependencies

None

@coveralls
Copy link

coveralls commented Sep 9, 2020

Coverage Status

Coverage decreased (-0.4%) to 95.39% when pulling cbf7f1a on kaushikponnapalli:refinement_update into 8804287 on OpenMDAO:master.

self.declare_partials(of='x0_dot', wrt='x4', rows=r, cols=c, val=0.0)
self.declare_partials(of='x0_dot', wrt='x5', rows=r, cols=c, val=0.0)
self.declare_partials(of='x0_dot', wrt='u0', rows=r, cols=c, val=0.0)
self.declare_partials(of='x0_dot', wrt='u1', rows=r, cols=c, val=0.0)
Copy link
Member

Choose a reason for hiding this comment

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

For derivatives that are 0.0, it is more efficient to just not declare them at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed that but why is that the case? Is it a coloring issue?

Copy link
Member

@Kenneth-T-Moore Kenneth-T-Moore Sep 9, 2020

Choose a reason for hiding this comment

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

When you define it, it creates an entry in the jacobian dictionary that is an r x c arrary of zeros, and it performs a matrix vector product when derivatives are computed because it sees 0,0 as just another number that needs to be multiplied. If you don't declare it, then no entry is even created for it, so it does nothing for that input/output pair.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Thanks!

@kaushikponnapalli kaushikponnapalli merged commit 65d22b4 into OpenMDAO:master Sep 11, 2020
@kaushikponnapalli kaushikponnapalli deleted the refinement_update branch September 11, 2020 14:27
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.

Grid refinement update
4 participants