changeset 829:e0913772dc1c feature/operator_files

Add D2 files
author Ylva Rydin <ylva.rydin@telia.com>
date Mon, 10 Sep 2018 19:25:41 +0200
parents f82da6644f42
children e15a667ffde2
files operator_def/D2_standard_2 operator_def/assemble_D2.m
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/operator_def/D2_standard_2	Mon Sep 10 19:25:41 2018 +0200
@@ -0,0 +1,13 @@
+# D2 order 2
+
+boundary_stencils
+1 -2 1
+
+inner_stencil
+1 -2 1
+
+e
+1 0
+
+d1
+-3/2 2 -1/2
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/operator_def/assemble_D2.m	Mon Sep 10 19:25:41 2018 +0200
@@ -0,0 +1,8 @@
+function [D2,e_l,e_r,d1_l,d1_r] = assemble_D2(stencil,h,m)
+  stencil_variables = read_stencil(stencil);  
+  D2 = assemble_op(stencil_variables.inner_stencil,stencil_variables.boundary_stencils,m,1)/h^2;
+  [e_l, e_r] = assemble_boundary_op(stencil_variables.e,m);
+  [d1_l, d1_r] = assemble_boundary_op(stencil_variables.d1,m);
+  d1_l = d1_l/h;
+  d1_r = -d1_r/h;
+  end
\ No newline at end of file