This repository contains a simple particle simulation implemented in C++. The simulation models the behavior of multiple point particles in a three-dimensional space under the influence of gravity and periodic boundary conditions.
- Particle Class: Represents a point particle with attributes such as position, velocity, and mass.
- Simulation Class: Manages the simulation environment, including particle initialization, time-stepping, and boundary conditions.
- Visualization: Provides a basic console-based visualization of particle positions.
- Verlet Integration: Utilizes Verlet integration for updating particle positions.
-
Clone the Repository:
git clone https://github.com/SteveProkovas/Particle-Simulation.git
-
Compile the Code:
g++ -std=c++11 -fopenmp main.cpp -o particle_simulation
-
Run the Simulation:
./particle_simulation
-
Visualize the Simulation: The simulation will run for a specified number of steps (default: 5) with a time step of 0.1 seconds. After each step, the particle positions will be visualized in a console-based grid.
- Number of Particles: You can modify the number of particles in the simulation by changing the value passed to the
Simulation
constructor in themain
function. - Simulation Parameters: You can adjust the number of simulation steps and the time step (
dt
) in themain
function as per your requirements.
- C++ Compiler: The code is written in C++ and requires a compatible compiler (e.g., GCC, Clang).
- OpenMP: The code uses OpenMP for parallelization. Ensure that your compiler supports OpenMP.
Contributions are welcome! If you find any bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.