annotate operator_def/assemble_D2.m @ 830:e15a667ffde2 feature/operator_files

Add quadrature stencils and operator assembly. Add tests
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 10 Sep 2018 19:27:27 +0200
parents e0913772dc1c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
829
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
1 function [D2,e_l,e_r,d1_l,d1_r] = assemble_D2(stencil,h,m)
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
2 stencil_variables = read_stencil(stencil);
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
3 D2 = assemble_op(stencil_variables.inner_stencil,stencil_variables.boundary_stencils,m,1)/h^2;
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
4 [e_l, e_r] = assemble_boundary_op(stencil_variables.e,m);
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
5 [d1_l, d1_r] = assemble_boundary_op(stencil_variables.d1,m);
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
6 d1_l = d1_l/h;
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
7 d1_r = -d1_r/h;
e0913772dc1c Add D2 files
Ylva Rydin <ylva.rydin@telia.com>
parents:
diff changeset
8 end