Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations

Background

The PetscSolver keyword creates an iterative Solver class that solves the system of equations provided with \(\textbf{K}_{\textrm{eff}}\). This solver can be employed to symmetric and positive-definite matrix structure using conjugate gradient method, or for unsymmetric matrix using bi-conjugate gradient method. This solver is applicable to sparse systems that are too large to be handled by a direct implementation or other direct methods such as the Cholesky decomposition.

REFERENCE:

  • Kris Buschelman, Lisandro Dalcin, Alp Dener, Victor Eijkhout, William D. Gropp, Dmitry Karpeyev, Dinesh Kaushik, Matthew G. Knepley, Dave A. May, Lois Curfman McInnes, Richard Tran Mills, Todd Munson, Karl Rupp, Patrick Sanan, Barry F. Smith, Stefano Zampini, Hong Zhang, and Hong Zhang. PETSc Web page. https://www.mcs.anl.gov/petsc, 2019. URL https://www.mcs.anl.gov/petsc
  • Satish Balay, Shrirang Abhyankar, Mark F. Adams, Jed Brown, Peter Brune, Kris Buschelman, Lisandro Dalcin, Alp Dener, Victor Eijkhout, William D. Gropp, Dmitry Karpeyev, Dinesh Kaushik, Matthew G. Knepley, Dave A. May, Lois Curfman McInnes, Richard Tran Mills, Todd Munson, Karl Rupp, Patrick Sanan, Barry F. Smith, Stefano Zampini, Hong Zhang, and Hong Zhang. PETSc users manual. Technical Report ANL-95/11 - Revision 3.12, Argonne National Laboratory, 2019. URL https://www.mcs.anl.gov/petsc

Pre-Analysis

The python Pre-Analysis in the 01-Pre_Process/Method/Attach.py file provides with an interface to create a Linear. We use the addSolver() as follows:

  • addSolver(tag, attributes):

    • tag : The identifier of this solver, i.e., tag > -1
    • attributes : Specific properties for the created solver, for example
      • 'name' : The solver's name, in this case PETSC
      • 'option' : Solver's iterative method: 'KSPBCGS', 'KSPBCGS', 'KSPCGS', 'KSPBICG'.
      • 'tol' : Iteration tolerance for iterative solver

    Example

    A PETSC solver can be defined using the python interface as follows:
    SVL.addSolver(tag=1, attributes={'name': 'PETSC', 'option': 'KSPBCGS', 'tol': 1E-12})

    Application Please refer to C01-DY_Lin_2DCoarseMeshPML_MUMPS_ElasticPStrain_Quad4 file located at 03-Validations/01-Debugging/ to see an example on how to define a PETSC solver using the addSolver function.

On the contrary, the 01-Pre_Process/Method/Remove.py file provides with an interface to depopulate the Entities dictionary. For example, to remove an already define Solver, use:

  • delSolver(tag):
    • tag : The identifier of the solver to be removed, i.e., tag > -1

Run-Analysis

The C++ Run-Analysis in the 02-Run_Process/11-Solvers/02-Iterative/PetscSolver.cc file provides the class implementation. A PetscSolver is created using the built-in json parse-structure provided in the Driver.hpp and is defined inside the "Simulations" json field indicating its "Tag" as follows,

A PetscSolver solver can be created using the built-in parse-structure provided in the Parser as,

{
    "Simulations": {
        "Tag": {
            "attributes": {
                "algorithm": {
                    "name": "PETSC",
                    "d_nz": int,
                    "o_nz": int,
                    "option": int,
                    "tol": double
                }
            }
        }
    }
}
Variable Description
option Positive number that represent the iterative method. The following methods are available:
  • Preconditioned Conjugate Gradient iterative method: 0
  • Stabilized version of BiConjugate Gradient method: 1
  • Conjugate Gradient Squared method: 2
  • Biconjugate gradient iterative method: 3
tol The maximum allowed convergence tolerance.
d_nz The maximum number of diagonal values in one row for each block partition.
o_nz The maximum number of off-diagonal values in one row for each block partition.


Attention
This solver can be used for either serial or parallel applications.
The method to be used depend on the structure of the \(\textbf{K}_{\textrm{eff}}\) matrix. For instance: symmetric and positive-definite use 0, for unsymmetric matrices use 3.
When using PML elements, the \(\textbf{K}_{\textrm{eff}}\) matrix can become negative definite, then it is highly recomended to employ a Stabilized version of BiConjugate Gradient method.