removed obsolete code

This commit is contained in:
Jukka Aho
2017-01-05 07:20:17 +02:00
parent 1c8bc9bc64
commit 7d46d33b6a
2 changed files with 0 additions and 98 deletions
-49
View File
@@ -113,52 +113,3 @@ function assemble!(problem::Problem, time::Real, ::Type{Val{:mass_matrix}}; dens
end
end
# Static condensation routines
function eliminate_interior_dofs(K::SparseMatrixCSC, f::SparseMatrixCSC, B::Vector{Int64}, I::Vector{Int64}; F=nothing, chunk_size=100000)
dim = size(K, 1)
Kib = K[I,B]
if F == nothing
F = cholfact(1/2*(K + K')[I,I])
end
if dim < chunk_size
# for small problems we don't need to care about memory usage
Kd = Kib' * (F \ Kib)
else
# for larger problems calculate schur complement in pieces
nb = length(B)
p = nb > 10 ? round(Int, nb/10) : nb
Kd = zeros(nb, nb)
for bi in 1:nb
done = round(Int, bi/nb*100)
mod(bi, p) == 0 && info("Static condensation: $done % done")
C = full(F \ Kib[:, bi])
for bj in bi:nb
d = Kib[:, bj]
@inbounds Kd[bj,bi] = dot(C[rowvals(d)], nonzeros(d))
end
end
Kd += tril(Kd, -1)'
end
Kc = spzeros(dim, dim)
Kc[B,B] = K[B,B] - Kd
fc = spzeros(dim, 1)
fc[B] = f[B] - Kib' * (F \ f[I])
return Kc, fc
end
#=
function reconstruct!(ca::CAssembly, x::SparseMatrixCSC)
if isa(ca.F, Factorization)
x[ca.interior_dofs] = ca.F \ (ca.fi - ca.Kib*x[ca.boundary_dofs])
else # normal inverse of matrix
x[ca.interior_dofs] = ca.F * (ca.fi - ca.Kib*x[ca.boundary_dofs])
end
end
=#