<div style="white-space:pre-wrap">When you create the DMDA, set the number of DOFs (degrees of freedom) per point to be 2 instead of 1. <br><br>You must be using and ancient version of petsc given the function names you quoted. Consider upgrading to 3.7<br><br>Thanks,<br>  Dave</div><br><div class="gmail_quote"><div dir="ltr">On Thu, 24 Nov 2016 at 20:24, Rolf Kuiper <<a href="mailto:kuiper@mpia.de">kuiper@mpia.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">Dear PETSc users,</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">maybe this is an easy question, but I can’t find the information right away in the user’s guide nor online.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">What I am currently doing and which works fine:</div><div class="gmail_msg">To solve a partial differential equation for the quantity q on a parallel distributed grid, which is represented by the Distributed Array MyDA, I am currently creating the associated sparse matrix for the KSP solver via</div><div class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">DAGetMatrix(MyDA, MATMPIAIJ, &MyMatrix);</span></div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The solution vector and right hand side vector are created via</div><div class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">DACreateGlobalVector(MyDA, &MyRightHandSideVector);</span></div></div><div class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">VecDuplicate(MyRightHandSideVector, &GlobalSolutionVector);</span></div></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The DA is constructed using <span style="font-family:Menlo;font-size:11px;font-variant-ligatures:no-common-ligatures" class="gmail_msg">DACreate3d()</span><span style="font-family:Menlo;font-size:11px" class="gmail_msg"> </span>with the corresponding regular structured grid information. </div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">And here is my problem:</div><div class="gmail_msg">Now, I would like to solve a coupled system of equations for the quantities q1 and q2 on the same grid. I.e., the matrix should just get the double number of rows and columns, the vectors contain twice the number of entries (e.g. first all q1s and then all q2s). And I would like to be sure that the entries of q1 and q2, which are associated with the same grid cell are located on the same processor.</div><div class="gmail_msg">Is there already a pre-defined structures available (such as <span style="font-family:Menlo;font-size:11px" class="gmail_msg">MATMPIAIJ</span>) within PETSc to enlarge such a single equation to store the entries of coupled equations? Such as</div><div class="gmail_msg"><span style="font-family:Menlo;font-size:11px" class="gmail_msg">DACreateTwiceTheGlobalVector()</span>?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The equation is (simplified) of the form</div><div class="gmail_msg">d/dt q1 + grad q2 = 0</div><div class="gmail_msg">d/dt q2 + f(q1) = 0</div><div class="gmail_msg">with an arbitrary function f depending on q1.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks a lot for your help in advance,</div><div class="gmail_msg">Rolf</div></div></blockquote></div>