{"id":39176357,"url":"https://github.com/skunichetty/nbsim","last_synced_at":"2026-01-17T22:28:47.270Z","repository":{"id":103388530,"uuid":"361830228","full_name":"skunichetty/nbsim","owner":"skunichetty","description":"A CLI tool simulating gravitational interactions between planetary bodies","archived":false,"fork":false,"pushed_at":"2025-04-12T15:34:36.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T16:39:36.626Z","etag":null,"topics":["cpp","gravity","high-performance","simulation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skunichetty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-26T17:06:33.000Z","updated_at":"2025-04-12T15:34:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"40d2a68e-fc28-402c-a5ba-abf2fb304677","html_url":"https://github.com/skunichetty/nbsim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skunichetty/nbsim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunichetty%2Fnbsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunichetty%2Fnbsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunichetty%2Fnbsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunichetty%2Fnbsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skunichetty","download_url":"https://codeload.github.com/skunichetty/nbsim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunichetty%2Fnbsim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28520527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","gravity","high-performance","simulation"],"created_at":"2026-01-17T22:28:47.205Z","updated_at":"2026-01-17T22:28:47.256Z","avatar_url":"https://github.com/skunichetty.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nbsim: A N-Body Simulation\nN-Body gravitational simulation software in C++, built with performance and scaling in mind for large scale simulations.\n\n\u003e [!NOTE]\n\u003e `nbsim` at its core is a side project worked on by enthusiasts. If you need a production ready solution, it is recommended to search for another solution until `nbsim` is more mature.\n\n## Setup\n\n`nbsim` uses [Bazel](https://bazel.build/) to manage the build process. To compile the main binary, run:\n\n```sh\nbazel build //nbsim/engine/main\n```\n\nBazel will install relevant dependencies (like GTest) and compile the main binary. The resulting binary can be found (by default) at `bazel-bin/nbsim/engine/main`.\n\n## Quick Start\n\n### Fixed Input\n\nThe intended workflow for `nbsim` is for users to provide a set of initial body definitions, from which the software will start simulating gravitational motion.\n\nConsider the following definitions defining a simplified model of lunar orbit[^1]:\n```javascript \n{\n    \"bodies\": [\n        {\n            \"mass\": 5.972e24,\n            \"position\": {\n                \"x\": 0,\n                \"y\": 0,\n                \"z\": 0\n            },\n            \"velocity\": {\n                \"x\": 0,\n                \"y\": 0,\n                \"z\": 0\n            },\n            \"acceleration\": {\n                \"x\": 0,\n                \"y\": 0,\n                \"z\": 0\n            }\n        },\n        {\n            \"mass\": 7.347e22,\n            \"position\": {\n                \"x\": 0,\n                \"y\": 1737100,\n                \"z\": 0\n            },\n            \"velocity\": {\n                \"x\": 1022,\n                \"y\": 0,\n                \"z\": 0\n            },\n            \"acceleration\": {\n                \"x\": 0,\n                \"y\": 0,\n                \"z\": 0\n            }\n        }\n    ]\n}\n```\n\nRun the following command to provide `nbsim` with these definitions and start simulating gravitational motion.\n\n```sh\nnbsim 10 0.5 100 -i input.json -o temp.json\n```\n\nTo breakdown some of the parameters:\n- `10`: the number of seconds encompassing each simulation step\n- `0.5`: is $\\theta \\in [0, 1]$, the granularity of the simulation. Higher values of $\\theta$ lead to more precision in simulation calculations at the cost of runtime.\n- `100`: the number of steps to run the simulation for\n\nThe simulation results are saved to `temp.json`.\n\n### Random Input\n\nFor testing purposes, `nbsim` supports running the main binary with randomly generated bodies. This option is recommended when you are interested in tinkering with the program.\n\nThe following command runs `nbsim` for 100 iterations (each 10 seconds long) at default granularity with 20 randomly generated objects. The simulation results are saved to `temp.json`.\n\n```sh\nnbsim 10 0.5 100 -r 20 -o temp.json\n```\n\n## Full Options List\n- `-o,--output \u003cfilename\u003e` Specifies filename, the output file for simulation results. If not specified,prints output to console.\n- `-i,--input \u003cfilename\u003e` Specifies filename, the input file to read objects from\n- `-r,--random \u003cn\u003e` Randomly generates n objects to simulate. Default simulation width is set to 1e10 meters, but can be expanded by specifying the -w option\n- `-v,--verbose` Prints verbose output messages on simulation progress.\n- `-h,--help` Prints a help message listing options and arguments.\n\n[^1]: The moon's radius of orbit is on average 1,737 kilometers and its velocity is on average 1,022 meters per second. While not wholly circular, as assumed for there to be a fixed orbit, choosing an approximate starting radius should allow for approximate behavior to be simulated.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskunichetty%2Fnbsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskunichetty%2Fnbsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskunichetty%2Fnbsim/lists"}