Mercurial > repos > public > sbplib
comparison +sbp/InterpOpsMC.m @ 937:ed8c98c4d479 feature/utux2D
Use only number of grid points as arguments in InterpOpsXX, instead of coordinates.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Tue, 04 Dec 2018 14:06:42 -0800 |
parents | 4291731570bb |
children | 27ce3f653aa7 |
comparison
equal
deleted
inserted
replaced
936:a205264664cd | 937:ed8c98c4d479 |
---|---|
7 Iu2v | 7 Iu2v |
8 Iv2u | 8 Iv2u |
9 end | 9 end |
10 | 10 |
11 methods | 11 methods |
12 % x_u, x_v -- vectors of the coordinate that varies along the boundary | 12 % m_u, m_v -- number of grid points along the interface |
13 % order_u, order_v -- order of accuracy in the different blocks | 13 % order_u, order_v -- order of accuracy in the different blocks |
14 function obj = InterpOpsMC(x_u, x_v, order_u, order_v) | 14 function obj = InterpOpsMC(m_u, m_v, order_u, order_v) |
15 | 15 |
16 assert(order_u == order_v,... | 16 assert(order_u == order_v,... |
17 'InterpOpsMC: Different orders of accuracy not available'); | 17 'InterpOpsMC: Different orders of accuracy not available'); |
18 | 18 |
19 switch order_u | 19 switch order_u |
27 intOpSet = @sbp.implementations.intOpMC_orders_8to8_ratio2to1; | 27 intOpSet = @sbp.implementations.intOpMC_orders_8to8_ratio2to1; |
28 otherwise | 28 otherwise |
29 error('InterpOpsMC: Order of accuracy %d not available.', order_u); | 29 error('InterpOpsMC: Order of accuracy %d not available.', order_u); |
30 end | 30 end |
31 | 31 |
32 m_u = length(x_u) - 1; | |
33 m_v = length(x_v) - 1; | |
34 | |
35 Iu2v = struct; | 32 Iu2v = struct; |
36 Iv2u = struct; | 33 Iv2u = struct; |
37 | 34 |
38 if m_u/m_v == 2 | 35 if (m_u-1)/(m_v-1) == 2 |
39 % Block u is fine, v is coarse | 36 % Block u is fine, v is coarse |
40 m_C = m_v; | 37 m_C = m_v; |
41 [Iv2u.good, Iu2v.bad] = intOpSet(m_C+1); | 38 [Iv2u.good, Iu2v.bad] = intOpSet(m_C); |
42 Iv2u.bad = Iv2u.good; | 39 Iv2u.bad = Iv2u.good; |
43 Iu2v.good = Iu2v.bad; | 40 Iu2v.good = Iu2v.bad; |
44 | 41 |
45 elseif m_v/m_u == 2 | 42 elseif (m_v-1)/(m_u-1) == 2 |
46 % Block v is fine, u is coarse | 43 % Block v is fine, u is coarse |
47 m_C = m_u; | 44 m_C = m_u; |
48 [Iu2v.good, Iv2u.bad] = intOpSet(m_C+1); | 45 [Iu2v.good, Iv2u.bad] = intOpSet(m_C); |
49 Iu2v.bad = Iu2v.good; | 46 Iu2v.bad = Iu2v.good; |
50 Iv2u.good = Iv2u.bad; | 47 Iv2u.good = Iv2u.bad; |
51 else | 48 else |
52 error('InterpOpsMC: Interpolation operators for grid ratio %f have not yet been constructed', m_u/m_v); | 49 error('InterpOpsMC: Interpolation operators for grid ratio %f have not yet been constructed', (m_u-1)/(m_v-1)); |
53 end | 50 end |
54 | 51 |
55 obj.Iu2v = Iu2v; | 52 obj.Iu2v = Iu2v; |
56 obj.Iv2u = Iv2u; | 53 obj.Iv2u = Iv2u; |
57 | 54 |