diff +sbp/+implementations/d2_variable_4.m @ 860:b758d1cf4c8e feature/poroelastic

Add computation of HI*M to D2Variable to make adjoint gradient computation easier.
author Martin Almquist <malmquist@stanford.edu>
date Wed, 24 Oct 2018 16:16:43 -0700
parents 43d02533bea3
children e54c2f54dbfe
line wrap: on
line diff
--- a/+sbp/+implementations/d2_variable_4.m	Wed Oct 03 10:43:24 2018 -0700
+++ b/+sbp/+implementations/d2_variable_4.m	Wed Oct 24 16:16:43 2018 -0700
@@ -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