<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p class="ds-markdown-paragraph"><span>Dear PETSc community</span><span>,</span></p>
    <p class="ds-markdown-paragraph"><span>Our research group is
        employing the PETSc libraries within a Fortran-based finite
        element (FE) code to solve large-scale, coupled multi-physics
        problems. The systems of interest typically involve more than
        two primary fields, specifically displacements (</span><strong><span>U</span></strong><span>),
        water pressure (</span><strong><span>W</span></strong><span>),
        gas pressure (</span><strong><span>G</span></strong><span>), and
        temperature (</span><strong><span>T</span></strong><span>).</span></p>
    <p class="ds-markdown-paragraph"><span>We have recently integrated
        the </span><code>FieldSplit</code><span> preconditioner into
        our solver pipeline and have achieved successful results on a 3D
        gas injection reservoir simulation model comprising
        approximately 130,000 nodes. The indices for each field variable
        were defined using </span><code>ISCreateGeneral</code><span>,
        and the splits were established via </span><code>PCFieldSplitSetIS</code><span>
        (one split per variable). The following command-line options
        were utilized effectively for this case:</span></p>
    <p>-ksp_type gmres -ksp_gmres_modifiedgramschmidt \<br>
      -pc_type fieldsplit -pc_fieldsplit_type schur \<br>
      -pc_fieldsplit_schur_fact_type lower \<br>
      -pc_fieldsplit_schur_precondition selfp \<br>
      -fieldsplit_U_ksp_type preonly \<br>
      -fieldsplit_U_pc_type hypre \<br>
      -fieldsplit_U_pc_hypre_type boomeramg \<br>
      -fieldsplit_U_pc_hypre_boomeramg_coarsen_type PMIS \<br>
      -fieldsplit_U_pc_hypre_boomeramg_strong_threshold 0.6 \<br>
      -fieldsplit_U_pc_hypre_boomeramg_max_levels 25  <br>
      -fieldsplit_G_ksp_type preonly \<br>
      -fieldsplit_G_pc_type hypre \<br>
      -fieldsplit_G_pc_hypre_type boomeramg \<br>
      -fieldsplit_G_pc_hypre_boomeramg_coarsen_type PMIS \<br>
      -fieldsplit_G_pc_hypre_boomeramg_strong_threshold 0.6 \<br>
      -fieldsplit_G_pc_hypre_boomeramg_max_levels 25   </p>
    <p class="ds-markdown-paragraph"><span>Subsequently, we have also
        configured a case with three primary fields by combining </span><strong><span>W</span></strong><span>
        and </span><strong><span>G</span></strong><span> into a single
        monolithic </span><strong><span>P</span></strong><span>
        (pressure) variable, which was solved using a similar approach.</span></p>
    <p class="ds-markdown-paragraph"><span>We are now interested in
        advancing our preconditioning strategy by implementing a </span><strong><span>nested</span></strong><span>
        (or recursive) Schur complement decomposition. Our objective is
        to define a hierarchical structure where, for instance, an outer
        Schur complement is first constructed, and then the primary
        split itself is solved using an inner Schur complement
        preconditioner.</span></p>
    <p class="ds-markdown-paragraph"><span>We have encountered an
        example of this nested configuration in presentation slides for
        the PETSc example </span><code>ex31</code><span> (e.g., from
        [1]), which outlines a command-line structure similar to:</span></p>
    <p>-ksp_type fgmres -pc_type fieldsplit -pc_fieldsplit_type schur<br>
      -pc_fieldsplit_0_fields 0,1 -pc_fieldsplit_1_fields 2<br>
      -pc_fieldsplit_schur_factorization_type upper<br>
      -fieldsplit_0_ksp_type fgmres -fieldsplit_0_pc_type fieldsplit<br>
      -fieldsplit_0_pc_fieldsplit_type schur<br>
      -fieldsplit_0_pc_fieldsplit_schur_factorization_type full<br>
      -fieldsplit_0_fieldsplit_velocity_ksp_type preonly<br>
      -fieldsplit_0_fieldsplit_velocity_pc_type lu<br>
      -fieldsplit_0_fieldsplit_pressure_ksp_rtol 1e-10<br>
      -fieldsplit_0_fieldsplit_pressure_pc_type jacobi<br>
      -fieldsplit_temperature_ksp_type gmres<br>
      -fieldsplit_temperature_pc_type lsc</p>
    <p class="ds-markdown-paragraph"><span>We are currently seeking
        guidance on how to implement this nested </span><code>FieldSplit</code><span>
        functionality within our Fortran code. We were wondering if the
        source code for this specific </span><code>ex31</code><span>
        example is publicly available, or if you could direct us to any
        other Fortran examples that demonstrate the implementation of a
        recursive Schur complement preconditioner.</span></p>
    <p class="ds-markdown-paragraph"><span>Any advice, references, or
        code examples you could provide would be immensely valuable to
        our research.</span></p>
    <p class="ds-markdown-paragraph"><span>Thank you very much for your
        time and assistance.</span></p>
    <p class="ds-markdown-paragraph"><span>Sincerely,</span></p>
    <p class="ds-markdown-paragraph"><span>Lucía Barandiarán</span></p>
    <p class="ds-markdown-paragraph"><span>Scientific software
        developer  - Dracsys </span></p>
    <p class="ds-markdown-paragraph"><span>Collaborator at MECMAT group
        - Universitat Politècnica de Catalunya (UPC)</span></p>
    <p class="ds-markdown-paragraph"><span>Reference:</span><span></span><br>
      <span>[1] Knepley, M. G. (2016). </span><em><span>Advanced PETSc
          Preconditioning</span></em><span>. Presentation. Retrieved
        from </span><a href="https://urldefense.us/v3/__https://cse.buffalo.edu/*knepley/presentations/PresMIT2016.pdf__;fg!!G_uCfscf7eWS!cyBB84JdoI3gXz-X7IFeVHTUEuq5x6-N36gHKdnu1acRmIh47LSfDP3AqW10CDEpIUW2fWhiL5g7nsUDzIMbTGkWotRffgz__g$" target="_blank" rel="noreferrer"><span>https://cse.buffalo.edu/~knepley/presentations/PresMIT2016.pdf</span></a></p>
  </body>
</html>