[petsc-users] ghoat point in DMDATSSetIFunctionLocal
Smith, Barry F.
bsmith at mcs.anl.gov
Thu Jun 28 18:50:44 CDT 2018
When you create the DMDA there is a "stencil" argument that can be star or box. For the 9 pt stencil you need to specify box.
Barry
> On Jun 28, 2018, at 5:11 PM, Sepideh Kavousi <skavou1 at lsu.edu> wrote:
>
> Hello,
> I am solving Cahn-Hillard equation where I have Laplacian in my equation. In order to discretize the Laplacian, I can discretize with 5-point or 9-point stencil.
> 5 point stencile: laplacian=(aY[j][i+1].p+aY[j][i-1].p-2.0*aY[j][i].p)/(hx2))+((aY[j+1][i].p+aY[j-1][i].p-2.0*aY[j][i].p)/hy2)
>
> 9-point stencil:(4.0*(aY[j][i+1].p+aY[j][i-1].p+aY[j+1][i].p+aY[j-1][i].p)+1.0*(aY[j+1][i+1].p+aY[j+1][i-1].p+aY[j-1][i+1].p+aY[j-1][i-1].p)-20.0*aY[j][i].p)/(6.0*hx2);
>
>
> I use DMDATSSetIFunctionLocal. In the function definition, if I use 5 point stencil, everything works fine, if I use a 9-point stencil, at the points which are in common between processors the answers behave strange and wrong. while for 9-point stencil, I use single processor everything works fine.
> Assume I have 4 processors and the domain that belongs to each processor is:
> (0:nx , 0:ny) process one
> (nx+1:2nx , 0:ny) process two
> (0:nx , ny+1:2*ny) process three
> (nx+1:2nx , ny+1:2*n) process four
>
> I guess the problem is when processor one tries to access point (nx+1,ny+1). I did not find any data if the definition of local vector includes the point (nx+1,ny+1) for this processor or not. I would like to see how should I solve this issue.
>
> Regards,
> Sepideh
More information about the petsc-users
mailing list