[petsc-users] explanations on DM_BOUNDARY_PERIODIC
Matthew Knepley
knepley at gmail.com
Thu Apr 27 09:15:56 CDT 2017
On Thu, Apr 27, 2017 at 3:46 AM, neok m4700 <neok.m4700 at gmail.com> wrote:
> Hi,
>
> I am trying to change my problem to using periodic boundary conditions.
>
> However, when I use DMDASetUniformCoordinates on the DA, the spacing
> changes.
>
> This is due to an additional point e.g. in dm/impls/da/gr1.c
>
> else if (dim == 2) {
> if (bx == DM_BOUNDARY_PERIODIC) hx = (xmax-xmin)/(M);
> else hx = (xmax-xmin)/(M-1);
> if (by == DM_BOUNDARY_PERIODIC) hy = (ymax-ymin)/(N);
> else hy = (ymax-ymin)/(N-1);
>
> I don't understand the logic here, since xmin an xmax refer to the
> physical domain, how does changing to a periodic BC change the
> discretization ?
>
> Could someone clarify or point to a reference ?
>
Just do a 1D example with 3 vertices. With a normal domain, you have 2 cells
1-----2-----3
so each cell is 1/2 of the domain. In a periodic domain, the last vertex is
connected to the first, so we have 3 cells
1-----2-----3-----1
and each is 1/3 of the domain.
Matt
> Thanks
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170427/f4c94637/attachment.html>
More information about the petsc-users
mailing list