<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;
        mso-fareast-language:EN-US;}
span.s1
        {mso-style-name:s1;
        color:#6C36A9;}
span.s2
        {mso-style-name:s2;
        color:#326D74;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:none;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have so far solved scalar field problems using finite elements on a given (<b>unstructured</b>) mesh. I made use of
<span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">MATMPIAIJ</span> to create matrixes,
<span class="s1">MatCreateVecs</span>(<span class="s2">A</span>, &<span class="s2">b</span>, &<span class="s2">x</span>) to create vectors, and
<span style="color:#6C36A9;mso-ligatures:none;mso-fareast-language:EN-GB">MatZeroRowsColumnsIS
</span>to set boundary conditions.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">Now, I would like to solve a coupled system of equations for the quantities u1 and u2 on the
</span><span style="color:black">(<b>unstructured</b>)  </span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">mesh. I.e., the matrix should get the double number of rows and columns,
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">A = [A00  A01
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">        A10  A11]<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">the vectors contain twice the number of entries (e.g. first all u1s and then all u2s). I would like to be sure that the entries of u1 and u2,
 which are associated with the same element are located on the same processor.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">Is a pre-defined structure already available within PETSc to enlarge such a single equation to store the entries of coupled equations?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-\Delta u_1+c_{11} u_1+c_{12} u_2=f_1<o:p></o:p></p>
<p class="MsoNormal">-\Delta u_2+c_{21} u_1+c_{22} u_2=f_2<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="background:white"><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">Would I still be able to use
</span><span style="color:#6C36A9;mso-ligatures:none;mso-fareast-language:EN-GB">MatZeroRowsColumnsIS
</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">u1 and u2 independently to enforce boundary conditions?
</span><span style="color:#6C36A9;mso-ligatures:none;mso-fareast-language:EN-GB">MatZeroRowsColumnsIS</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">(</span><span style="color:#326D74;mso-ligatures:none;mso-fareast-language:EN-GB">A</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">,
</span><span style="color:#326D74;mso-ligatures:none;mso-fareast-language:EN-GB">is</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">,
</span><span style="color:#1C00CF;mso-ligatures:none;mso-fareast-language:EN-GB">1</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">,
</span><span style="color:#326D74;mso-ligatures:none;mso-fareast-language:EN-GB">x</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">,
</span><span style="color:#326D74;mso-ligatures:none;mso-fareast-language:EN-GB">b</span><span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">);<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don’t know where to begin. I have so far only been exposed to using
<span style="color:black;mso-ligatures:none;mso-fareast-language:EN-GB">MATMPIAIJ and MatSetValues to create and assign values to matrix entries respectively.
</span>I would be grateful if you could provide the stepwise guide.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards,</p>
<p class="MsoNormal">Karthik.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="mso-ligatures:none;mso-fareast-language:EN-GB">-- <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#2D2D62;mso-ligatures:none;mso-fareast-language:EN-GB">Karthik Chockalingam, Ph.D.<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:EN-GB">Senior Research Software Engineer</span><span style="font-size:10.5pt;color:black;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:EN-GB">High Performance Systems Engineering Group</span><span style="font-size:10.5pt;color:black;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:EN-GB">Hartree Centre | Science and Technology Facilities Council</span><span style="font-size:10.5pt;color:black;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#212121;mso-ligatures:none;mso-fareast-language:EN-GB"><a href="mailto:karthikeyan.chockalingam@stfc.ac.uk">karthikeyan.chockalingam@stfc.ac.uk</a></span><span style="color:#212121;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black;mso-ligatures:none;mso-fareast-language:EN-GB"> </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#414141;mso-ligatures:none;mso-fareast-language:EN-GB"> </span><span style="color:#212121;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#414141;mso-ligatures:none;mso-fareast-language:EN-GB"> </span></b><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-ligatures:none;mso-fareast-language:EN-GB"><img border="0" width="254" height="116" style="width:2.6458in;height:1.2083in" id="Picture_x0020_1" src="file:////Users/karthikeyan.chockalingam/Library/Containers/com.microsoft.Outlook/Data/Library/Caches/Signatures/signature_1995467923" alt="signature_3970890138"></span><span style="color:#212121;mso-ligatures:none;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>