# solver.py¶

Define functions to find the solution of a sparse linear system of the format Ax = b, in Edge Finite Element Method (EFEM) of lowest order in tetrahedral meshes.

petgem.solver.solver.direct_scipy(A, b)[source]

Interface to direct sparse scipy solver.

Parameters: A (ndarray) – sparse and complex coefficients matrix in a CSR format. b (ndarray) – rigth hand side. solution to the system. ndarray of complex coefficients.
petgem.solver.solver.iterative_scipy(A, b, type_solver, tol, maxiter)[source]

Interface to iterative sparse scipy solver.

Parameters: A (ndarray) – sparse and complex coefficients matrix in a CSR format. b (ndarray) – rigth hand side. type_solver (str) – solver type. Available solvers are: bicgstab. tol (float) – solver tolerance. maxiter (int) – maximum number of solver iterations. solution to the system. ndarray of complex coefficients.
petgem.solver.solver.set_dirichlet_boundaries(A, b, in_boundaries)[source]

Compute the list of degrees of freedom.

Parameters: A (ndarray) – sparse and complex coefficients matrix in a CSR format. b (ndarray) – rigth hand side. in_boundaries (ndarray) – boundary-edges array. equation system after applied Dirichlet BC. ndarray.
petgem.solver.solver.solver(A, b, boundaries, model)[source]

Solve a matrix system of the form Ax = b.

Parameters: A (ndarray) – sparse and complex coefficients matrix in a CSR format. b (ndarray) – rigth hand side. boundaries (ndarray) – boundary-edges array. model (object_modelling) – CSEM modelling with physical parameters. solution to the system. ndarray of complex coefficients.
petgem.solver.solver.unitary_test()[source]

Unitary test for solver.py script.