Mercurial > repos > public > sbplib
changeset 557:2a856a589510 feature/grids/laplace_refactor
Add creation of physical boundary normal derivatives
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 29 Aug 2017 12:32:57 +0200 |
parents | 2eb1ccef26cd |
children | 54c775c3348a e3f587bfd7f8 |
files | +scheme/LaplaceCurvilinear.m |
diffstat | 1 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/+scheme/LaplaceCurvilinear.m Tue Aug 29 12:22:33 2017 +0200 +++ b/+scheme/LaplaceCurvilinear.m Tue Aug 29 12:32:57 2017 +0200 @@ -170,6 +170,25 @@ obj.e_s = e_s; obj.e_n = e_n; + %% normal derivatives + I_w = ind(1,:); + I_e = ind(end,:); + I_s = ind(:,1); + I_n = ind(:,end); + + a11_w = spdiag(a11(I_w)); + a12_w = spdiag(a12(I_w)); + a11_e = spdiag(a11(I_e)); + a12_e = spdiag(a12(I_e)); + a22_s = spdiag(a22(I_s)); + a12_s = spdiag(a12(I_s)); + a22_n = spdiag(a22(I_n)); + a12_n = spdiag(a12(I_n)); + + d_w = -1*(a11_w*obj.du_w' + a12_w*obj.dv_w')'; + d_e = (a11_e*obj.du_e' + a12_e*obj.dv_e')'; + d_s = -1*(a22_s*obj.dv_s' + a12_s*obj.du_s')'; + d_n = (a22_n*obj.dv_n' + a12_n*obj.du_n')'; obj.Dx = spdiag( y_v./J)*Du + spdiag(-y_u./J)*Dv; obj.Dy = spdiag(-x_v./J)*Du + spdiag( x_u./J)*Dv;