<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font size="-1" face="Arial, sans-serif"><span style="font-size:
10pt;">Dear PETSc developers/users,</span></font><br>
<font size="-1" face="Arial, sans-serif">
</font><br>
<font size="-1" face="Arial, sans-serif"><span style="font-size:
10pt;">I’m solving linear PDEs on a regular grid with high-order
finite differences, assembling an MPIAIJ matrix to solve linear
systems or eigenvalue problems. I’ve been using vertex major,
natural ordering for the parallelism with PetscSplitOwnership
(yielding rectangular slices of the physical domain) and wanted
to move to DMDA to have a more square-ish domain decomposition
and minimize communication between processes.</span></font><br>
<font size="-1" face="Arial, sans-serif"><span style="font-size:
10pt;"></span></font><br>
<font size="-1" face="Arial, sans-serif"><span style="font-size:
10pt;">However, my application is memory critical, and I have
finely-tuned matrix preallocation routines for allocating memory
“optimally”. It seems the memory of a DMDA matrix is allocated
along the value of the stencil width of DMDACreate and the
manual says about it</span></font><br>
<font size="-1" face="Arial, sans-serif">
</font><br>
<font size="-1" face="Arial, sans-serif"><span style="font-size:
10pt;">“</span>These DMDA stencils have nothing directly to do
with any finite difference stencils one might chose to use for a
discretization”</font><br>
<font size="-1" face="Arial, sans-serif">
</font><br>
<font size="-1" face="Arial, sans-serif">And despite reading the
manual pages there must be something I do not understand in the DM
topology, what is that "stencil width" for then? I will not use
ghost values for my FD-method, right?</font><br>
<br>
<font size="-1" face="Arial, sans-serif">I was then wondering if I
could just create a MPIAIJ matrix, and with a PETSc routine get
the global indices of the domain for each process: in other words,
an equivalent of PetscSplitOwnership that gives me the DMDA
unknown ordering. So I can feed and loop on that in my
preallocation and assembly routines.</font><br>
<font size="-1" face="Arial, sans-serif">
</font><br>
<font size="-1" face="Arial, sans-serif">T</font><font size="-1"
face="Arial, sans-serif">hanks very much,<span style="font-size:
10pt;"></span></font><br>
<font size="-1" face="Arial, sans-serif"><span style="font-size:
10pt;"> </span></font><br>
<font size="-1" face="Arial, sans-serif">
<span style="font-size: 10pt;">Thibaut</span></font>
</body>
</html>