2D-PDE-solver in C++

A code that solve 2D partial differential equations with C++ and plot the whole thing with matplotlib (Python)

2D-PDE-solver-cpp

exemples

  • conduction [heat equation]

conduction gif

  • wave [wave equation]

wave equation

languages

C++ for the calculation,

Python (with matplotlib) for the plotting

installation and usage

  1. clone the repo :
git clone https://github.com/nobody48sheldor/2D-PDE-solver-cpp
  1. [Linux / BASH]
  • for linux users run the compile-script.sh
sh compile-script.sh
  1. [Windows / Mac] for ohters (manually)
  • compile the sovler.cpp
  • run the compiled file

usefulness and pros

  • You can edit the line that is used to calculate the next point to solve a lot of 2D-partial-differential equation or even contribute, it is fully open source.

  • It has been made so that it doesn't take too much RAM while beeing user friendly for contributing and using.

cons

  • I am a highschool student so it may not be the best way to make this kind of program since I am not that experienced.
  • The boundaries conditions are that the function must be 0 at the boundaries, this is done by setting the F(x, y, t) at the boundaries such that F(x, y, t + dt) = F(x, y, t), which imply that this boundaries condition must be true at t = 0, in other words the initial condition must obey the boundaries conditions, I hope a contributor find some way to "disable" the necessarity of boundaries conditions.

contribute

  • You can contribute to the code and add some differents initial conditions or differential equation and more like complexity improuvement.