[petsc-users] Question about DMDA BOUNDARY_CONDITION set

Barry Smith bsmith at mcs.anl.gov
Wed Mar 22 18:07:38 CDT 2017


  In the git repository branch barry/add-dmda-rotate-boundary-conditions-example  I have provided an example that does this.

  It uses DM_BOUNDARY_GHOSTED to reserve ghost locations along the physical boundaries in the local vector and then creates two VecScatter that fill the appropriate locations in these ghosted regions from the "providing location". It is in src/dm/examples/tests/ex6.c 

   Note that in computational work you will call both VecScatters and the DMGlobalToLocalBegin/End to update both the extra physical ghost points and the regular ghost points between MPI processes.

   Please let me know if you have any trouble with it.

   Barry

> On Mar 20, 2017, at 9:39 AM, Wenbo Zhao <zhaowenbo.npic at gmail.com> wrote:
> 
> Hi all.
> 
> I have a mesh is like below
> 
> 1  2  3
> 4  5  6
> 7  8  9
> 
> I use DACreate2d to create mesh partition.
> 
> In my case, I have an rotation boundary condition. The whole mesh is like below
> 
> 9 8 7   3 6 9
> 6 5 4   2 5 8
> 3 2 1   1 4 7
> 
> 7 4 1   1 2 3
> 8 5 2   4 5 6
> 9 6 3   7 8 9
> 
> It means that cell 2 near the top boundary are connected with cell 4 near the left boundary, cell 3 with cell 7.
> 
> How can I set boundary condition or set my matrix?
> 
> I am looking forward for your help!
> 
> BEST, 
> 
> Wenbo



More information about the petsc-users mailing list