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

Dimension != 3 #39

Open
H-M-H opened this issue Jan 2, 2021 · 3 comments
Open

Dimension != 3 #39

H-M-H opened this issue Jan 2, 2021 · 3 comments

Comments

@H-M-H
Copy link

H-M-H commented Jan 2, 2021

Hello and thanks for this project,

is there a reason why simulations are only possible in 3 dimensions?

@ChrisRackauckas
Copy link
Member

Nope, the dimensionality just matches whatever you choose for the initial conditions.

@H-M-H
Copy link
Author

H-M-H commented Jan 4, 2021

Oh, did I miss something? To me it looks like MassBody can only be constructed in 3 dimensions:

julia> using NBodySimulator
julia> methods(MassBody)
# 1 method for type constructor:
[1] (::Type{MassBody})(r::StaticArrays.SArray{Tuple{3},cType,1,3}, v::StaticArrays.SArray{Tuple{3},cType,1,3}, m::mType) where {cType<:Real, mType<:Real} in NBodySimulator at ...

Specifically I was wondering about 2 dimensions, obviously I could just set the third components for position and velocity to zero but that does seem like a workaround.

@ChrisRackauckas
Copy link
Member

Oh, that's a mistake. It should get abstracted to allow N dimensions.

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