Mercurial > repos > public > sbplib
comparison +scheme/Staggered1DAcoustics.m @ 650:8e55298657b9 feature/d1_staggered
Add characteristic BC
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Wed, 15 Nov 2017 14:56:52 -0800 |
parents | dc2918fb104d |
children | 993aac771efd |
comparison
equal
deleted
inserted
replaced
649:1bdbe026abbc | 650:8e55298657b9 |
---|---|
114 % type = 'p' => boundary condition for p | 114 % type = 'p' => boundary condition for p |
115 % type = 'v' => boundary condition for v | 115 % type = 'v' => boundary condition for v |
116 % No other types implemented yet | 116 % No other types implemented yet |
117 | 117 |
118 % BC on the form Lu - g = 0; | 118 % BC on the form Lu - g = 0; |
119 switch type | |
120 case 'p' | |
121 L = [1, 0]; | |
122 case 'v' | |
123 L = [0, 1]; | |
124 otherwise | |
125 error('Boundary condition not implemented.'); | |
126 end | |
127 | 119 |
128 % Diagonalize B | 120 % Diagonalize B |
129 B = obj.B; | 121 B = obj.B; |
130 [T, Lambda] = eig(B); | 122 [T, Lambda] = eig(B); |
131 lambda = diag(Lambda); | 123 lambda = diag(Lambda); |
143 Iin = Iminus; | 135 Iin = Iminus; |
144 end | 136 end |
145 | 137 |
146 Tin = T(:,Iin); | 138 Tin = T(:,Iin); |
147 Tout = T(:,Iout); | 139 Tout = T(:,Iout); |
140 | |
141 switch type | |
142 case 'p' | |
143 L = [1, 0]; | |
144 case 'v' | |
145 L = [0, 1]; | |
146 case 'characteristic' | |
147 L = Tin'; | |
148 otherwise | |
149 error('Boundary condition not implemented.'); | |
150 end | |
148 | 151 |
149 % Penalty parameters | 152 % Penalty parameters |
150 A = obj.A; | 153 A = obj.A; |
151 sigma = [0; 0]; | 154 sigma = [0; 0]; |
152 sigma(Iin) = lambda(Iin); | 155 sigma(Iin) = lambda(Iin); |