Mercurial > repos > public > sbplib
changeset 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 | a205264664cd |
children | 97291e1bd57c |
files | +sbp/InterpOpsMC.m +sbp/InterpOpsOP.m |
diffstat | 2 files changed, 16 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/+sbp/InterpOpsMC.m Tue Dec 04 12:54:33 2018 +0100 +++ b/+sbp/InterpOpsMC.m Tue Dec 04 14:06:42 2018 -0800 @@ -9,9 +9,9 @@ end methods - % x_u, x_v -- vectors of the coordinate that varies along the boundary + % m_u, m_v -- number of grid points along the interface % order_u, order_v -- order of accuracy in the different blocks - function obj = InterpOpsMC(x_u, x_v, order_u, order_v) + function obj = InterpOpsMC(m_u, m_v, order_u, order_v) assert(order_u == order_v,... 'InterpOpsMC: Different orders of accuracy not available'); @@ -29,27 +29,24 @@ error('InterpOpsMC: Order of accuracy %d not available.', order_u); end - m_u = length(x_u) - 1; - m_v = length(x_v) - 1; - Iu2v = struct; Iv2u = struct; - if m_u/m_v == 2 + if (m_u-1)/(m_v-1) == 2 % Block u is fine, v is coarse m_C = m_v; - [Iv2u.good, Iu2v.bad] = intOpSet(m_C+1); + [Iv2u.good, Iu2v.bad] = intOpSet(m_C); Iv2u.bad = Iv2u.good; Iu2v.good = Iu2v.bad; - elseif m_v/m_u == 2 + elseif (m_v-1)/(m_u-1) == 2 % Block v is fine, u is coarse m_C = m_u; - [Iu2v.good, Iv2u.bad] = intOpSet(m_C+1); + [Iu2v.good, Iv2u.bad] = intOpSet(m_C); Iu2v.bad = Iu2v.good; Iv2u.good = Iv2u.bad; else - error('InterpOpsMC: Interpolation operators for grid ratio %f have not yet been constructed', m_u/m_v); + error('InterpOpsMC: Interpolation operators for grid ratio %f have not yet been constructed', (m_u-1)/(m_v-1)); end obj.Iu2v = Iu2v;
--- a/+sbp/InterpOpsOP.m Tue Dec 04 12:54:33 2018 +0100 +++ b/+sbp/InterpOpsOP.m Tue Dec 04 14:06:42 2018 -0800 @@ -7,9 +7,9 @@ end methods - % x_u, x_v -- vectors of the coordinate that varies along the boundary + % m_u, m_v -- number of grid points along the interface % order_u, order_v -- order of accuracy in the different blocks - function obj = InterpOpsOP(x_u, x_v, order_u, order_v) + function obj = InterpOpsOP(m_u, m_v, order_u, order_v) assert(order_u == order_v,... 'InterpOpsOP: Different orders of accuracy not available'); @@ -27,25 +27,22 @@ error('InterpOpsOP: Order of accuracy %d not available.', order_u); end - m_u = length(x_u) - 1; - m_v = length(x_v) - 1; - Iu2v = struct; Iv2u = struct; - if m_u/m_v == 2 + if (m_u-1)/(m_v-1) == 2 % Block u is fine, v is coarse m_C = m_v; - [Iv2u.good, Iu2v.bad] = intOpSet(m_C+1, 1, 'C2F'); - [Iv2u.bad, Iu2v.good] = intOpSet(m_C+1, 1, 'F2C'); + [Iv2u.good, Iu2v.bad] = intOpSet(m_C, 1, 'C2F'); + [Iv2u.bad, Iu2v.good] = intOpSet(m_C, 1, 'F2C'); - elseif m_v/m_u == 2 + elseif (m_v-1)/(m_u-1) == 2 % Block v is fine, u is coarse m_C = m_u; - [Iu2v.good, Iv2u.bad] = intOpSet(m_C+1, 1, 'C2F'); - [Iu2v.bad, Iv2u.good] = intOpSet(m_C+1, 1, 'F2C'); + [Iu2v.good, Iv2u.bad] = intOpSet(m_C, 1, 'C2F'); + [Iu2v.bad, Iv2u.good] = intOpSet(m_C, 1, 'F2C'); else - error('InterpOpsOP: Interpolation operators for grid ratio %f have not yet been constructed', m_u/m_v); + error('InterpOpsOP: Interpolation operators for grid ratio %f have not yet been constructed', (m_u-1)/(m_v-1)); end obj.Iu2v = Iu2v;