Gridap.Algebra
Gridap.Algebra
— ModuleThe exported names are
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
— Typestruct AffineOperator{A<:AbstractMatrix,B<:AbstractVector} <: NonlinearOperator
matrix::A
vector::B
end
Gridap.Algebra.BackslashSolver
— Typestruct BackslashSolver <: LinearSolver end
Wrapper of the backslash solver available in julia This is typically faster than LU for a single solve
Gridap.Algebra.LUSolver
— Typestruct LUSolver <: LinearSolver end
Wrapper of the LU solver available in julia
Gridap.Algebra.LinearSolver
— Typeabstract type LinearSolver <: NonlinearSolver end
Gridap.Algebra.NLSolver
— Typestruct NLSolver <: NonlinearSolver
# private fields
end
The 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
— MethodNLSolver(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
— Typestruct NewtonRaphsonSolver <:NonlinearSolver
# Private fields
end
Vanilla Newton-Raphson method
Gridap.Algebra.NonlinearOperator
— Typeabstract type NonlinearOperator <: GridapType end
Gridap.Algebra.NonlinearSolver
— Typeabstract type NonlinearSolver <: GridapType end
Gridap.Algebra.NumericalSetup
— Typeabstract type NumericalSetup <: GridapType end
Gridap.Algebra.SymbolicSetup
— Typeabstract type SymbolicSetup <: GridapType end
Gridap.Algebra.add_entries!
— Methodadd_entries!(combine::Function,A,vs,is,js)
Add several entries only for positive input indices. Returns A.
Gridap.Algebra.add_entry!
— Methodadd_entry!(combine::Function,A,v,i...)
add_entry!(A,v,i...)
Add an entry. Returns A.
Gridap.Algebra.allocate_in_domain
— Methodallocate_in_domain(matrix::AbstractMatrix{T}) where T
Allocate a vector in the domain of matrix matrix
.
Gridap.Algebra.allocate_in_domain
— Methodallocate_in_domain(::Type{V},matrix) where V
Allocate a vector of type V
in the domain of matrix matrix
.
Gridap.Algebra.allocate_in_range
— Methodallocate_in_range(matrix::AbstractMatrix{T}) where T
Allocate a vector in the range of matrix matrix
.
Gridap.Algebra.allocate_in_range
— Methodallocate_in_range(::Type{V},matrix) where V
Allocate a vector of type V
in the range of matrix matrix
.
Gridap.Algebra.allocate_jacobian
— Methodallocate_jacobian(op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.allocate_residual
— Methodallocate_residual(op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.allocate_residual_and_jacobian
— Methodallocate_residual_and_jacobian(op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.allocate_vector
— Methodallocate_vector(::Type{V},indices) where V
Allocate a vector of type V
indexable at the indices indices
Gridap.Algebra.axpy_entries!
— Methodaxpy_entries!(α::Number, A::T, B::T) where {T<: AbstractMatrix} -> T
Efficient implementation of axpy! for sparse matrices.
Gridap.Algebra.copy_entries!
— Methodcopy_entries!(a,b)
Copy the entries of array b
into array a
. Returns a
.
Gridap.Algebra.finalize_coo!
— Methodfinalize_coo!(::Type,I,J,V,m,n)
Check and insert diagonal entries in COO vectors if needed.
Gridap.Algebra.get_matrix
— Methodget_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
— Methodget_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.is_entry_stored
— Methodis_entry_stored(::Type,i,j) -> Bool
Tells if the entry with coordinates [i,j]
will be stored in the coo vectors.
Gridap.Algebra.jacobian!
— Methodjacobian!(A::AbstractMatrix,op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.jacobian
— Methodjacobian(op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.length_to_ptrs!
— Methodlength_to_ptrs!(ptrs)
Given a vector of integers, mutate it from length state to pointer state.
Gridap.Algebra.muladd!
— Methodmuladd!(c,a,b)
Matrix multiply a*b and add to result to c. Returns c.
Gridap.Algebra.numerical_setup!
— Methodnumerical_setup!(::NumericalSetup,mat::AbstractMatrix)
Gridap.Algebra.numerical_setup
— Methodnumerical_setup(::SymbolicSetup,mat::AbstractMatrix) -> NumericalSetup
Gridap.Algebra.push_coo!
— Methodpush_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!
— Methodresidual!(b::AbstractVector,op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.residual
— Methodresidual(op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.residual_and_jacobian!
— Methodresidual_and_jacobian!(
b::AbstractVector, A::AbstractMatrix,
op::NonlinearOperator, x::AbstractVector)
Gridap.Algebra.residual_and_jacobian
— Methodresidual_and_jacobian(op::NonlinearOperator,x::AbstractVector)
Gridap.Algebra.rewind_ptrs!
— Methodrewind_ptrs!(ptrs)
Rewind the given vector of pointers.
Gridap.Algebra.solve!
— Methodsolve!(x::AbstractVector,ls::LinearSolver,A::AbstractMatrix,b::AbstractVector)
Gridap.Algebra.solve!
— Methodsolve!(
x::AbstractVector,
ls::LinearSolver,
op::AffineOperator,
cache,
newmatrix::Bool)
Gridap.Algebra.solve!
— Methodsolve!(x::AbstractVector,nls::NonlinearSolver,op::NonlinearOperator,cache)
Solve using the cache object from a previous solve.
Gridap.Algebra.solve!
— Methodsolve!(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!
— Methodsolve!(x::AbstractVector,::NumericalSetup,b::AbstractVector)
Gridap.Algebra.solve
— Methodsolve(ls::LinearSolver,A::AbstractMatrix,b::AbstractVector)
Gridap.Algebra.solve
— Methodsolve(nls::NonlinearSolver,op::NonlinearOperator)
Creates and uses a zero initial guess.
Gridap.Algebra.sparse_from_coo
— Methodsparse_from_coo(::Type,I,J,V,m,n)
Gridap.Algebra.symbolic_setup
— Methodsymbolic_setup(::LinearSolver,mat::AbstractMatrix) -> SymbolicSetup
Gridap.Algebra.test_linear_solver
— Methodtest_linear_solver(
ls::LinearSolver,
A::AbstractMatrix,
b::AbstractVector,
x::AbstractVector)
Gridap.Algebra.test_nonlinear_operator
— Functiontest_nonlinear_operator(
op::NonlinearOperator,
x::AbstractVector,
b::AbstractVector,
pred=isapprox;
jac=nothing)
Gridap.Algebra.test_nonlinear_solver
— Functiontest_nonlinear_solver(
nls::NonlinearSolver,
op::NonlinearOperator,
x0::AbstractVector,
x::AbstractVector,
pred::Function=isapprox)
Gridap.Algebra.zero_initial_guess
— Methodzero_initial_guess(op::NonlinearOperator)