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

sys.coords does not work as Vector{Vector} #162

Closed
ejmeitz opened this issue Jan 13, 2024 · 2 comments
Closed

sys.coords does not work as Vector{Vector} #162

ejmeitz opened this issue Jan 13, 2024 · 2 comments

Comments

@ejmeitz
Copy link
Collaborator

ejmeitz commented Jan 13, 2024

Just noticed that if you initialize the coordinates of your system with a Vector{Vector} instead of a Vector{SVector} you get an issue in the forces function specifically line 163 of forces.jl in the zero function. It probably pops up elsewhere also. The heart of the problem is for some reason:
zero([[1,2,3],[2,3,4]) is not valid but
zero([SVector(1,2,3), SVector(3,2,3)] is valid

Either we force the input to be a Vector of SVector or find a work around for the forces. I think that line is just trying to make a matrix the same shape as coords. similar might do the trick.

@jgreener64
Copy link
Collaborator

I think it's fair to assume that the coordinates are some array of SVectors or a similar bits type. There is a big performance hit otherwise.

@ejmeitz
Copy link
Collaborator Author

ejmeitz commented Jan 13, 2024

Makes sense. I'd like to add an error message about this though as the current error/crash is super unintuitive and I think its a pretty easy mistake to make. Will make a PR at some point.

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