This patch adds the following methods:
solve( ::HYPRESolver, ::PSparseMatrix, ::PVector)
solve!(::HYPRESolver, ::PVector, ::PSparseMatrix, ::PVector)
which automatically converts to/from HYPRE(Matrix|Vector).
This patch adds a function
solve(::HYPRESolver, ::HYPREMatrix, ::HYPREVector) which initializes an
output vector initialized to 0 and pass it to solve!.
Settings are passed as keyword arguments, just like BoomerAMG. The
Precond argument (corresponding to PCGSetPrecond) is handled separately,
and lets you pass another solver directly, instead of the solver
pointer, the setup and solve functions, as in the SetPrecond C function.
Example:
precond = BoomerAMG(; options...)
solver = PCG(; Precond = precond, options...)
This commits contains the solver interface:
A = HYPREMatrix(...)
b = HYPREVector(...)
x = HYPREVector(...)
solver = HYPRESolver(; options...)
solve!(solver, x, A, b)
where the abstract type HYPRESolver is replaced by a concrete solver
implementation (this commit includes the concrete
implementation/wrapping of BoomerAMG <: HYPRESolver).
Solver settings are passed as keyword arguments to the solver
constructor, cf. SetXXX functions in HYPRE.
For example, to create a BoomerAMG solver, and setting the tolerance:
solver = BoomerAMG(Tol = 1e-7)
Keyword argument names correspond directly to the solvers SetXXX
function in HYPRE; passing Tol corresponds to
HYPRE_BoomerAMGSetTol(solver, 1e-7).
- Move LibHYPRE submodule to it's own file
- Move Internals stub module to it's own file
- Add conversions from PartitionedArrays.(PSparseMatrix|PVector)
- More tests...
Add manual methods for some ::Function signatures where the library wants function
pointers. Instead of creating function pointers to the Julia wrappers we can just look
up the pointer in the library and pass that.