Skip to content

Commit

Permalink
Merge 32cf832 into b7bc187
Browse files Browse the repository at this point in the history
  • Loading branch information
maikkirapo committed Aug 15, 2017
2 parents b7bc187 + 32cf832 commit 2f5320e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/craig_bampton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ function craig_bampton(K, M, r, l, n)
Klr = K[l,r]; Kll = K[l,l]
Mrr = M[r,r]; Mrl = M[r,l]
Mlr = M[l,r]; Mll = M[l,l]
w2 = eigvals(Kll,Mll)
X1 = eigvecs(Kll,Mll)
if issparse(K) && issparse(M)
tmp = eigs(Kll, Mll)
w2 = tmp[1]
X1 = tmp[2]
else
w2 = eigvals(Kll,Mll)
X1 = eigvecs(Kll,Mll)
end
X1[abs.(X1) .< eps_] = 0
X = X1[:,1:n]
V = X1'*Kll*X1
Expand Down

0 comments on commit 2f5320e

Please sign in to comment.