<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Folks,<br>
<br>
There is a note in the PCFIELDSPLIT manual page about implementing a so-called "Constrained Pressure Residual" (CPR) preconditioner:<br>
<br>
<span style="color: rgb(0, 0, 0); font-family: Times; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial; display: inline
      !important; float: none;">"The
 Constrained Pressure Preconditioner (CPR) can be implemented using<span> </span></span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCCOMPOSITE.html#PCCOMPOSITE" style="font-family: Times; font-size: medium; font-style: normal;
      font-variant-ligatures: normal; font-variant-caps: normal;
      font-weight: 400; letter-spacing: normal; orphans: 2; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width:
      0px; background-color: rgb(255, 255, 255);">PCCOMPOSITE</a><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium;
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial; display: inline
      !important; float: none;"><span> </span>with<span> </span></span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCGALERKIN.html#PCGALERKIN" style="font-family: Times; font-size: medium; font-style: normal;
      font-variant-ligatures: normal; font-variant-caps: normal;
      font-weight: 400; letter-spacing: normal; orphans: 2; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width:
      0px; background-color: rgb(255, 255, 255);">PCGALERKIN</a><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium;
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial; display: inline
      !important; float: none;">.
 CPR first solves an R A P subsystem, updates the residual on all variables (</span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCCompositeSetType.html#PCCompositeSetType" style="font-family: Times; font-size: medium; font-style: normal;
      font-variant-ligatures: normal; font-variant-caps: normal;
      font-weight: 400; letter-spacing: normal; orphans: 2; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width:
      0px; background-color: rgb(255, 255, 255);">PCCompositeSetType</a><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium;
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial; display: inline
      !important; float: none;">(pc,</span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCCompositeType.html#PCCompositeType" style="font-family: Times; font-size: medium; font-style: normal;
      font-variant-ligatures: normal; font-variant-caps: normal;
      font-weight: 400; letter-spacing: normal; orphans: 2; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width:
      0px; background-color: rgb(255, 255, 255);">PC_COMPOSITE_MULTIPLICATIVE</a><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium;
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial; display: inline
      !important; float: none;">)),
 and then applies a simple ILU like preconditioner on all the variables."</span><br>
<br>
I'm not sure why there is a reference to PCGALERKIN in there. Although CPR *is* using a Galerkin-type projection, I believe that this can all be set up on the command line by using PCFIELDSPLIT and PCCOMPOSITE. It seems that CPR preconditioners are defined
 in a few different ways, but I believe I can set up something like this in PFLOTRAN (where field 0 is pressure, 1 saturation, and 2 is temperature) by doing something like this:<br>
<br>
<tt>-flow_ksp_type fgmres -flow_pc_type composite \</tt><tt><br>
</tt><tt>-flow_pc_composite_type multiplicative -flow_pc_composite_pcs fieldsplit,bjacobi \</tt><tt><br>
</tt><tt>-flow_sub_0_ksp_type fgmres -flow_sub_0_pc_fieldsplit_type additive \</tt><tt><br>
</tt><tt>-flow_sub_0_pc_fieldsplit_0_fields 0 -flow_sub_0_pc_fieldsplit_1_fields 1,2 \</tt><tt><br>
</tt><tt>-flow_sub_0_fieldsplit_0_ksp_type richardson -flow_sub_0_fieldsplit_1_ksp_type preonly \</tt><tt><br>
</tt><tt>-flow_sub_0_fieldsplit_0_pc_type hypre -flow_sub_0_fieldsplit_0_pc_hypre_type boomeramg \</tt><tt><br>
</tt><tt>-flow_sub_0_fieldsplit_1_pc_type none -flow_sub_0_fieldsplit_1_sub_pc_type none \</tt><tt><br>
</tt><tt>-flow_sub_0_fieldsplit_1_ksp_max_it 10 -flow_sub_1_sub_pc_type ilu</tt><br>
<br>
Am I missing something? If the above setup is correct, it seems like the mention of PCGALERKIN is a bit confusing, since this is the PCFIELDSPLIT man page.<br>
<br>
--Richard<br>
</body>
</html>