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:
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):
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:
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:
|
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. |