<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Dear developers,</span></p>
<p><br>
</p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I defined subdomain problems that have some layers of </span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">ghost points, which are exactly of </span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">the
"local</span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">" size of a DA.</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">And I want to generate the corresponding submatrix in each subdomain which contains those layers of ghost points.</span></p>
<p><br>
</p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I know that </span><span style="color: rgb(33, 33, 33); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">MatGetSubMatrices can return a submatrix when determining the
index set like PCASM, but how can I get the index set including those layers of ghost points? When a DA is setup, such IS for creating ltog mapping was already destroyed.</span></p>
<p><span style="color: rgb(33, 33, 33); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Or you may have some simpler way to get this?</span></p>
<p><span style="color: rgb(33, 33, 33); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<p><span style="color: rgb(33, 33, 33); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Bests,</span></p>
<p><span style="color: rgb(33, 33, 33); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Li Luo</span></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mark Adams <mfadams@lbl.gov><br>
<b>Sent:</b> Monday, 14 March, 2022 22:49:47<br>
<b>To:</b> liluo<br>
<b>Cc:</b> petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] How to obtain the local matrix from a global matrix in DMDA?</font>
<div> </div>
</div>
<div>
<div dir="ltr">You might want to explain what you want to do.
<div>A local vector has ghost values that you can use to compute local residuals. You don't usually want a matrix that conforms with this local vector.</div>
<div>You could get the global equations of the local vector and use MatCreateSubMatrix, but I think there is a better way to do what you want.</div>
<div><br>
</div>
<div>OK, Matt and Jed beat me</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Mar 14, 2022 at 10:35 AM liluo <<a href="mailto:liluo@um.edu.mo">liluo@um.edu.mo</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-3120542394385288429divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Dear developers,</p>
<p><br>
</p>
<p>I created a DMDA object and obtain the local vector from a global vector by using <span>DMGlobalToLocalBegin/End.</span></p>
<p>How can I obtain the corresponding local matrix from the global matrix? </p>
<p>In my case, the global matrix is of MPIBAIJ type created by <span>DMCreateMatrix(da,MATBAIJ,&A);</span><br>
<span></span></p>
<p><br>
</p>
<p>Bests,</p>
<p>LI</p>
<p><span></span></p>
<p><span><br>
</span></p>
<pre width="80"><strong><font color="#4169E1"><br></font></strong></pre>
<p></p>
<div id="gmail-m_-3120542394385288429Signature">
<div id="gmail-m_-3120542394385288429divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>