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

consider changing rhs() interface in integrator to pass y instead of integrator type #1192

Open
zingale opened this issue May 21, 2023 · 2 comments

Comments

@zingale
Copy link
Member

zingale commented May 21, 2023

Right now, we pass the full integrator type (like vode_t) to the rhs() wrapper and then copy vode_t integrator_state.y() into the burn_t state to do the burn. But some integrators (like the RKC) want to pass in different states that are not always in the .y() slot in the integrator type.

We should consider changing the wrappers to explicitly pass in the state, y() instead of the entire integration state. I think that this is very straightforward.

@maxpkatz
Copy link
Member

The reason I wanted to move away from this in the past is that it creates ambiguity as to which y has the up-to-date data. Is it possible instead for the RKC integrator to insert its additional needed data into the integrator type? If not, what kind of objects is it passing in?

@zingale
Copy link
Member Author

zingale commented May 21, 2023

I have all of the data in the integrator type, it's just that there are 5 different RArray1D's there, and it needs to use 4 different ones as the starting point for the RHS. So right now I am just saving y(), then copying the data into y(), calling rhs() and then restoring y(). That should work, but it's a lot of copying.

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

No branches or pull requests

2 participants