mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-10-02 22:31:31 +00:00
rewrite assembly, see #69. a lot of tests probably fail but the most important ones pass
This commit is contained in:
@@ -14,6 +14,10 @@ function SparseMatrixIJV()
|
||||
SparseMatrixIJV([], [], [])
|
||||
end
|
||||
|
||||
function Base.sparse(A::SparseMatrixIJV)
|
||||
return sparse(A.I, A.J, A.V)
|
||||
end
|
||||
|
||||
function Base.push!(A::SparseMatrixIJV, I::Int, J::Int, V::Float64)
|
||||
push!(A.I, I)
|
||||
push!(A.J, J)
|
||||
@@ -63,3 +67,10 @@ function add!(A::SparseMatrixIJV, dofs1::Vector{Int}, dofs2::Vector{Int}, data::
|
||||
append!(A.V, vec(data))
|
||||
end
|
||||
|
||||
""" Sparse vector version. """
|
||||
function add!(A::SparseMatrixIJV, dofs::Vector{Int}, data::Array{Float64})
|
||||
append!(A.I, dofs)
|
||||
append!(A.J, ones(Int, length(dofs)))
|
||||
append!(A.V, vec(data))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user