Skip to content

Repository files navigation

NEXT - Newtonian EXact Trajectories

Build License: GPL v3 C++17 OpenMP MPI HDF5

Multi-Threaded & Distributed Simulation Tool for Solving the N-Body Problem

Powered by Barnes-Hut Octree O(N log N), Symplectic KDK Leapfrog Integration, OpenMP, and MPI.


Key Features

  • O(N log N) Barnes-Hut Octree: Scalable spatial tree hierarchy with multipole expansions.
  • Symplectic KDK Leapfrog Integrator: Preserves energy stability over extended numerical integration.
  • Division-Avoiding Algebra: Optimized force calculations (3–6x speedup by minimizing costly float divisions).
  • Hybrid Parallelism: OpenMP multi-threading (multi-core) + MPI (distributed computing cluster).
  • Precision Modes: Configurable compile-time switching between FP32 and FP64.
  • Multi-Format Output: Native support for VTK, VTU (ParaView), and HDF5.
  • Python IC Builder: Legacy initial condition scripts (tools/icbuilder.py).

Building NEXT

# Configure build directory
cmake -B build -S .

# Build executable (Release configuration)
cmake --build build --config Release

For detailed platform-specific installation instructions, see:


CLI Usage & Demo

# Generate initial conditions
cd examples/TwoBodies
python two_body.py

# Run NEXT simulation
../../next two_body.txt <threads> <dt> <dump_interval> <vtk|vtu|hdf5> [max_steps]

# Example: Run 8 threads, dt=0.001, dump every 0.1s, output VTU, for 100 max steps
../../next two_body.txt 8 0.001 0.1 vtu 100

Command Arguments Explained:

  1. input.txt - Path to initial condition particle file
  2. threads - Number of CPU threads (OpenMP)
  3. dt - Baseline time step
  4. dump_interval - Simulation time interval between output dumps
  5. format - Output format (vtk, vtu, or hdf5)
  6. [max_steps] - (Optional) Maximum simulation steps before auto-exit

Media & Previews

About

NEXT - Newtonian EXact Trajectories is a simulation tool written in C++.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages