[petsc-users] A Question about Boundary Condition

Matthew Knepley knepley at gmail.com
Thu Nov 8 17:09:50 CST 2012


On Thu, Nov 8, 2012 at 3:49 PM, Zhenglun (Alan) Wei
<zhenglun.wei at gmail.com> wrote:
> Dear all,
> I hope you're having a nice day.
> I'm working on the /src/ksp/ksp/example/tutorial/ex45.c right now and
> came across a problem with the boundary condition.
> It calls 'DMDACreate3d' in order to generate a structured mesh. However,
> it adopts 'DMDA_BOUNARY_NONE' for the ghost point along x, y, z
> direction. I wonder how does this work for the Neumann BC? What does the
> solver do when it calculate those points adjacent to the boundary point.
> I support it should have one layer ghost point in order to implement the
> Newmann BC.

It does it by hand, shortening the solve domain accordingly.

> BTW, if I want to use the periodic BC in this case, should I just change
> 'DMDA_BOUNDARY_NONE' to 'DMDA_BONDARY_PERIODIC' in the direction that
> the periodic BC is applied?

Yes, it you want periodic, use BOUNDARY_PERIODIC.

   Matt

> thanks,
> Alan



--
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


More information about the petsc-users mailing list