comparison +sbp/+implementations/intOpMC_orders_4to4_ratio2to1.m @ 608:c923fe6197ff feature/interpolation

Add inerpolation operator classes and implementations for MC and AWW.
author Martin Almquist <malmquist@stanford.edu>
date Sat, 14 Oct 2017 22:32:25 -0700
parents
children
comparison
equal deleted inserted replaced
607:0546de4b31a2 608:c923fe6197ff
1 % Marks New interpolation operators
2 % 4th order to 2nd order accurate (diagonal norm)
3 % M=9 is the minimum amount of points on the coarse mesh
4
5 function [IC2F,IF2C] = intOpMC_orders_4to4_ratio2to1(M_C)
6
7 M_F=M_C*2-1;
8
9 % Coarse to fine
10 I1=zeros(M_F,M_C);
11 t1=[ 2047/2176 , 129/1088 , -129/2176 , 0 , 0 , 0 , 0 ,...
12 0 ;...
13 429/944 , 279/472 , -43/944 , 0 , 0 , 0 , 0 , 0 ;...
14 111/2752 , 4913/5504 , 3/32 , -147/5504 ,...
15 0 , 0 , 0 , 0 ;...
16 -103/784 , 549/784 , 387/784 , -1/16 , 0 ,...
17 0 , 0 , 0 ;...
18 -335/3072 , 205/768 , 2365/3072 , 49/512 ,...
19 -3/128 , 0 , 0 , 0 ;...
20 -9/256 , 5/256 , 129/256 , 147/256 ,...
21 -1/16 , 0 , 0 , 0 ;...
22 5/192 , -59/1024 , 43/512 , 2695/3072 ,...
23 3/32 , -3/128 , 0 , 0 ;...
24 23/768 , -37/768 , -43/768 , 147/256 ,...
25 9/16 , -1/16 , 0 , 0 ;...
26 13/2048 , -11/1024 , -43/2048 , 49/512 ,...
27 55/64 , 3/32 , -3/128 , 0 ;...
28 -1/384 , 1/256 , 0 , -49/768 , 9/16 ,...
29 9/16 , -1/16 , 0 ;...
30 -1/1024 , 3/2048 , 0 , -49/2048 , 3/32 ,...
31 55/64 , 3/32 , -3/128];
32
33
34 t2=[-3/128 3/32 55/64 3/32 -3/128];
35 t3=[-1/16 9/16 9/16 -1/16];
36 I1(1:11,1:8)=t1;
37 I1(M_F-10:M_F,M_C-7:M_C)=fliplr(flipud(t1));
38 I1(12,5:8)=t3;
39 for i=13:2:M_F-12
40 j=(i-1)/2;
41 I1(i,j-1:j+3)=t2;
42 I1(i+1,j:j+3)=t3;
43 end
44
45 % Fine to coarse
46 I2=zeros(M_C,M_F);
47
48 t1=[ 2047/4352 , 429/544 , 111/2176 , -103/544 ...
49 , -335/2176 , -27/544 , 5/136 , 23/544 ,...
50 39/4352 , -1/272 , -3/2176 ;...
51 129/7552 , 279/944 , 4913/15104 , 549/1888 ...
52 , 205/1888 , 15/1888 , -3/128 , -37/1888 ...
53 , -33/7552 , 3/1888 , 9/15104 ];
54 t2=[-3/256 -1/32 3/64 9/32 55/128 9/32 3/64 -1/32 -3/256];
55
56 I2(1:2,1:11)=t1;
57
58 I2(M_C-1:M_C,M_F-10:M_F)=fliplr(flipud(t1));
59
60 for i=3:M_C-2
61 j=2*(i-3)+1;
62 I2(i,j:j+8)=t2;
63 end
64
65 IC2F = sparse(I1);
66 IF2C = sparse(I2);