[petsc-dev] Note about CPR preconditioner in PCFIELDSPLIT man page?
Mills, Richard Tran
rtmills at anl.gov
Sun Mar 3 23:50:07 CST 2019
On 3/3/19 8:21 PM, Jed Brown wrote:
"Mills, Richard Tran" <rtmills at anl.gov><mailto:rtmills at anl.gov> writes:
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.
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.
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.
--Richard
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 <knepley at gmail.com><mailto:knepley at gmail.com><mailto:knepley at gmail.com><mailto:knepley at gmail.com> writes:
On Sun, Mar 3, 2019 at 12:58 AM Jed Brown via petsc-dev <
petsc-dev at mcs.anl.gov<mailto:petsc-dev at mcs.anl.gov><mailto:petsc-dev at mcs.anl.gov><mailto:petsc-dev at mcs.anl.gov>> 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);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190304/283e5146/attachment.html>
More information about the petsc-dev
mailing list