Mercurial > repos > public > sbplib
diff +sbp/+implementations/d4_variable_6.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/d4_variable_6.m Wed Oct 03 10:43:24 2018 -0700 +++ b/+sbp/+implementations/d4_variable_6.m Wed Oct 24 16:16:43 2018 -0700 @@ -85,7 +85,7 @@ scheme_radius = (scheme_width-1)/2; r = (1+scheme_radius):(m-scheme_radius); - function D2 = D2_fun(c) + function [D2, B] = D2_fun(c) Mm3 = c(r-2)/0.40e2 + c(r-1)/0.40e2 - 0.11e2/0.360e3 * c(r-3) - 0.11e2/0.360e3 * c(r); Mm2 = c(r-3)/0.20e2 - 0.3e1/0.10e2 * c(r-1) + c(r+1)/0.20e2 + 0.7e1/0.40e2 * c(r) + 0.7e1/0.40e2 * c(r-2); @@ -128,6 +128,7 @@ M=M/h; D2 = HI*(-M - c(1)*e_l*d1_l' + c(m)*e_r*d1_r'); + B = HI*M; end D2 = @D2_fun;