Mercurial > repos > public > sbplib
annotate +scheme/Scheme.m @ 180:001239c03eb2 feature/beams
Merge with feature/grids.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 29 Feb 2016 15:08:01 +0100 |
parents | 8f22829b69d0 77e9f0a85862 |
children | ef41fde95ac4 |
rev | line source |
---|---|
0 | 1 % Start with all matrix returns. When that works see how we should generalize to non-matrix stuff/nonlinear |
2 classdef Scheme < handle | |
3 properties (Abstract) | |
4 order % Order accuracy for the approximation | |
5 | |
6 % vectors u,v,w depending on dim that gives were gridpoints are in each dimension | |
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 | |
10 D % non-stabalized scheme operator | |
11 H % Discrete norm | |
12 | |
13 % Should also containg: | |
14 % the grid points used | |
15 % the grid spacing | |
16 end | |
17 | |
18 methods (Abstract) | |
19 % Closure functions return the opertors applied to the own doamin to close the boundary | |
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. | |
21 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. | |
22 % type is a string specifying the type of boundary condition if there are several. | |
23 % neighbour_scheme is an instance of Scheme that should be interfaced to. | |
24 % neighbour_boundary is a string specifying which boundary to interface to. | |
175
8f22829b69d0
Added and upgraded schemes for the beam equation in 1d and 2d.
Jonatan Werpers <jonatan@werpers.com>
parents:
26
diff
changeset
|
25 [closure, penalty] = boundary_condition(obj,boundary,type) |
8f22829b69d0
Added and upgraded schemes for the beam equation in 1d and 2d.
Jonatan Werpers <jonatan@werpers.com>
parents:
26
diff
changeset
|
26 [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) |
0 | 27 N = size(obj) % Returns the number of degrees of freedom. |
28 | |
29 end | |
30 | |
31 methods(Static) | |
32 % Calculates the matrcis need for the inteface coupling between boundary bound_u of scheme schm_u | |
33 % and bound_v of scheme schm_v. | |
34 % [uu, uv, vv, vu] = inteface_couplong(A,'r',B,'l') | |
35 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); | |
37 [vv,vu] = schm_v.interface(bound_v,schm_u,bound_u); | |
38 end | |
39 end | |
40 end |