Gridap.Algebra
Gridap.Algebra — Module
Exported names
AffineOperator, ArrayBuilder, BackslashSolver, DoNotLoop, LUSolver, LinearSolver, Loop, LoopStyle, MinCPU, MinMemory, NLSolver, NewtonRaphsonSolver, NonlinearOperator, NonlinearSolver, NumericalSetup, SparseMatrixBuilder, SymbolicSetup, add_entries!, add_entry!, allocate_coo_vectors, allocate_in_domain, allocate_in_range, allocate_jacobian, allocate_matrix, allocate_matrix_and_vector, allocate_residual, allocate_residual_and_jacobian, allocate_vector, axpy_entries!, copy_entries!, create_from_nz, finalize_coo!, get_array_type, get_matrix, get_vector, hessian, hessian!, is_entry_stored, jacobian, jacobian!, length_to_ptrs!, muladd!, numerical_setup, numerical_setup!, nz_allocation, nz_counter, nz_index, push_coo!, residual, residual!, residual_and_jacobian, residual_and_jacobian!, rewind_ptrs!, solve, solve!, sparse_from_coo, symbolic_setup, test_linear_solver, test_nonlinear_operator, test_nonlinear_solver, zero_initial_guess,
Gridap.Algebra.AffineOperator — Type
struct AffineOperator{A<:AbstractMatrix,B<:AbstractVector} <: NonlinearOperator
matrix::A
vector::B
endGridap.Algebra.ArrayBuilder — Type
struct ArrayBuilder{T}T is the type of array to be built.
Gridap.Algebra.ArrayCounter — Type
ArrayCounter{T}(axes::A)where T is the target matrix/array type.
Gridap.Algebra.BackslashSolver — Type
struct BackslashSolver <: LinearSolver endWrapper of the backslash solver available in julia This is typically faster than LU for a single solve
Gridap.Algebra.DoNotLoop — Type
struct DoNotLoop endGridap.Algebra.LUSolver — Type
struct LUSolver <: LinearSolver endWrapper of the LU solver available in julia
Gridap.Algebra.LinearSolver — Type
abstract type LinearSolver <: NonlinearSolver endGridap.Algebra.Loop — Type
struct Loop endGridap.Algebra.MinCPU — Type
struct MinCPU endRepresent sparse matrix assembly strategy minimizing CPU cost.
Gridap.Algebra.MinMemory — Type
struct MinMemory{T}Represent sparse matrix assembly strategy minimizing memory cost.
Gridap.Algebra.NLSolver — Type
struct NLSolver <: NonlinearSolver
# private fields
endThe cache generated when using this solver has a field result that hosts the result object generated by the underlying nlsolve function. It corresponds to the most latest solve.
Gridap.Algebra.NLSolver — Method
NLSolver(ls::LinearSolver;kwargs...)
NLSolver(;kwargs...)Same kwargs as in nlsolve. If ls is provided, it is not possible to use the linsolve kw-argument.
Gridap.Algebra.NewtonRaphsonSolver — Type
struct NewtonRaphsonSolver <:NonlinearSolver
# Private fields
endVanilla Newton-Raphson method
Gridap.Algebra.NonlinearOperator — Type
abstract type NonlinearOperator <: GridapType endGridap.Algebra.NonlinearSolver — Type
abstract type NonlinearSolver <: GridapType endGridap.Algebra.NumericalSetup — Type
abstract type NumericalSetup <: GridapType endGridap.Algebra.SparseMatrixBuilder — Type
struct SparseMatrixBuilder{T,A}Gridap.Algebra.SparseMatrixBuilder — Method
SparseMatrixBuilder(::Type{T}[, ::S])Create a builder for sparse matrix of type T, using assembly stategy S(), either MinCPU() or MinMemory(). The default is MinMemory().
Gridap.Algebra.SymbolicSetup — Type
abstract type SymbolicSetup <: GridapType endGridap.Algebra.LoopStyle — Method
LoopStyle(::Type)
LoopStyle(::T) where T = LoopStyle(T)Trait to tell if looping on nonzeros entries is necessary to count the values with a counter (see nz_counter) of an array of type T.
Gridap.Algebra.add_entries! — Method
add_entries!(combine::Function,A,vs,is,js)Add several entries only for positive input indices. Returns A.
Gridap.Algebra.add_entry! — Method
add_entry!(combine::Function,A,v,i...)
add_entry!(A,v,i...)Add an entry. Returns A.
Gridap.Algebra.allocate_coo_vectors — Method
allocate_coo_vectors(::Type{<:AbstractSparseMatrix{Tv,Ti}}, n::Integer)Gridap.Algebra.allocate_in_domain — Method
allocate_in_domain(matrix::AbstractMatrix{T}) where TAllocate a vector in the domain of matrix matrix.
Gridap.Algebra.allocate_in_domain — Method
allocate_in_domain(::Type{V},matrix) where VAllocate a vector of type V in the domain of matrix matrix.
Gridap.Algebra.allocate_in_range — Method
allocate_in_range(matrix::AbstractMatrix{T}) where TAllocate a vector in the range of matrix matrix.
Gridap.Algebra.allocate_in_range — Method
allocate_in_range(::Type{V},matrix) where VAllocate a vector of type V in the range of matrix matrix.
Gridap.Algebra.allocate_jacobian — Method
allocate_jacobian(op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.allocate_residual — Method
allocate_residual(op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.allocate_residual_and_jacobian — Method
allocate_residual_and_jacobian(op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.allocate_vector — Method
allocate_vector(::Type{V},indices) where VAllocate a vector of type V indexable at the indices indices
Gridap.Algebra.axpy_entries! — Method
axpy_entries!(α::Number, A::T, B::T) where {T<: AbstractMatrix} -> TEfficient implementation of LinearAlgebra.axpy! for sparse matrices.
Gridap.Algebra.copy_entries! — Method
copy_entries!(a,b)Copy the entries of array b into array a. Returns a.
Gridap.Algebra.create_from_nz — Method
create_from_nz(nz_alloc::AbstractArray)Creates a matrix from its nonzero values, allocated using nz_allocation and filled using add_entry! and/or add_entries!.
Gridap.Algebra.finalize_coo! — Method
finalize_coo!(::Type,I,J,V,m,n)Check and insert diagonal entries in COO vectors if needed.
Gridap.Algebra.get_array_type — Method
get_array_type(::ArrayBuilder{T}) = TGridap.Algebra.get_matrix — Method
get_matrix(operator)Return the matrix corresponding to the assembled left hand side of the operator. This matrix incorporates all boundary conditions and constraints.
Gridap.Algebra.get_vector — Method
get_vector(operator)Return the vector corresponding to the assembled right hand side of the operator. This vector includes all boundary conditions and constraints.
Gridap.Algebra.hessian — Function
function hessian endGridap.Algebra.hessian! — Function
Gridap.Algebra.is_entry_stored — Method
is_entry_stored(::Type,i,j) -> BoolTells if the entry with coordinates [i,j] will be stored in the coo vectors.
Gridap.Algebra.jacobian! — Method
jacobian!(A::AbstractMatrix,op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.jacobian — Method
jacobian(op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.length_to_ptrs! — Method
length_to_ptrs!(ptrs)Given a vector of integers, mutate it from length state to pointer state.
Gridap.Algebra.muladd! — Method
muladd!(c,a,b)Matrix multiply a*b and add to result to c. Returns c.
Gridap.Algebra.numerical_setup! — Method
numerical_setup!(::NumericalSetup,mat::AbstractMatrix)Gridap.Algebra.numerical_setup — Method
numerical_setup(::SymbolicSetup,mat::AbstractMatrix) -> NumericalSetupGridap.Algebra.nz_allocation — Method
nz_allocation(a::ArrayCounter{T})Allocates a vector that will serve as structural nonzero values internal storage for a matrix holding the values counted in a. See also create_from_nz, SparseArrays.nonzeros.
Gridap.Algebra.nz_counter — Method
nz_counter(::ArrayBuilder{T},axes)Generate a counter (ArrayCounter) to count the nonzero values for an array type A.
Gridap.Algebra.nz_index — Method
nz_index(A::AbstractSparseMatrix,i,j)Index of A[i,j] in the structural nonzero values internal storage of A. See also SparseArrays.nonzeros.
Gridap.Algebra.push_coo! — Method
push_coo!(::Type, I,J,V,i,j,v)Inserts entries in COO vectors for further building a sparse matrix of type T.
Gridap.Algebra.residual! — Method
residual!(b::AbstractVector,op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.residual — Method
residual(op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.residual_and_jacobian! — Method
residual_and_jacobian!(
b::AbstractVector, A::AbstractMatrix,
op::NonlinearOperator, x::AbstractVector)Gridap.Algebra.residual_and_jacobian — Method
residual_and_jacobian(op::NonlinearOperator,x::AbstractVector)Gridap.Algebra.rewind_ptrs! — Method
rewind_ptrs!(ptrs)Rewind the given vector of pointers.
Gridap.Algebra.solve! — Method
solve!(x::AbstractVector,ls::LinearSolver,A::AbstractMatrix,b::AbstractVector)Gridap.Algebra.solve! — Method
solve!(
x::AbstractVector,
ls::LinearSolver,
op::AffineOperator,
cache,
newmatrix::Bool)Gridap.Algebra.solve! — Method
solve!(x::AbstractVector,nls::NonlinearSolver,op::NonlinearOperator,cache)Solve using the cache object from a previous solve.
Gridap.Algebra.solve! — Method
solve!(x::AbstractVector,nls::NonlinearSolver,op::NonlinearOperator)Usage:
cache = solve!(x,nls,op)The returned cache object can be used in subsequent solves:
cache = solve!(x,nls,op,cache)Gridap.Algebra.solve! — Method
solve!(x::AbstractVector,::NumericalSetup,b::AbstractVector)Gridap.Algebra.solve — Method
solve(ls::LinearSolver,A::AbstractMatrix,b::AbstractVector)Gridap.Algebra.solve — Method
solve(nls::NonlinearSolver,op::NonlinearOperator)Creates and uses a zero initial guess.
Gridap.Algebra.sparse_from_coo — Method
sparse_from_coo(::Type,I,J,V,m,n)Gridap.Algebra.symbolic_setup — Method
symbolic_setup(::LinearSolver,mat::AbstractMatrix) -> SymbolicSetupGridap.Algebra.test_linear_solver — Method
test_linear_solver(
ls::LinearSolver,
A::AbstractMatrix,
b::AbstractVector,
x::AbstractVector)Gridap.Algebra.test_nonlinear_operator — Function
test_nonlinear_operator(
op::NonlinearOperator,
x::AbstractVector,
b::AbstractVector,
pred=isapprox;
jac=nothing)Gridap.Algebra.test_nonlinear_solver — Function
test_nonlinear_solver(
nls::NonlinearSolver,
op::NonlinearOperator,
x0::AbstractVector,
x::AbstractVector,
pred::Function=isapprox)Gridap.Algebra.zero_initial_guess — Method
zero_initial_guess(op::NonlinearOperator)