[petsc-users] Implementing periodicity using DMPlex
Matthew Knepley
knepley at gmail.com
Sat Jun 13 18:41:28 CDT 2020
On Fri, Jun 12, 2020 at 3:19 PM Shashwat Tiwari <shaswat121994 at gmail.com>
wrote:
> Hi,
> I am writing a first order 2D solver for unstructured grids with periodic
> boundaries using DMPlex. After generating the mesh, I use
> "DMSetPeriodicity" function to set periodicity in both directions. After
> which I partition the mesh (DMPlexDistribute), construct ghost cells
> (DMPlexConstructGhostCells),
>
These ghost cells are for FVM boundary conditions. If you want cells to be
shared across parallel partitions, then you want to give overlap=1
to DMPlexDIstribute(). Is that what you want?
Thanks,
Matt
> create a section, and set some initial values in the global vector. Then I
> use "VecGhostUpdateBegin" to start updating the boundary ghost cell values,
> but, I get the following error in case I use multiple processors:
>
> [0]PETSC ERROR: Invalid argument
> [0]PETSC ERROR: Vector is not ghosted
> [0]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
>
> if I run with a single process, there is no error but the values remain
> empty (zero) and are not updated. Kindly let me know, if I am missing some
> crucial step before I can update the ghost values in order to implement the
> periodic bc, or if there is any other approach to achieve it. I am
> attaching a small code to demonstrate the issue for your reference.
>
> Regards,
> Shashwat
>
--
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
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200613/8d3bcf9b/attachment.html>
More information about the petsc-users
mailing list