<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Boundary conditions MKL Helholtz solver in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791106#M2224</link>
    <description>Hi,&lt;DIV&gt;it's seem that you need to set&lt;/DIV&gt;&lt;DIV&gt;do ix=1,nx+1&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_ay&lt;I&gt;(i)&lt;/I&gt;=-2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_by&lt;I&gt;(i)&lt;/I&gt;=2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;end do&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;instead of&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;do ix=1,nx+1&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_ay=-2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_by=2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;end do&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Nevertheless I will check it later today.&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
    <pubDate>Wed, 14 Mar 2012 11:05:48 GMT</pubDate>
    <dc:creator>Alexander_K_Intel2</dc:creator>
    <dc:date>2012-03-14T11:05:48Z</dc:date>
    <item>
      <title>Boundary conditions MKL Helholtz solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791105#M2223</link>
      <description>When creating a test program to solve the Poisson equation I obtained the wrong result when using the MKL Helmholtz solver. The basis for the test program was the example given in the link below: &lt;BR /&gt;&lt;A href="http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/appendices/mkl_appC_PLR.html" target="_blank"&gt;http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/appendices/mkl_appC_PLR.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I did make the following changes.&lt;BR /&gt;1: I saved the vector f as a 1-dimensional array instead of a 2D one as given in the example&lt;BR /&gt;2: In the example code, the following lines are used. xi=hx*(ix-1)/lx and yi=hy*(iy-1)/ly&lt;BR /&gt;Since ix is an integer, xi will always be rounded of to the nearest integer although it is defined as a double precision. Hence instead I used: xi=hx*real(ix-1)/lx and yi=hy*real(iy-1)/ly&lt;BR /&gt;3: In the example program q is set to 1. However to solve the Poisson equation q should be 0.0d0&lt;BR /&gt;&lt;BR /&gt;The core program can be found below&lt;BR /&gt;When applying Dirichlet boundary conditions everywhere, I manage to obtain the correct answer, however when applying Von Neumann boundary conditions, even on one side, the error is very large (maximum value for the error is 0.89. The core program can be found below. Does anyone have an idea where I went wrong?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The core program is now&lt;BR /&gt;ax=0.0d0&lt;BR /&gt;bx=1.0d0&lt;BR /&gt;ay=0.0d0&lt;BR /&gt;by=1.0d0&lt;BR /&gt;nx=gridx !gridx=10&lt;BR /&gt;ny=gridz !gridz=10&lt;BR /&gt;q=0.0d0&lt;BR /&gt;ipar(:)=0&lt;BR /&gt;dpar(:)=0.0d0&lt;BR /&gt;spar(:)=0.0d0&lt;BR /&gt;&lt;BR /&gt;dx=1.0d0/gridx&lt;BR /&gt;dz=1.0d0/gridz&lt;BR /&gt;lx=bx-ax&lt;BR /&gt;hx=lx/nx&lt;BR /&gt;ly=by-ay&lt;BR /&gt;hy=ly/ny&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;do iy=1,ny+1&lt;BR /&gt;do ix=1,nx+1&lt;BR /&gt;xi=hx*real(ix-1)/lx&lt;BR /&gt;yi=hy*real(iy-1)/ly&lt;BR /&gt;cx=sin(2.0d0*pi*xi)&lt;BR /&gt;cy=sin(2.0d0*pi*yi)&lt;BR /&gt;u(ix+(iy-1)*(nx+1))=cx*cy&lt;BR /&gt;f(ix+(iy-1)*(nx+1))=((8.0d0*pi*pi))*u(ix+(iy-1)*(nx+1))&lt;BR /&gt;u(ix+(iy-1)*(nx+1))=u(ix+(iy-1)*(nx+1))+1.0d0&lt;BR /&gt;end do&lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt;bd_ax(:)=1.0d0&lt;BR /&gt;bd_bx(:)=1.0d0&lt;BR /&gt;&lt;BR /&gt;!do iy=1,nx+1&lt;BR /&gt;!bd_ax=-2.0d0*pi*sin(2.0d0*pi*real(iy-1)/ny)&lt;BR /&gt;!bd_bx=2.0d0*pi*sin(2.0d0*pi*real(iy-1)/ny)&lt;BR /&gt;!end do&lt;BR /&gt;do ix=1,nx+1&lt;BR /&gt;bd_ay=-2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;bd_by=2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt;bd_ax(:)=1.0d0&lt;BR /&gt;bd_bx(:)=1.0d0&lt;BR /&gt;!bd_ay(:)=1.0d0&lt;BR /&gt;!bd_by(:)=1.0d0&lt;BR /&gt;&lt;BR /&gt;BCtype='DDNN'&lt;BR /&gt;ipar(:)=0&lt;BR /&gt;&lt;BR /&gt;! Initializing simple data structures of Poisson Library for 2D Helmholtz Solver&lt;BR /&gt;call d_init_Helmholtz_2D(ax, bx, ay, by, nx, ny, BCtype, q, ipar, dpar, stat)&lt;BR /&gt;if(stat.ne.0)then&lt;BR /&gt;write(*,*)'Double precision 2D Helmholtz example FAILED to compute the solution...'&lt;BR /&gt;end if&lt;BR /&gt;&lt;BR /&gt;! Computing the approximate solution of 2D Helmholtz problem&lt;BR /&gt;! between the Commit step and the subsequent call to the Solver routine!&lt;BR /&gt;! Otherwise the results may be wrong.&lt;BR /&gt;call d_commit_Helmholtz_2D(f, bd_ax, bd_bx, bd_ay, bd_by, xhandle, ipar, dpar, stat)&lt;BR /&gt;if(stat.ne.0)then&lt;BR /&gt;write(*,*)'Double precision 2D Helmholtz example FAILED to compute the solution...'&lt;BR /&gt;end if&lt;BR /&gt;&lt;BR /&gt;! NOTE: Boundary data stored in the arrays bd_ax, bd_bx, bd_ay, bd_by should not be changed&lt;BR /&gt;! between the Commit step and the subsequent call to the Solver routine!&lt;BR /&gt;call d_Helmholtz_2D(f, bd_ax, bd_bx, bd_ay, bd_by, xhandle, ipar, dpar, stat)&lt;BR /&gt;if(stat.ne.0)then&lt;BR /&gt;write(*,*)'Double precision 2D Helmholtz example FAILED to compute the solution...'&lt;BR /&gt;end if&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ix=3&lt;BR /&gt;&lt;BR /&gt;c1=0.0d0&lt;BR /&gt;do iy=1,ny+1&lt;BR /&gt;write(*,*) (ix-1)*hx,(iy-1)*hy,f(ix+(iy-1)*(ny+1))-u(ix+(iy-1)*(ny+1))&lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;do i=1,gridx+1&lt;BR /&gt;do j=1,gridz+1&lt;BR /&gt;write(*,*)i,j, 'ans',f((i)+(j-1)*(gridx+1)),u((i)+(j-1)*(gridx+1))&lt;BR /&gt;end do &lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt;pause&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2012 10:34:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791105#M2223</guid>
      <dc:creator>vdamme</dc:creator>
      <dc:date>2012-03-14T10:34:33Z</dc:date>
    </item>
    <item>
      <title>Boundary conditions MKL Helholtz solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791106#M2224</link>
      <description>Hi,&lt;DIV&gt;it's seem that you need to set&lt;/DIV&gt;&lt;DIV&gt;do ix=1,nx+1&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_ay&lt;I&gt;(i)&lt;/I&gt;=-2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_by&lt;I&gt;(i)&lt;/I&gt;=2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;end do&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;instead of&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;do ix=1,nx+1&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_ay=-2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;bd_by=2.0d0*pi*sin(2.0d0*pi*real(ix-1)/nx)&lt;BR /&gt;end do&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Nevertheless I will check it later today.&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Mar 2012 11:05:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791106#M2224</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2012-03-14T11:05:48Z</dc:date>
    </item>
    <item>
      <title>Boundary conditions MKL Helholtz solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791107#M2225</link>
      <description>Alexander.&lt;BR /&gt;&lt;BR /&gt;Thank you, that did the trick indeed&lt;BR /&gt;&lt;BR /&gt;Myron</description>
      <pubDate>Wed, 14 Mar 2012 12:35:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791107#M2225</guid>
      <dc:creator>vdamme</dc:creator>
      <dc:date>2012-03-14T12:35:32Z</dc:date>
    </item>
    <item>
      <title>Boundary conditions MKL Helholtz solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791108#M2226</link>
      <description>Dear Alexander&lt;BR /&gt;&lt;BR /&gt;I do now still have a problem when running the code with all Von Neumann boundary conditions. When I attempt this I get the following MKL Poisson Library warning:&lt;BR /&gt;The problem is degenerate up to rounding errors! the approximate solution that provides the mimimal Euclidian norm or the solution will be computed...&lt;BR /&gt;&lt;BR /&gt;An error is expected since an infinite number of solutions is possible when using 4 Von Neumann boundary conditions, however the gradients of the numerical solution should match the gradients found with the analytical solution. This seems not to be the case at the bottom left and bottom right corner of the computational domain. Everywhere else, the solution is OK. Do you have any idea how this larger error in the lower corner points (Error value of 0.18 on a 10x10 grid) is initiated and is there a way for me to prevent it. &lt;BR /&gt;&lt;BR /&gt;Thank you for the help&lt;BR /&gt;Myron&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2012 12:44:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791108#M2226</guid>
      <dc:creator>vdamme</dc:creator>
      <dc:date>2012-03-14T12:44:01Z</dc:date>
    </item>
    <item>
      <title>Boundary conditions MKL Helholtz solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791109#M2227</link>
      <description>When you obtain a finite-difference solution for a 2-D problem with discontinuities in the boundary conditions, you should go in with reasonable expectations. Typically, discontinuities are smoothed over a small region. As the mesh is made finer, this smoothed region becomes smaller. Just as an experiment cannot be set up with discontinuous boundary values, a finite-difference approximation will be inaccurate in regions of high (or infinite) gradients.&lt;BR /&gt;&lt;BR /&gt;If you want accurate solutions near a discontinuity, you should consider alternative methods of solution.&lt;BR /&gt;&lt;BR /&gt;It is often troublesome when contrived problems are solved numerically whose virtue is that a simple analytical solution is possible. The numerical solution should not be expected to have the same properties as a Fourier series solution (for example, convergence to the mean at a point of discontinuity).</description>
      <pubDate>Wed, 14 Mar 2012 14:08:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791109#M2227</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2012-03-14T14:08:10Z</dc:date>
    </item>
    <item>
      <title>Boundary conditions MKL Helholtz solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791110#M2228</link>
      <description>Hi Myron,&lt;DIV&gt;In case when you use only zero Neumann boundary condition the kernel space is not empty. Indifferential equation it is mean that gradients of all solutions are equal but it is not clear how to calculate gradient of grid solution. You can calculate numeriacal aproximation of gradients in each internal point of solution but what about boundary point? Could you explain how you calculate gradient of solution in corner points? &lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Mar 2012 16:31:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Boundary-conditions-MKL-Helholtz-solver/m-p/791110#M2228</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2012-03-14T16:31:08Z</dc:date>
    </item>
  </channel>
</rss>

