dxss package#
Submodules#
dxss.gmres module#
- dxss.gmres.convergence_monitor(ksp, its, rnorm)[source]#
A simple rate-printing convergence monitor.
The function trace is dictated by PETSc. https://petsc.org/release/petsc4py/reference/petsc4py.typing.KSPMonitorFunction.html
- Parameters:
- Return type:
Note: The rnorm is _not_ the relative normalisation despite its name.
- dxss.gmres.get_gmres_solution(A, b, pre, maxsteps=100, tol=None, restart=None, printrates=True, reltol=None)[source]#
Solve linear system A @ x = b with generalized minimal residual method (GMRes).
Uses PETSc GMRes implementation.
- Parameters:
A – Object implementing PETSc MatPythonProtocol to use as matrix A.
b (
Vec
) – PETSc vector object to use as right-hand side term b.pre – Object implementing PCPythonProtocol to use as GMRes preconditioner.
maxsteps (
int
) – Maximum number of GMRes iterations to use.tol (
Optional
[float
]) – Absolute convergence tolerance - absolute size of the (preconditioned) residual norm.restart (
Optional
[int
]) – Number of iterations after which to restart.printrates (
bool
) – Whether to show convergence statistics during solving.reltol (
Optional
[float
]) – Relative convergence tolerance, relative decrease in the (preconditioned) residual norm.
- Return type:
tuple
[Vec
,Vec
]
dxss.meshes module#
dxss.precomp_time_int module#
dxss.solve_1d module#
dxss.solve_2d module#
dxss.solve_3d module#
dxss.space_time module#
- class dxss.space_time.ProblemParameters(jumps_in_fw_problem=False, well_posed=False)[source]#
Bases:
object
- class dxss.space_time.SpaceTime(polynomial_order_time, polynomial_order_space, N, T, t, msh, stabilisation_terms, omega, solution, parameters=ProblemParameters(jumps_in_fw_problem=False, well_posed=False))[source]#
Bases:
object
- class dxss.space_time.SpaceTimePETScMatrixWrapper(space_time)[source]#
Bases:
object
Class wrapping space-time solver to provide interface for use as PETSc.Mat.
The required interface is documented at https://petsc.org/main/petsc4py/petsc_python_types.html#petsc-python-mat
- Parameters:
space_time (
SpaceTime
) – Space time solver instance to wrap.
- mult(mat, vec_in, vec_out)[source]#
Matrix vector multiplication vec_out = mat @ vec_in.
- Parameters:
mat (
Mat
) – PETSc matrix holding PETSc data structures. Unused.vec_in (
Vec
) – The vector to perform matrix multiplication with.vec_out (
Vec
) – The vector to write result of multiplication to.
- Return type:
- class dxss.space_time.SpaceTimePETScPreconditionerWrapper(space_time)[source]#
Bases:
object
Class wrapping space-time solver to provide interface for use as PETSc.PC.
Uses the space-time solvers improved time-marching preconditioner.
The required interface is documented at https://petsc.org/main/petsc4py/petsc_python_types.html#petsc-python-preconditioner-type
- Parameters:
space_time (
SpaceTime
) – Space time solver instance to wrap.
- apply(pc, vec_in, vec_out)[source]#
Apply preconditioner to vector vec_in writing out to vec_out.
- Parameters:
pc (
PC
) – PETSc preconditioner holding PETSc data structures. Unused.vec_in (
Vec
) – The vector to apply preconditioner to.vec_out (
Vec
) – The vector to write result of preconditioning vec_in to.
- Return type:
Module contents#
DOLFINx space-time finite element space time slab solvers.