[petsc-users] Nested FieldSplit Implementation for FE using Fortran
Lucia Barandiaran
lucia.barandiaran at upc.edu
Mon Sep 15 09:45:52 CDT 2025
Dear PETSc community,
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 (*U*), water
pressure (*W*), gas pressure (*G*), and temperature (*T*).
We have recently integrated the |FieldSplit|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
|ISCreateGeneral|, and the splits were established via
|PCFieldSplitSetIS|(one split per variable). The following command-line
options were utilized effectively for this case:
-ksp_type gmres -ksp_gmres_modifiedgramschmidt \
-pc_type fieldsplit -pc_fieldsplit_type schur \
-pc_fieldsplit_schur_fact_type lower \
-pc_fieldsplit_schur_precondition selfp \
-fieldsplit_U_ksp_type preonly \
-fieldsplit_U_pc_type hypre \
-fieldsplit_U_pc_hypre_type boomeramg \
-fieldsplit_U_pc_hypre_boomeramg_coarsen_type PMIS \
-fieldsplit_U_pc_hypre_boomeramg_strong_threshold 0.6 \
-fieldsplit_U_pc_hypre_boomeramg_max_levels 25
-fieldsplit_G_ksp_type preonly \
-fieldsplit_G_pc_type hypre \
-fieldsplit_G_pc_hypre_type boomeramg \
-fieldsplit_G_pc_hypre_boomeramg_coarsen_type PMIS \
-fieldsplit_G_pc_hypre_boomeramg_strong_threshold 0.6 \
-fieldsplit_G_pc_hypre_boomeramg_max_levels 25
Subsequently, we have also configured a case with three primary fields
by combining *W*and *G*into a single monolithic *P*(pressure) variable,
which was solved using a similar approach.
We are now interested in advancing our preconditioning strategy by
implementing a *nested*(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.
We have encountered an example of this nested configuration in
presentation slides for the PETSc example |ex31|(e.g., from [1]), which
outlines a command-line structure similar to:
-ksp_type fgmres -pc_type fieldsplit -pc_fieldsplit_type schur
-pc_fieldsplit_0_fields 0,1 -pc_fieldsplit_1_fields 2
-pc_fieldsplit_schur_factorization_type upper
-fieldsplit_0_ksp_type fgmres -fieldsplit_0_pc_type fieldsplit
-fieldsplit_0_pc_fieldsplit_type schur
-fieldsplit_0_pc_fieldsplit_schur_factorization_type full
-fieldsplit_0_fieldsplit_velocity_ksp_type preonly
-fieldsplit_0_fieldsplit_velocity_pc_type lu
-fieldsplit_0_fieldsplit_pressure_ksp_rtol 1e-10
-fieldsplit_0_fieldsplit_pressure_pc_type jacobi
-fieldsplit_temperature_ksp_type gmres
-fieldsplit_temperature_pc_type lsc
We are currently seeking guidance on how to implement this nested
|FieldSplit|functionality within our Fortran code. We were wondering if
the source code for this specific |ex31|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.
Any advice, references, or code examples you could provide would be
immensely valuable to our research.
Thank you very much for your time and assistance.
Sincerely,
Lucía Barandiarán
Scientific software developer - Dracsys
Collaborator at MECMAT group - Universitat Politècnica de Catalunya (UPC)
Reference:
[1] Knepley, M. G. (2016). /Advanced PETSc Preconditioning/.
Presentation. Retrieved from
https://urldefense.us/v3/__https://cse.buffalo.edu/*knepley/presentations/PresMIT2016.pdf__;fg!!G_uCfscf7eWS!cyBB84JdoI3gXz-X7IFeVHTUEuq5x6-N36gHKdnu1acRmIh47LSfDP3AqW10CDEpIUW2fWhiL5g7nsUDzIMbTGkWotRffgz__g$
<https://urldefense.us/v3/__https://cse.buffalo.edu/*knepley/presentations/PresMIT2016.pdf__;fg!!G_uCfscf7eWS!cyBB84JdoI3gXz-X7IFeVHTUEuq5x6-N36gHKdnu1acRmIh47LSfDP3AqW10CDEpIUW2fWhiL5g7nsUDzIMbTGkWotRffgz__g$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250915/69449ee6/attachment-0001.html>
More information about the petsc-users
mailing list