Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6884 Discussions

## 1D Poisson example

Beginner
348 Views
My question might be very trivial but I am looking for a quick solution. I need to solve 1D Poisson equation. I tried to use following examples: d_Poisson_2D_f.f90 and  d_Poisson_3D_f.f90 by simply reducing the mesh (nx=4, ny=1 and nx=4, ny=1, nz=1) in the examples but in both case it fails to converge by giving the following error:

d_Poisson_2D_f.f90 error:

=======================================================================

The number of mesh intervals in x-direction is nx=6
The number of mesh intervals in y-direction is ny=1

In the mesh point (0.167,0.000) the error between the computed and the true solution is equal to -0.272E+00
In the mesh point (0.167,1.000) the error between the computed and the true solution is equal to  0.272E+00

The computed solution seems to be inaccurate.
Double precision 2D Poisson example FAILED to compute the solution...

and d_Poisson_3D_f.f90 error:

------------------------------------------------------------------------------
MKL TRIG TRANSFORMS ERROR:
The dimension of the trigonometric transform 1 should be
an integer number greater or equal to 2.

-------------------------------------------------------------------------------
MKL POISSON LIBRARY ERROR:
Fatal error: Trigonometric Transform commit step has failed to complete.
Error code = 1. Computations has been stopped...
Double precision 3D Poisson example FAILED to compute the solution...

Is there any quick resolution for it or is there a 1D Poisson fortran example out there?

thanks
Employee
348 Views
Hi
If you want to get solution of 1D Poisson solver of size N and rhs with element f(k) you need to made next steps:
1. Set Nz = N, Nx and Ny any number greater or equal to 2.
2. Set zero Neumann condition in both x and y dimension
3. Set rhs(i,j,k) = f(k)
In such case you get Nx*Ny solution of 1D Poisson equation (x(k) = solution(i,j,k) independently of i and j).
But I'm strongly recommend you to use LAPACK functionality to solve such equation
With best regards,