diff +sbp/+implementations/d2_variable_4.m @ 1331:60c875c18de3 feature/D2_boundary_opt

Merge with feature/poroelastic for Elastic schemes
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 10 Mar 2022 16:54:26 +0100
parents b758d1cf4c8e
children e54c2f54dbfe
line wrap: on
line diff
--- a/+sbp/+implementations/d2_variable_4.m	Thu Feb 17 18:55:11 2022 +0100
+++ b/+sbp/+implementations/d2_variable_4.m	Thu Mar 10 16:54:26 2022 +0100
@@ -49,7 +49,7 @@
 
 
     N = m;
-    function D2 = D2_fun(c)
+    function [D2, B] = D2_fun(c)
         M = 78+(N-12)*5;
         %h = 1/(N-1);
 
@@ -131,6 +131,8 @@
             cols(40+(i-7)*5:44+(i-7)*5) = [i-2;i-1;i;i+1;i+2];
         end
         D2 = sparse(rows,cols,D2);
+
+        B = HI*( c(end)*e_r*d1_r' - c(1)*e_l*d1_l') - D2;
     end
     D2 = @D2_fun;
 end
\ No newline at end of file