<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 3/3/19 8:21 PM, Jed Brown wrote:<br>
</div>
<blockquote type="cite" cite="mid:87wolfw9qo.fsf@jedbrown.org">
<pre class="moz-quote-pre" wrap="">"Mills, Richard Tran" <a class="moz-txt-link-rfc2396E" href="mailto:rtmills@anl.gov"><rtmills@anl.gov></a> writes:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Alright, I see the source of my confusion: I've now seen three different that are all called a "Constrained Pressure Residual" preconditioner. What I have generally seen is exactly what Matt describes: R is just a restriction to a subset of DoFs (pressure, and sometimes saturation), and P is just R' (using Matlab notation here). A CPR preconditioner in which P differs from R' is not something I've seen until now.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Please read the code again. P = R' for this case, but R is restriction to the sum of field components, not a subset of the variables.</pre>
</blockquote>
Oops -- yes, I see. Thanks, Jed. Elsewhere that I've seen a CPR preconditioner used, the restriction is only to a subset of the variables. In that case, the preconditioner can be constructed with only PCFIELDSPLIT and PCCOMPOSITE, but in the case described
in the email messages to Barry, I do see that PCGALERKIN is needed.<br>
<br>
--Richard<br>
<blockquote type="cite" cite="mid:87wolfw9qo.fsf@jedbrown.org">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">I'll see if I can think of a succinct change to the documentation for PCFIELDSPLIT to describe the two cases and submit a pull request.
--Richard
On 3/3/19 8:38 AM, Jed Brown wrote:
Matthew Knepley <a class="moz-txt-link-rfc2396E" href="mailto:knepley@gmail.com"><knepley@gmail.com></a><a class="moz-txt-link-rfc2396E" href="mailto:knepley@gmail.com"><mailto:knepley@gmail.com></a> writes:
On Sun, Mar 3, 2019 at 12:58 AM Jed Brown via petsc-dev <
<a class="moz-txt-link-abbreviated" href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a><a class="moz-txt-link-rfc2396E" href="mailto:petsc-dev@mcs.anl.gov"><mailto:petsc-dev@mcs.anl.gov></a>> wrote:
My take is that someone looking for CPR is more likely to end up on the
PCFIELDSPLIT manual page than the PCGALERKIN page. The solver you have
configured in your mail is not the CPR we have been asked about here.
See Barry's message and example code below.
Thanks for retrieving this Jed. I am sure Richard and I both have the same
question. Perhaps I am being an idiot.
I am supposing that R is just a restriction to some subset of dofs, so its
just binary, so that R A P just selects that
submatrix.
Look at the source. These are not subsets:
/*
Apply the restriction operator for the Galkerin problem
*/
PetscErrorCode ApplyR(Mat A, Vec x,Vec y)
{
PetscErrorCode ierr;
PetscInt b;
PetscFunctionBegin;
ierr = VecGetBlockSize(x,&b);CHKERRQ(ierr);
ierr = VecStrideGather(x,0,y,INSERT_VALUES);CHKERRQ(ierr);
for (PetscInt k=1;k<b;++k) {ierr = VecStrideGather(x,k,y,ADD_VALUES);CHKERRQ(ierr);}
PetscFunctionReturn(0);
}
/*
Apply the interpolation operator for the Galerkin problem
*/
PetscErrorCode ApplyP(Mat A, Vec x,Vec y)
{
PetscErrorCode ierr;
PetscInt offset = 1;
PetscFunctionBegin;
ierr = VecStrideScatter(x,offset,y,INSERT_VALUES);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
</pre>
</blockquote>
</blockquote>
<br>
</body>
</html>