https://github.com/gabrieleinvernizzi/wave_equation_2d
2D wave equation solver
https://github.com/gabrieleinvernizzi/wave_equation_2d
c-language openmpi wave-equation-solver
Last synced: 3 months ago
JSON representation
2D wave equation solver
- Host: GitHub
- URL: https://github.com/gabrieleinvernizzi/wave_equation_2d
- Owner: GabrieleInvernizzi
- License: mit
- Created: 2023-12-16T09:47:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-27T14:32:39.000Z (9 months ago)
- Last Synced: 2024-12-19T22:20:15.999Z (5 months ago)
- Topics: c-language, openmpi, wave-equation-solver
- Language: C
- Homepage:
- Size: 870 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 2D wave equation solver
The project is comprised of two executables, the serial and the parallel implementations.
The parallel one is built on top of OpenMPI.## Build
Before trying to build the project ensure to have installed the following dependencies:
- gcc
- make
- OpenMPI (5.0.1)Next, to download and build the project run the following commands:
```bash
git clone https://github.com/GabrieleInvernizzi/wave_equation_2d.git
cd wave_equation_2d
make
```
This will create two executables in the `./bin` directory:
- `wave_eq_s`: the serial implementation
- `wave_eq_p`: the parallel implementationThere are some make flags that can be setted to tailor compilation, for more info look at the `Makefile`.
## Usage
The serial implementation can be run as any other program.
```bash
./wave_eq_s
```The parallel implementation must be run as an OpenMPI parallel application, there are multiple ways to do so.
The simplest one is by using `mpirun`.
```bash
mpirun -n 5 ./wave_eq_p
```To know more about all the options that can be used with both implementations run them with the `help` flag.
```bash
./wave_eq_s --help
```Next, the simulation file can be encoded as a video using the script `sim2video`.
```bash
pipenv run python3 ./sim2video.py ../out.sim
```## Example video
https://github.com/GabrieleInvernizzi/wave_equation_2d/assets/42583079/0bcc8ac9-e331-4855-b68e-4ceff9421194