<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 10/10/2025 16:39, Matthew Knepley
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAMYG4GnzrogafZ-FiT2Zj8EXn1k_MN1oDNwT3q6zvoFZkao9Tw@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">On Fri, Oct 10, 2025 at 9:48 AM Matteo Semplice
via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" moz-do-not-send="true" class="moz-txt-link-freetext">petsc-users@mcs.anl.gov</a>>
wrote:</div>
<div class="gmail_quote gmail_quote_container">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear
all,<br>
<br>
I am wondering if there is a way to extract a subset of
a DMDA and <br>
use it as a mesh. The use case is to program a
finite-difference method <br>
in which the domain is defined by a levelset function: if I
could <br>
completely ignore the parts of the background DMDA that are
"far away" <br>
from the object, I guess I would avoid some cores having
almost no <br>
workload. I figure that I could setup a DMDA, load/compute
the levelset <br>
on the entire box, then mark the nodes to be retained,
extract the <br>
submesh and repartition it. I would also need a mean to
transfer some <br>
Vec data from the DMDA to the new mesh.<br>
<br>
I guess that the extracted mesh would then become a DMPlex
and it would <br>
not retain any DMDA flavour (like notions of which are the
grid nodes <br>
sitting on top/bottom, left/right of a given node), right?<br>
</blockquote>
<div><br>
</div>
<div>If you are planning on extracting a Plex anyway, I think
it would be easier to just</div>
<div>start with a Cartesian Plex, instead of a DA, and use
DMPlexCreateSubmesh(). <br>
</div>
</div>
</div>
</blockquote>
<p>Hmmm... doable, but I have a couple of questions.<br>
</p>
<p>By Cartesian Plex you mean a Plex created by DMPlexCreateBoxMesh
with simplex=false, right? And, could you point me to the routines
that can perform data tranfer from Vecs associated to the DM to
the ones asscoiated to the subDM? Is DMPlexGetSubpointIS the way
to go?<br>
</p>
<p>Next, I will load the levelsets from the output of another code
that is DA-based and that I'd really like to reuse some code in
the setup phase which relies on the DA indexing. So maybe I'd
rather, create the DMDA and the associated Vecs, do the setup
phase, then DMConvert the DMDA to a "large" DMPlex that covers the
entire box, transfer the DA Vecs to the "large" Plex vectors and
then extract the submesh. Would this be feasible? If so, can you
point me to the routines to transfer the vecs from the dmda to the
large plex?</p>
<p>Thanks</p>
<p> Matteo<br>
</p>
</body>
</html>