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

process space-only variables #1006

Closed
rtimms opened this issue May 20, 2020 · 4 comments · Fixed by #1020
Closed

process space-only variables #1006

rtimms opened this issue May 20, 2020 · 4 comments · Fixed by #1020
Assignees

Comments

@rtimms
Copy link
Contributor

rtimms commented May 20, 2020

At the moment ProcessedVariable only works if len(t)>1 (except for the special case of 2D finite elements, which can handle "fixed t" cases). It would be good to set it up so that any variables that are functions of space only can be processed.

@rtimms rtimms mentioned this issue May 20, 2020
8 tasks
@valentinsulzer
Copy link
Member

Yeah would be great to fix that for the solutions of the algebraic solvers too. I had been working around it by giving [0,1] as the t_eval for variables that depend only on space.

If we can automatically figure out if the variable was only a function of space, I wonder if we still need to raise that error at all? I guess it might then be hard to figure out that the solver has failed (i.e. hit an event too early) though.

@rtimms
Copy link
Contributor Author

rtimms commented May 20, 2020

I think it would be good to remove that error. I think it should (hopefully) be obvious to the user if there is only one entry in t when they were expecting more?

Do we need to know if a variable depends on space? As in, you can pass any t to evaluate and it will just return the same thing? I think the name I used for this issue is wrong, and what I really meant was fix for len(solution.t)=1, in which case you can still evaluate the variable in the same way, but need to create an interpolant of lower dimension.

@valentinsulzer
Copy link
Member

Yes, I think just creating a lower-dimensional interpolant in the case where len(solution.t)=1 would be appropriate. Maybe the ODE/DAE solvers (i.e. non-algebraic) themselves should raise the error still?

@rtimms
Copy link
Contributor Author

rtimms commented May 22, 2020

Yeah I think that is the best place to raise that error

@rtimms rtimms self-assigned this May 26, 2020
rtimms added a commit that referenced this issue May 26, 2020
rtimms added a commit that referenced this issue May 26, 2020
rtimms added a commit that referenced this issue May 26, 2020
rtimms added a commit that referenced this issue May 26, 2020
rtimms added a commit that referenced this issue May 27, 2020
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 a pull request may close this issue.

2 participants