Mercurial > repos > public > sbplib
comparison +sbp/+implementations/d2_variable_4.m @ 890:c70131daaa6e feature/d1_staggered
Merge with feature/poroelastic.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Wed, 21 Nov 2018 18:29:29 -0800 |
parents | b758d1cf4c8e |
children | e54c2f54dbfe |
comparison
equal
deleted
inserted
replaced
885:18e10217dca9 | 890:c70131daaa6e |
---|---|
47 | 47 |
48 D1 = HI*(Q - 1/2*e_l*e_l' + 1/2*e_r*e_r'); | 48 D1 = HI*(Q - 1/2*e_l*e_l' + 1/2*e_r*e_r'); |
49 | 49 |
50 | 50 |
51 N = m; | 51 N = m; |
52 function D2 = D2_fun(c) | 52 function [D2, B] = D2_fun(c) |
53 M = 78+(N-12)*5; | 53 M = 78+(N-12)*5; |
54 %h = 1/(N-1); | 54 %h = 1/(N-1); |
55 | 55 |
56 | 56 |
57 U = [ | 57 U = [ |
129 cols(M-38:M-24) = [(N-7:N)';(N-6:N)']; | 129 cols(M-38:M-24) = [(N-7:N)';(N-6:N)']; |
130 for i=7:N-6 | 130 for i=7:N-6 |
131 cols(40+(i-7)*5:44+(i-7)*5) = [i-2;i-1;i;i+1;i+2]; | 131 cols(40+(i-7)*5:44+(i-7)*5) = [i-2;i-1;i;i+1;i+2]; |
132 end | 132 end |
133 D2 = sparse(rows,cols,D2); | 133 D2 = sparse(rows,cols,D2); |
134 | |
135 B = HI*( c(end)*e_r*d1_r' - c(1)*e_l*d1_l') - D2; | |
134 end | 136 end |
135 D2 = @D2_fun; | 137 D2 = @D2_fun; |
136 end | 138 end |