Changeset 26718
- Timestamp:
- 12/08/21 07:37:31 (3 years ago)
- Location:
- issm/trunk-jpl/src/jl/solve
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/jl/solve/modules.jl ¶
r26703 r26718 216 216 AddToGlobal!(pe,pf) 217 217 end 218 219 Assemble!(Kff) 220 Assemble!(Kfs) 221 Assemble!(pf) 218 222 219 223 return Kff, Kfs, pf -
TabularUnified issm/trunk-jpl/src/jl/solve/toolkits.jl ¶
r26699 r26718 5 5 #Matrix 6 6 mutable struct IssmMatrix #{{{ 7 M::Int64 8 N::Int64 9 rows::Vector{Int64} 10 cols::Vector{Int64} 11 vals::Vector{Float64} 7 12 matrix::SparseMatrixCSC{Float64,Int64} 8 13 end #}}} 9 14 function IssmMatrix(M::Int64,N::Int64)#{{{ 10 return IssmMatrix( spzeros(M,N))15 return IssmMatrix(M, N, Vector{Int64}(undef,0), Vector{Int64}(undef,0), Vector{Float64}(undef,0), spzeros(0,0)) 11 16 end#}}} 12 17 function AddValues!(matrix::IssmMatrix,m::Int64,midx::Vector{Int64},n::Int64,nidx::Vector{Int64},values::Matrix{Float64})#{{{ … … 17 22 for j in 1:n 18 23 if(nidx[j]==-1) continue end 19 matrix.matrix[midx[i],nidx[j]] += values[i,j] 24 push!(matrix.rows, midx[i]) 25 push!(matrix.cols, nidx[j]) 26 push!(matrix.vals, values[i,j]) 20 27 end 21 28 end … … 25 32 26 33 return size(matrix.matrix) 34 35 end#}}} 36 function Assemble!(matrix::IssmMatrix)#{{{ 37 38 matrix.matrix = sparse(matrix.rows, matrix.cols, matrix.vals, matrix.M, matrix.N) 27 39 28 40 end#}}} … … 75 87 76 88 end#}}} 89 function Assemble!(vector::IssmVector)#{{{ 90 91 #Nothing to do for this toolkit 92 93 end#}}} 77 94 function Norm(x::IssmVector,type::Int64)#{{{ 78 95
Note:
See TracChangeset
for help on using the changeset viewer.