GridapTrilinos.jl

GridapTrilinos provides a Gridap.Algebra.LinearSolver implementation backed by Trilinos. The Julia package can be installed and loaded without Trilinos; calls that need the optional C++ backend report how to build it.

Public API

GridapTrilinos.TrilinosSolveType
TrilinosSolve(parameter_file::AbstractString)

Create a Gridap linear solver backed by Trilinos, using the XML parameter file at parameter_file.

TrilinosSolve implements Gridap.Algebra.LinearSolver. Numerical setup builds a distributed Tpetra matrix and caches the Trilinos solver state so repeated solve! calls can reuse it. The latest solve metadata is available as solver.log after a solve completes.

The package can be loaded without the optional C++ shared library. In that mode constructing TrilinosSolve still succeeds, but setup or solve calls that need Trilinos throw an error explaining how to build the backend.

source
GridapTrilinos.SolverResultType
SolverResult

Result object returned by the Trilinos backend after a solve has completed.

Access values with the public properties name, num_iters, residual, solve_time, verbose, and depth, or with the matching accessor functions. A solver's latest result is available as solver.log after Gridap.Algebra.solve! has run.

source
GridapTrilinos.nameFunction
name(result::SolverResult)

Return the Trilinos linear solver and preconditioner name reported for a completed solve.

source
GridapTrilinos.residualFunction
residual(result::SolverResult)

Return the achieved residual tolerance reported by Trilinos for a completed solve.

source

Backend

Build the optional backend after configuring MPI.jl to use the same system MPI as Trilinos. For a registered package installation:

export TRILINOS_ROOT=/path/to/TrilinosInstall
julia -e 'using Pkg; Pkg.build("GridapTrilinos")'

For a source checkout with the repository environment activated, use:

export TRILINOS_ROOT=/path/to/TrilinosInstall
julia --project=. -e 'using Pkg; Pkg.build("GridapTrilinos")'

The shared library is generated in Julia scratch space:

DEPOT_PATH[1]/scratchspaces/<GridapTrilinos uuid>/trilinos-backend/usr/lib/GridapTrilinos.so

Because the backend is outside the versioned package source directory, it is not lost when Julia replaces the package source tree during an update.