Mercurial > repos > public > sbplib
comparison +scheme/Scheme.m @ 200:ef41fde95ac4 feature/beams
Merged feature/grids into feature/beams.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 13 Jun 2016 16:59:02 +0200 |
parents | 001239c03eb2 fad5e81389c1 |
children | 15d604e4e1a1 |
comparison
equal
deleted
inserted
replaced
181:419ec303e97d | 200:ef41fde95ac4 |
---|---|
1 % Start with all matrix returns. When that works see how we should generalize to non-matrix stuff/nonlinear | 1 % Start with all matrix returns. When that works see how we should generalize |
2 % to non-matrix stuff/nonlinear | |
2 classdef Scheme < handle | 3 classdef Scheme < handle |
3 properties (Abstract) | 4 properties (Abstract) |
4 order % Order accuracy for the approximation | 5 order % Order accuracy for the approximation |
5 | 6 |
6 % vectors u,v,w depending on dim that gives were gridpoints are in each dimension | 7 grid |
7 % vectors x,y,z containing the x,y,z values corresponding to each grid point | |
8 % matrices X,Y,Z with point coordinates as multi dimensional vectors | |
9 | 8 |
10 D % non-stabalized scheme operator | 9 D % non-stabalized scheme operator |
11 H % Discrete norm | 10 H % Discrete norm |
12 | |
13 % Should also containg: | |
14 % the grid points used | |
15 % the grid spacing | |
16 end | 11 end |
17 | 12 |
18 methods (Abstract) | 13 methods (Abstract) |
19 % Closure functions return the opertors applied to the own doamin to close the boundary | 14 % Closure functions return the opertors applied to the own doamin to |
20 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. | 15 % close the boundary Penalty functions return the opertors to force |
21 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. | 16 % the solution. In the case of an interface it returns the operator |
22 % type is a string specifying the type of boundary condition if there are several. | 17 % applied to the other doamin. In some cases the penalty return value |
23 % neighbour_scheme is an instance of Scheme that should be interfaced to. | 18 % can be ommited and the closure function take care of both parts. |
24 % neighbour_boundary is a string specifying which boundary to interface to. | 19 % boundary is a string specifying the boundary e.g. |
25 [closure, penalty] = boundary_condition(obj,boundary,type) | 20 % 'l','r' or 'e','w','n','s'. |
21 % type is a string specifying the type of | |
22 % boundary condition if there are several. | |
23 % data is a function returning the data that | |
24 % should be applied at the boundary. | |
25 % neighbour_scheme is an instance of Scheme that should be | |
26 % interfaced to. | |
27 % neighbour_boundary is a string specifying which boundary to | |
28 % interface to. | |
29 [closure, penalty] = boundary_condition(obj,boundary,type,data) | |
26 [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) | 30 [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) |
27 N = size(obj) % Returns the number of degrees of freedom. | |
28 | 31 |
32 % Returns the number of degrees of freedom. | |
33 N = size(obj) | |
29 end | 34 end |
30 | 35 |
31 methods(Static) | 36 methods(Static) |
32 % Calculates the matrcis need for the inteface coupling between boundary bound_u of scheme schm_u | 37 % Calculates the matrcis need for the inteface coupling between |
33 % and bound_v of scheme schm_v. | 38 % boundary bound_u of scheme schm_u and bound_v of scheme schm_v. |
34 % [uu, uv, vv, vu] = inteface_couplong(A,'r',B,'l') | 39 % [uu, uv, vv, vu] = inteface_coupling(A,'r',B,'l') |
35 function [uu, uv, vv, vu] = interface_coupling(schm_u,bound_u,schm_v,bound_v) | 40 function [uu, uv, vv, vu] = interface_coupling(schm_u,bound_u,schm_v,bound_v) |
36 [uu,uv] = schm_u.interface(bound_u,schm_v,bound_v); | 41 [uu,uv] = schm_u.interface(bound_u,schm_v,bound_v); |
37 [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u); | 42 [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u); |
38 end | 43 end |
39 end | 44 end |