<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Matt,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Thank you for your explanation. The new methodology is straightforward to implement. </span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Still, I have one more question . When I use the option -pc_fieldsplit_schur_precondition
full, PETSc computes internally the exact Schur complement matrix representation. Based on the example matrix that you send, the Schur complement is: S = -v^t (A^-1) u. How will PETSc will calculate the vector (A^-1) u ? Or it calculates the exact Schur complement
matrix differently?</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Thanks,</span></div>
<div class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Pantelis</span></div>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
</div>
<div id="appendonsend"></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>Από:</b> Matthew Knepley <knepley@gmail.com><br>
<b>Στάλθηκε:</b> Τρίτη, 23 Ιανουαρίου 2024 5:21 μμ<br>
<b>Προς:</b> Pantelis Moschopoulos <pmoschopoulos@outlook.com><br>
<b>Κοιν.:</b> Barry Smith <bsmith@petsc.dev>; petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Θέμα:</b> Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Tue, Jan 23, 2024 at 9:45 AM Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com">pmoschopoulos@outlook.com</a>> wrote:<br>
</div>
<div class="x_gmail_quote">
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg820823035896935608">
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Dear Matt,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">I read about the MATLRC. However, its correct usage is not clear to me so I have the following questions:</span></div>
<ol start="1">
<li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); list-style-type:"1) "">
<span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">The U and V input matrices should be created as dense using MatCreateDense?</span></li></ol>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Yes. If you have one row, it looks like a vector, or a matrix with one column.</div>
<div><br>
</div>
<div>If you have 1 row on the bottom, then</div>
<div><br>
</div>
<div> U = [0, 0, ..., 0, 1]</div>
<div> V = [the row]</div>
<div> C = [1]</div>
<div><br>
</div>
<div>will give you that. However, you have an extra row and column?</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg820823035896935608">
<div dir="ltr">
<ol start="1">
<li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); list-style-type:"2) "">
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">I use the command MatCreateLRC just to declare the matrix and then MatLRCSetMats to pass the values of the constituents?</span></div>
</li></ol>
</div>
</div>
</blockquote>
<div>You can use</div>
<div><br>
</div>
<div> MatCreate(comm, &M)</div>
<div> MatSetSizes(M, ...)</div>
<div> MatSetType(M, MATLRC)</div>
<div> MatLRCSetMats(M, ...) <br>
</div>
<div><br>
</div>
<div>However, you are right that it is a little more complicated, because A is not just the upper block here.</div>
<div><br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg820823035896935608">
<div dir="ltr">
<ol start="1">
<li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); list-style-type:"2) "">
</li></ol>
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Then, how do I proceed? How I apply the step of Sherman-Morrison-Woobury formula? I intend to use iterative solvers for
A (main matrix) so I will not have its A^-1 at hand which I think is what the Sherman-Morrison-Woobury formula needs.</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I think I was wrong. MatLRC is not the best fit. We should use MatNest instead. Then you could have</div>
<div><br>
</div>
<div> A u</div>
<div> v^t 0</div>
<div><br>
</div>
<div>as your matrix. We could still get an explicit Schur complement automatically using nested FieldSplit. So</div>
<div><br>
</div>
<div> 1) Make the MATNEST matrix as shown above</div>
<div><br>
</div>
<div> 2) Use PCFIELDSPLIT for it. This should be an easy IS, since there is only one row in the second one.</div>
<div><br>
</div>
<div> 3) Select the full Schur complement</div>
<div><br>
</div>
<div> -pc_type fieldsplit</div>
<div> -pc_fieldsplit_type schur</div>
-pc_fieldsplit_schur_fact_type full<br>
<div> -pc_fieldsplit_schur_precondition full</div>
<div><br>
</div>
<div> 4) Use a recursive FieldSplit (might be able to use -fieldsplit_0_pc_fieldsplit_detect_saddle_point)</div>
<div><br>
</div>
<div> -fieldsplit_0_pc_type fieldsplit</div>
<div> -fieldsplit_0_pc_fieldsplit_0_fields 0,1,2</div>
-fieldsplit_0_pc_fieldsplit_1_fields 3</div>
<div class="x_gmail_quote"><br>
</div>
<div class="x_gmail_quote">I think this does what you want, and should be much easier than getting MatLRC to do it.</div>
<div class="x_gmail_quote"><br>
</div>
<div class="x_gmail_quote"> Thanks,</div>
<div class="x_gmail_quote"><br>
</div>
<div class="x_gmail_quote"> Matt<br class="x_gmail-Apple-interchange-newline">
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_msg820823035896935608">
<div dir="ltr">
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Thanks,</span></div>
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Pantelis</span></div>
<div> </div>
<div id="x_m_820823035896935608Signature">
<div id="x_m_820823035896935608divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
</div>
<div id="x_m_820823035896935608appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_m_820823035896935608divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Από:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Στάλθηκε:</b> Τρίτη, 23 Ιανουαρίου 2024 3:20 μμ<br>
<b>Προς:</b> Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com" target="_blank">pmoschopoulos@outlook.com</a>><br>
<b>Κοιν.:</b> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>>;
<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Θέμα:</b> Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Tue, Jan 23, 2024 at 8:16 AM Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com" target="_blank">pmoschopoulos@outlook.com</a>> wrote:<br>
</div>
<div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Dear Matt,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thank you for your response. This is an idealized setup where I have only one row/column. Sometimes we might need two or even three constraints based on the application. Thus, I will pursue the user-defined IS.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Anything < 50 I would use MatLRC. The bottleneck is the inversion of a dense matrix of size k x k, where k is the number of constraints. Using an IS is definitely fine, but dense rows can detract from iterative convergence.</div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div dir="ltr">
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">When I supply the IS using the command PCFieldSplitSetIS, I do not specify anything in the matrix set up right?</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>You should just need to specify the rows for each field as an IS.</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div dir="ltr">
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Thanks,
<br>
</span></div>
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Pantelis<br>
</span></div>
<div id="x_m_820823035896935608x_m_-5273492796575530530Signature">
<div id="x_m_820823035896935608x_m_-5273492796575530530divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
</div>
<div id="x_m_820823035896935608x_m_-5273492796575530530appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div dir="ltr" id="x_m_820823035896935608x_m_-5273492796575530530divRplyFwdMsg"><span style="font-family:Calibri,sans-serif; font-size:11pt; color:rgb(0,0,0)"><b>Από:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Στάλθηκε:</b> Τρίτη, 23 Ιανουαρίου 2024 2:51 μμ<br>
<b>Προς:</b> Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com" target="_blank">pmoschopoulos@outlook.com</a>><br>
<b>Κοιν.:</b> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>>;
<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Θέμα:</b> Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT</span>
<div> </div>
</div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">On Tue, Jan 23, 2024 at 4:23 AM Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com" id="x_m_820823035896935608x_m_-5273492796575530530OWA0bb35ae1-4377-ea37-16e5-d213bc235f5f" target="_blank">pmoschopoulos@outlook.com</a>>
wrote:</span></div>
<blockquote style="margin:0px 0px 0px 0.8ex; padding-left:1ex; border-left:1px solid rgb(204,204,204)">
<div style="direction:ltr; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Dear Matt and Dear Barry,</div>
<div style="direction:ltr; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">I have some follow up questions regarding FieldSplit. </span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Let's assume that I solve again the 3D Stokes flow but now I have also a global constraint that
controls the flow rate at the inlet. Now, the matrix has the same unknowns as before, i.e. ux0,uy0,uz0,p0//ux1,uy1,uz1,p1//..., but the last line (and the last column) corresponds to the contribution of the global constraint equation. I want to incorporate
the last line (and last column) into the local block of velocities (split 0) and the pressure. The problem is how I do that. I have two questions:</span></div>
<ol start="1" style="direction:ltr; list-style-type:decimal">
<li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); direction:ltr">
<span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Now, the block size should be 5 in the matrix and vector creation for this problem?</span></li></ol>
</blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">No. Blocksize is only useful when the vector/matrix layout is completely regular, meaning _every_
block looks the same. Here you have a single row to be added in.</span></div>
<blockquote style="margin:0px 0px 0px 0.8ex; padding-left:1ex; border-left:1px solid rgb(204,204,204)">
<ol start="1" style="direction:ltr; list-style-type:decimal">
<li style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); direction:ltr">
<span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">I have to rely entirely on PCFieldSplitSetIS to create the two blocks? Can I augment simply the previously defined block 0
with the last line of the matrix?</span></li></ol>
</blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">If you want to add in a single row, then you have to specify the IS yourself since we cannot generate
it from the regular pattern.</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">However, if you know that you will only ever have a single constraint row (which I assume is fairly
dense), then I would suggest instead using MatLRC, which Jose developed for SLEPc. This handles the last row/col as a low-rank correction. One step of Sherman-Morrison-Woobury solves this exactly. It requires a solve for A, for which you can use FieldSplit
as normal.</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> Thanks,</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> Matt</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> </span></div>
<blockquote style="margin:0px 0px 0px 0.8ex; padding-left:1ex; border-left:1px solid rgb(204,204,204)">
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Up to this moment, I use the following commands to create the Field split:</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">ufields(3) = [0, 1, 2]<br>
pfields(1) = [3]</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">call PCSetType(pc, PCFIELDSPLIT, ierr)</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">call PCFieldSplitSetBlockSize(pc, 4,ierr)</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> call PCFieldSplitSetFields(pc, "0", 3, ufields, ufields,ierr)</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> call PCFieldSplitSetFields(pc, "1", 1, pfields, pfields,ierr)</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Thanks,</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Pantelis</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div id="x_m_820823035896935608x_m_-5273492796575530530x_m_-3462641011636893950Signature">
<div id="x_m_820823035896935608x_m_-5273492796575530530x_m_-3462641011636893950divtagdefaultwrapper" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
</div>
<div id="x_m_820823035896935608x_m_-5273492796575530530x_m_-3462641011636893950appendonsend">
</div>
<hr style="direction:ltr; display:inline-block; width:98%">
<div dir="ltr" id="x_m_820823035896935608x_m_-5273492796575530530x_m_-3462641011636893950divRplyFwdMsg">
<span style="font-family:Calibri,sans-serif; font-size:11pt; color:rgb(0,0,0)"><b>Από:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" id="x_m_820823035896935608x_m_-5273492796575530530OWA1dd8061b-9e70-52aa-8f36-5486331287dd" target="_blank">knepley@gmail.com</a>><br>
<b>Στάλθηκε:</b> Παρασκευή, 19 Ιανουαρίου 2024 11:31 μμ<br>
<b>Προς:</b> Barry Smith <<a href="mailto:bsmith@petsc.dev" id="x_m_820823035896935608x_m_-5273492796575530530OWA10c7918c-8c37-fd2f-9580-474232da7c4b" target="_blank">bsmith@petsc.dev</a>><br>
<b>Κοιν.:</b> Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com" id="x_m_820823035896935608x_m_-5273492796575530530OWA2dedc01b-a413-7fc8-f7b2-bcaf8abadc0b" target="_blank">pmoschopoulos@outlook.com</a>>;
<a href="mailto:petsc-users@mcs.anl.gov" id="x_m_820823035896935608x_m_-5273492796575530530OWA3a97493d-4234-6a48-666e-cd83d5592b42" target="_blank">
petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" id="x_m_820823035896935608x_m_-5273492796575530530OWAb3f6c5ea-26df-6678-b94f-13cad3bac763" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Θέμα:</b> Re: [petsc-users] Question about a parallel implementation of PCFIELDSPLIT</span>
<div> </div>
</div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">On Fri, Jan 19, 2024 at 4:25 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" id="x_m_820823035896935608x_m_-5273492796575530530OWAe0edb880-f66d-945d-0a72-132eb4014cb6" target="_blank">bsmith@petsc.dev</a>>
wrote:</span></div>
<blockquote style="margin:0px 0px 0px 0.8ex; padding-left:1ex; border-left:1px solid rgb(204,204,204)">
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> Generally fieldsplit is used on problems that have a natural "split" of the variables into two
or more subsets. For example u0,v0,u1,v1,u2,v2,u3,v4 This is often indicated in the vectors and matrices with the "blocksize" argument, 2 in this case. DM also often provides this information. </span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> When laying out a vector/matrix with a blocksize one must ensure that an equal number of of the
subsets appears on each MPI process. So, for example, if the above vector is distributed over 3 MPI processes one could use u0,v0,u1,v1 u2,v2 u3,v3 but one cannot use u0,v0,u1 v1,u2,v2 u3,v3. Another way to think about it is that one must
split up the vector as indexed by block among the processes. For most multicomponent problems this type of decomposition is very natural in the logic of the code.</span></div>
</blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">This blocking is only convenient, not necessary. You can specify your own field division using PCFieldSplitSetIS().</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> Thanks,</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> Matt</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> </span></div>
<blockquote style="margin:0px 0px 0px 0.8ex; padding-left:1ex; border-left:1px solid rgb(204,204,204)">
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> Barry</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"> </span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">On Jan 19, 2024, at 3:19 AM, Pantelis Moschopoulos <<a href="mailto:pmoschopoulos@outlook.com" id="x_m_820823035896935608x_m_-5273492796575530530OWAc9999050-e32e-9552-b581-2d3c3ab0d52c" target="_blank">pmoschopoulos@outlook.com</a>>
wrote:</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; font-weight:400">
<span style="letter-spacing:normal; color:rgb(0,0,0)">Dear all,</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; font-weight:400">
<span style="letter-spacing:normal; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Helvetica; font-size:18px; font-weight:400">
<span style="letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">When I am using PCFIELDSPLIT and pc type "schur" in serial mode everything works fine. When I turn now
to parallel, I observe that the number of ranks that I can use must divide the number of N without any remainder, where N is the number of unknowns. Otherwise, an error of the following form emerges: "Local columns of A10 3473 do not equal local rows of A00
3471".</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Helvetica; font-size:18px; font-weight:400">
<span style="letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Helvetica; font-size:18px; font-weight:400">
<span style="letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Can I do something to overcome this?</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Helvetica; font-size:18px; font-weight:400">
<span style="letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Helvetica; font-size:18px; font-weight:400">
<span style="letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Thanks,</span></div>
<div style="direction:ltr; text-align:left; white-space:normal; letter-spacing:normal; font-family:Helvetica; font-size:18px; font-weight:400">
<span style="letter-spacing:normal; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Pantelis</span></div>
</blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
</blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">--</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">What most experimenters take for granted before they begin their experiments is infinitely more
interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><a href="http://www.cse.buffalo.edu/~knepley/" id="x_m_820823035896935608x_m_-5273492796575530530OWA1287698b-8732-c37b-1e96-69cca82d74cf" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></span></div>
</blockquote>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">--</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">What most experimenters take for granted before they begin their experiments is infinitely more
interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br>
</span></div>
<div style="direction:ltr"><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><a href="http://www.cse.buffalo.edu/~knepley/" id="x_m_820823035896935608x_m_-5273492796575530530OWA85a7251d-1ad7-c199-9fc4-fd8e74ea3d1e" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></span></div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span>-- </span><br>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span class="x_gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>