Mercurial > repos > public > sbplib
changeset 910:b9c98661ff5d feature/utux2D
Change the name of the last interface method argument from type to opts in all schemes.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 23 Nov 2018 20:39:40 -0800 |
parents | ab1759166a8c |
children | f7306f03f77a |
files | +scheme/Beam.m +scheme/Beam2d.m +scheme/Elastic2dVariable.m +scheme/Euler1d.m +scheme/Heat2dVariable.m +scheme/Hypsyst2d.m +scheme/Hypsyst2dCurve.m +scheme/Hypsyst3d.m +scheme/Hypsyst3dCurve.m +scheme/LaplaceCurvilinear.m +scheme/Scheme.m +scheme/Schrodinger.m +scheme/Schrodinger2d.m +scheme/Utux.m +scheme/Utux2D.m +scheme/Wave.m +scheme/Wave2d.m +scheme/Wave2dCurve.m |
diffstat | 18 files changed, 40 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Beam.m --- a/+scheme/Beam.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Beam.m Fri Nov 23 20:39:40 2018 -0800 @@ -170,7 +170,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain [e_u,d1_u,d2_u,d3_u,s_u] = obj.get_boundary_ops(boundary);
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Beam2d.m --- a/+scheme/Beam2d.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Beam2d.m Fri Nov 23 20:39:40 2018 -0800 @@ -161,7 +161,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain [e_u,d1_u,d2_u,d3_u,s_u,gamm_u,delt_u, halfnorm_inv] = obj.get_boundary_ops(boundary);
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Elastic2dVariable.m --- a/+scheme/Elastic2dVariable.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Elastic2dVariable.m Fri Nov 23 20:39:40 2018 -0800 @@ -352,7 +352,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain tuning = 1.2;
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Euler1d.m --- a/+scheme/Euler1d.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Euler1d.m Fri Nov 23 20:39:40 2018 -0800 @@ -446,7 +446,7 @@ closure = @closure_fun; end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) error('NOT DONE') % u denotes the solution in the own domain % v denotes the solution in the neighbour domain
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Heat2dVariable.m --- a/+scheme/Heat2dVariable.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Heat2dVariable.m Fri Nov 23 20:39:40 2018 -0800 @@ -196,7 +196,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain error('Interface not implemented');
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Hypsyst2d.m --- a/+scheme/Hypsyst2d.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Hypsyst2d.m Fri Nov 23 20:39:40 2018 -0800 @@ -93,7 +93,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) error('An interface function does not exist yet'); end
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Hypsyst2dCurve.m --- a/+scheme/Hypsyst2dCurve.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Hypsyst2dCurve.m Fri Nov 23 20:39:40 2018 -0800 @@ -128,7 +128,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) error('An interface function does not exist yet'); end
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Hypsyst3d.m --- a/+scheme/Hypsyst3d.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Hypsyst3d.m Fri Nov 23 20:39:40 2018 -0800 @@ -168,7 +168,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) error('An interface function does not exist yet'); end
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Hypsyst3dCurve.m --- a/+scheme/Hypsyst3dCurve.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Hypsyst3dCurve.m Fri Nov 23 20:39:40 2018 -0800 @@ -264,7 +264,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) error('An interface function does not exist yet'); end
diff -r ab1759166a8c -r b9c98661ff5d +scheme/LaplaceCurvilinear.m --- a/+scheme/LaplaceCurvilinear.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/LaplaceCurvilinear.m Fri Nov 23 20:39:40 2018 -0800 @@ -273,28 +273,28 @@ end end - % type Struct that specifies the interface coupling. + % opts Struct that specifies the interface coupling. % Fields: % -- tuning: penalty strength, defaults to 1.2 % -- interpolation: struct of interpolation operators (empty for conforming grids) - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) - if isempty(type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) + if isempty(opts) [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary); else - assertType(type, 'struct'); - if isfield(type, 'I_local2neighbor') - [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type); + assertType(opts, 'struct'); + if isfield(opts, 'I_local2neighbor') + [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,opts); else - [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,type); + [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,opts); end end end - function [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interfaceStandard(obj,boundary,neighbour_scheme,neighbour_boundary,opts) - default_arg('type', struct); - default_field(type, 'tuning', 1.2); - tuning = type.tuning; + default_arg('opts', struct); + default_field(opts, 'tuning', 1.2); + tuning = opts.tuning; % u denotes the solution in the own domain % v denotes the solution in the neighbour domain @@ -323,17 +323,17 @@ penalty = obj.a*obj.Hi*(-tau*e_v' + sig*d_v'); end - function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interfaceNonConforming(obj,boundary,neighbour_scheme,neighbour_boundary,opts) - default_field(type, 'tuning', 1.2); - tuning = type.tuning; + default_field(opts, 'tuning', 1.2); + tuning = opts.tuning; % u denotes the solution in the own domain % v denotes the solution in the neighbour domain - I_u2v_good = type.I_local2neighbor.good; - I_u2v_bad = type.I_local2neighbor.bad; - I_v2u_good = type.I_neighbor2local.good; - I_v2u_bad = type.I_neighbor2local.bad; + I_u2v_good = opts.I_local2neighbor.good; + I_u2v_bad = opts.I_local2neighbor.bad; + I_v2u_good = opts.I_neighbor2local.good; + I_v2u_bad = opts.I_neighbor2local.bad; [e_u, d_u, gamm_u, H_b_u, I_u] = obj.get_boundary_ops(boundary); [e_v, d_v, gamm_v, H_b_v, I_v] = neighbour_scheme.get_boundary_ops(neighbour_boundary);
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Scheme.m --- a/+scheme/Scheme.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Scheme.m Fri Nov 23 20:39:40 2018 -0800 @@ -27,11 +27,12 @@ % penalty may be a cell array if there are several penalties with different weights [closure, penalty] = boundary_condition(obj,boundary,type) % TODO: Change name to boundaryCondition - % type Specifies the type of interface coupling. - % The format of type is different for every scheme. - % Some schemes may only have one type implemented, in which case - % the input argument is a dummy. - [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + % opts multiblock.InterfaceOptions object that specifies + % the details of the interface coupling. + % The format of opts is different for every scheme. + % Some schemes may only have one interface treatment + % implemented, in which case opts is a dummy. + [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % TODO: op = getBoundaryOperator()?? % makes sense to have it available through a method instead of random properties
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Schrodinger.m --- a/+scheme/Schrodinger.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Schrodinger.m Fri Nov 23 20:39:40 2018 -0800 @@ -90,7 +90,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain [e_u,d_u,s_u] = obj.get_boundary_ops(boundary);
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Schrodinger2d.m --- a/+scheme/Schrodinger2d.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Schrodinger2d.m Fri Nov 23 20:39:40 2018 -0800 @@ -202,7 +202,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain % Get neighbour boundary operator
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Utux.m --- a/+scheme/Utux.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Utux.m Fri Nov 23 20:39:40 2018 -0800 @@ -68,7 +68,7 @@ end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) switch boundary % Upwind coupling case {'l','left'}
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Utux2D.m --- a/+scheme/Utux2D.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Utux2D.m Fri Nov 23 20:39:40 2018 -0800 @@ -132,7 +132,7 @@ end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % Get neighbour boundary operator switch neighbour_boundary
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Wave.m --- a/+scheme/Wave.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Wave.m Fri Nov 23 20:39:40 2018 -0800 @@ -112,7 +112,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain [e_u,d_u,s_u] = obj.get_boundary_ops(boundary);
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Wave2d.m --- a/+scheme/Wave2d.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Wave2d.m Fri Nov 23 20:39:40 2018 -0800 @@ -158,7 +158,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain [e_u,d_u,s_u,gamm_u, halfnorm_inv] = obj.get_boundary_ops(boundary);
diff -r ab1759166a8c -r b9c98661ff5d +scheme/Wave2dCurve.m --- a/+scheme/Wave2dCurve.m Fri Nov 23 20:21:28 2018 -0800 +++ b/+scheme/Wave2dCurve.m Fri Nov 23 20:39:40 2018 -0800 @@ -243,7 +243,7 @@ end end - function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) + function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,opts) % u denotes the solution in the own domain % v denotes the solution in the neighbour domain tuning = 1.2;