[petsc-users] Implementing periodicity using DMPlex
Shashwat Tiwari
shaswat121994 at gmail.com
Fri Jun 12 14:17:47 CDT 2020
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), 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200613/20428195/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 5575 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200613/20428195/attachment-0001.bin>
More information about the petsc-users
mailing list