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

Inner boundary condition setting for solving the Poisson equation

xtyk123456
Beginner
747 Views

Dears, I need your help with the inner boundary condition setting.

For simplicity, we take a 2-D Poisson equation for example, which correspond to the s_Poisson_2D_f.f90” in the MKL library.

Case A

In case A, it is clear that we can assign the following array to set the boundary condition.

 For example in s_Poisson_2D_f.f90

bd_ax(iy) = 1.0E0,

bd_bx(iy) = 1.0E0 ,

bd_ay(ix) = -2.0*pi*sin(2*pi*(ix-1)/nx),

bd_by(ix) =  2.0*pi*sin(2*pi*(ix-1)/nx)

Case B

In case B , in the analysis volume, there are some other charge sources in the analysis volume. The Potential of the black box is set to 0. And the line charge denity of the long wire is given.

So how to solve the problem of case B with  “s_Poisson_2D_f.f90” in the MKL library?

 

0 Kudos
14 Replies
Alexander_K_Intel2
747 Views

Hi,

The way to obtain solution in domain that you describe is using iterative solver with poisson equation with boundary condition as preconditioner. Because of same domain and similar equation the solution number of preconditioned system is quite small that mean small number of iteration. Or you can use direct solver of your system like Pardiso.

Thanks,

Alex

0 Kudos
xtyk123456
Beginner
747 Views

Alexander Kalinkin (Intel) wrote:

Hi,

The way to obtain solution in domain that you describe is using iterative solver with poisson equation with boundary condition as preconditioner. Because of same domain and similar equation the solution number of preconditioned system is quite small that mean small number of iteration. Or you can use direct solver of your system like Pardiso.

Thanks,

Alex

 

1 Do you mean i can not solve my problem with the MKL?  is there any possibilty to use the MKL as  direct solver of my system is very time cosuming?

2 what does Pardiso mean?

3 Just as shown in Fig2 which is the second picture of the attachment,after a iterative solver with poisson equation, a new  channel with given 

line charge denity  is added. and then ,we should solve the poisson equation with the new inner boundary.

 

 

0 Kudos
Alexander_K_Intel2
747 Views

Hi,

It's better to answer on all questions :) PARDISO is the PARallel DIrect sparse SOlver that exist in the MKL. The way of using can be found via mkl examples folders, actually this is one call interface that using sparse matrix format and number of parameters return solution. May I ask you about number of unknowns in your system?

Thanks,

Alex

0 Kudos
xtyk123456
Beginner
747 Views

Alexander Kalinkin (Intel) wrote:

Hi,

It's better to answer on all questions :) PARDISO is the PARallel DIrect sparse SOlver that exist in the MKL. The way of using can be found via mkl examples folders, actually this is one call interface that using sparse matrix format and number of parameters return solution. May I ask you about number of unknowns in your system?

Thanks,

Alex

 

Dear Alex,

     sorry to trouble you again,

         so how to consider the boundary condition setting by using the PARDISO?

         As for fortran,  the maximum array size is 2GB (that could be allocated) and the memory availavle is also 2GB, so if my analysis volume

   is very large, how to apply more memory?

0 Kudos
Alexander_K_Intel2
747 Views

Hi,

The Pardiso functionality is just direct solver that used system of linear system with sparse matrix. The Poisson solver, actually, is direct solver that solve system of linear equation with specific matrix only, with matrix that comes from Poisson equation after discretization. The number of parameters that can be change in Poisson solver is fixed, and one can use Poisson solver only for cube domain. That the main reason why you cannot use this functionality (form of you domain is the same with point on which you set boundary condition). To use PARDISO solver you need to descretize pde equation by your self, construct matrix in any format, convert it into csr format using MKL converters or own and call PARDISO interface for this matrix and rhs. 

About memory size - PARDISO work correctly in both ilp64 and lp64 interface so, to estimate if it possible to use PARDISO for your problem, could your provide size of it? Mesh parameters?

Thanks,

Alex

0 Kudos
xtyk123456
Beginner
747 Views

Alexander Kalinkin (Intel) wrote:

Hi,

The Pardiso functionality is just direct solver that used system of linear system with sparse matrix. The Poisson solver, actually, is direct solver that solve system of linear equation with specific matrix only, with matrix that comes from Poisson equation after discretization. The number of parameters that can be change in Poisson solver is fixed, and one can use Poisson solver only for cube domain. That the main reason why you cannot use this functionality (form of you domain is the same with point on which you set boundary condition). To use PARDISO solver you need to descretize pde equation by your self, construct matrix in any format, convert it into csr format using MKL converters or own and call PARDISO interface for this matrix and rhs. 

