[petsc-users] DMSWARM with DMDA and KSP

Matthew Young myoung.space.science at gmail.com
Sun Apr 30 12:12:00 CDT 2023


Hi all,

I am developing a particle-in-cell code that models ions as particles and
electrons as an inertialess fluid. I use a PIC DMSWARM for the ions, which
I gather into density and flux before solving a linear system for the
electrostatic potential (phi). I currently have one DMDA with 5 degrees of
freedom -- one each for density, 3 flux components, and phi.

When setting up the linear system to solve for phi, I've been following
examples like KSP ex34.c and ex42.c when writing the KSP operator and RHS
functions but I'm not sure I have the right approach, since 4 of the DOFs
are known and 1 is unknown.

I saw this thread
<https://lists.mcs.anl.gov/pipermail/petsc-users/2016-November/031031.html>
that recommended using DMDAGetReducedDMDA, which I gather has been
deprecated in favor of DMDACreateCompatibleDMDA. Is that a good approach
for managing a regular grid with known and unknown quantities on each node?
Could a composite DM be useful? Has anyone else worked on a problem like
this?

--Matt
==========================
Matthew Young, PhD (he/him)
Research Scientist II
Space Science Center
University of New Hampshire
Matthew.Young at unh.edu
==========================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230430/3c8d86a7/attachment.html>


More information about the petsc-users mailing list