|
| 1 | +# ⚡ Run a NEXT Simulation in Under 30 Seconds |
| 2 | + |
| 3 | +This quickstart shows how to build and run a minimal simulation using the **NEXT (Newtonian EXact Trajectories)** codebase in under 30 seconds on a typical developer machine. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- Git |
| 10 | +- CMake (≥ 3.10) |
| 11 | +- C++ compiler (Clang, GCC, or MSVC) |
| 12 | +- Python 3 (for example input generation) |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## 🚀 Quickstart |
| 17 | + |
| 18 | +### 1. Clone the repository |
| 19 | + |
| 20 | +```bash |
| 21 | +git clone https://github.com/TimGoTheCreator/NEXT.git |
| 22 | +cd NEXT |
| 23 | +``` |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +### 2. Build the simulator |
| 28 | + |
| 29 | +```bash |
| 30 | +mkdir build |
| 31 | +cd build |
| 32 | +cmake .. |
| 33 | +cmake --build . --config Release |
| 34 | +cd .. |
| 35 | +``` |
| 36 | + |
| 37 | +This produces the `next` executable in the build directory. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +### 3. Run a built-in example simulation |
| 42 | + |
| 43 | +```bash |
| 44 | +cd examples/TwoBodies |
| 45 | +python two_body.py |
| 46 | +../../build/next two_body.txt 8 0.01 0.1 vtu |
| 47 | +``` |
| 48 | + |
| 49 | +**Arguments explained:** |
| 50 | + |
| 51 | +- `two_body.txt` – input file generated by the Python script |
| 52 | +- `8` – number of CPU threads |
| 53 | +- `0.01` – time step |
| 54 | +- `0.1` – total simulation time |
| 55 | +- `vtu` – output format (VTK Unstructured Grid) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +### 4. View the results |
| 60 | + |
| 61 | +The simulation outputs a `.vtu` file in the example directory. |
| 62 | + |
| 63 | +To visualize: |
| 64 | +- Open the file in **ParaView** |
| 65 | +- Load the dataset and press *Play* to view particle trajectories |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## 🧠 What This Demonstrates |
| 70 | + |
| 71 | +- Successful compilation of the NEXT C++ engine |
| 72 | +- Generation of initial conditions via Python |
| 73 | +- Execution of an N-body simulation |
| 74 | +- Export of results to a standard visualization format |
| 75 | + |
| 76 | +This workflow is intended as the fastest possible validation that NEXT builds and runs correctly. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Notes |
| 81 | + |
| 82 | +- Build times may vary depending on compiler and system. |
| 83 | +- For longer or higher-resolution simulations, adjust thread count, timestep, and total time accordingly. |
| 84 | +- Additional examples are available under the `examples/` directory. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +✅ **Expected total time**: ~20–30 seconds on a modern development machine. |
0 commit comments