- Poisson's Equation is a Partial Differential Equation (PDE) that describes how a Scalar Field (like Electric Potential, Temperature, or Gravitational Potential) varies in Space due to a Source Term.
- The mathematical form of this PDE is:
del * (del u) = f(x, y).del * delis the Laplace Operator.uis the unknown Scalar Field.f(x, y)is the Source Term in2D Space; note:3Dcase:f(x, y, z).
- What does this equation tell us?
- Poisson’s Equation tells you how sources (e.g., charge, mass, heat) generate or influence a Potential Field.
- In terms of Fluid Dynamics,
urepresents the Pressure Field inside an Incompressible Flow andfrepresents Negative Divergence of Velocity. - What this means is How Velocity Divergence relates to Pressure.
- Note: this project/software doesn't look any physical scenario.
OpenMPhelps solve Poisson’s equation more efficiently byParallelizingthecomputational workload, which is often the most time-consuming part in numerical methods.- In methods like Finite Difference or Finite Element, you Discretize the Domain into a Grid and iteratively solve for
u(x,y)using an algorithm likeJacobi,Gauss-Seidel, orSOR. - For a
2D gridof sizeN×N, each iteration involves updating every interior grid point using neighboring values. - This is computationally expensive, especially for:
- Fine grids (large
N). - Many iterations (to converge).
- Fine grids (large
- Each point in the grid update is
independent(especially inJacobi iteration), soOpenMPcan safelysplit the workloadamongmultiple threads. - This means
multiple points are computed simultaneously, reducing total computation time.
- Since each iteration involves updating the entire grid,
OpenMPallowsmultiple CPU coresto work in parallel,reducing the time per iteration. This is especially effective for high-resolution grids.
- OpenMP is scalable across many cores, so performance improves with hardware — making it a simple yet powerful way to
scale up simulations.
- Compiler:
gcc 13.1.0; needs to supportOpenMP. - OS:
Ubuntu 20.04. - A `text editor for any changes.
- Make.
$ git clone git@github.com:MRLintern/2D_Poisson_Equation_OpenMP.git$ cd 2D_Poisson_Equation_OpenMP- If you want to generate the results and produce the plot yourself:
$ make clean- Unit Testing:
$ make test- All test cases (should) pass. Now create the executable:
$ make$ ./main- Plot the Results:
- You don't need to be in the
resultsdirectory to create the plot; just stay inside2D_Poisson_Equation_OpenMP. Note: the plot,solution_and_error_surface.png, will be saved insideresults. $ python3 plot_results.py- An image will be created and saved in the
resultsdirectory.