About memory size - PARDISO work correctly in both ilp64 and lp64 interface so, to estimate if it possible to use PARDISO for your problem, could your provide size of it? Mesh parameters?

Thanks,

Alex

dear Alex

      the size of my mesh grid is 5m * 5m * 5m, the number of the grids are 800*800*800

0 Kudos
mecej4
Honored Contributor III
747 Views

the number of the grids are 800*800*800

That does not make sense to me -- why do you have three numbers instead of two, for a supposedly two-dimensional problem?

0 Kudos
xtyk123456
Beginner
747 Views

mecej4 wrote:

the number of the grids are 800*800*800

That does not make sense to me -- why do you have three numbers instead of two, for a supposedly two-dimensional problem?

Secondly, the cartesian Poisson solver is capable of working only with rectangular regions. According to your description, bd_ay and bd_by are not constant, which violates the specification of the domain as rectangular.

 

sorry to confuse you.

my actual calculation case is in three dimension, however, for simpleness, i just illustrate in two dimension.

by the way, can i use "s_commit_Helmholtz_2D(f, bd_ax, bd_bx, bd_ay, bd_by, xhandle, ipar, spar, stat)"  to change the inner boundary, for

example, set the charge density to corresponding  f(i,j). 

0 Kudos
xtyk123456
Beginner
747 Views

Alexander Kalinkin (Intel) wrote:

Hi,

The Pardiso functionality is just direct solver that used system of linear system with sparse matrix. The Poisson solver, actually, is direct solver that solve system of linear equation with specific matrix only, with matrix that comes from Poisson equation after discretization. The number of parameters that can be change in Poisson solver is fixed, and one can use Poisson solver only for cube domain. That the main reason why you cannot use this functionality (form of you domain is the same with point on which you set boundary condition). To use PARDISO solver you need to descretize pde equation by your self, construct matrix in any format, convert it into csr format using MKL converters or own and call PARDISO interface for this matrix and rhs. 

About memory size - PARDISO work correctly in both ilp64 and lp64 interface so, to estimate if it possible to use PARDISO for your problem, could your provide size of it? Mesh parameters?

Thanks,

Alex

By the way, can i use "s_commit_Helmholtz_2D(f, bd_ax, bd_bx, bd_ay, bd_by, xhandle, ipar, spar, stat)"  to change the inner boundary, for

example, set the charge density to corresponding  f(i,j). 

0 Kudos
xtyk123456
Beginner
747 Views

The right-hand side of the Poisson equation is corresponding to  linear charge density,so  can we  assign or change the f(i,j)  before computation?

0 Kudos
xtyk123456
Beginner
747 Views

maybe the title of my problem is confused, the line charge density can assign to f(i,j), and the channel segment is not inner boundary ,

but we can treat the channel segments with given charge density as the charge source.

on the other hand, the Potential background of the construction,just bellow the computation volume, can we change the Potential 

to charge density?

so in this way, we can use the Functions of MKL?

0 Kudos
xtyk123456
Beginner
747 Views

Alexander Kalinkin (Intel) wrote:

Hi,

It's better to answer on all questions :) PARDISO is the PARallel DIrect sparse SOlver that exist in the MKL. The way of using can be found via mkl examples folders, actually this is one call interface that using sparse matrix format and number of parameters return solution. May I ask you about number of unknowns in your system?

Thanks,

Alex

maybe the title of my problem is confused, the line charge density can assign to f(i,j), and the channel segment is not inner boundary ,

but we can treat the channel segments with given charge density as the charge source.

on the other hand, the Potential background of the construction,just bellow the computation volume, can we change the Potential 

to charge density?

so in this way, we can use the Functions of MKL?

0 Kudos
xtyk123456
Beginner
747 Views

Alexander Kalinkin (Intel) wrote:

Hi,

It's better to answer on all questions :) PARDISO is the PARallel DIrect sparse SOlver that exist in the MKL. The way of using can be found via mkl examples folders, actually this is one call interface that using sparse matrix format and number of parameters return solution. May I ask you about number of unknowns in your system?

Thanks,

Alex

 

The number of unknowns in my system is 800*800 in 2-D or 800*800*800 in 3D

0 Kudos
Alexander_K_Intel2
747 Views

HI,

Looks like i missed the problem... First of all for your sizes PARDISO solver cannot be used, it have to used for this problem dozens Gb of memory, i think. For Poisson problem:

"maybe the title of my problem is confused, the line charge density can assign to f(i,j), and the channel segment is not inner boundary ,

but we can treat the channel segments with given charge density as the charge source." - can you explain this sentence in term of unknowns? I confused because it is not clear for me what is unknowns but what is rhs in this terms.

Thanks,

Alex

0 Kudos
Reply