Mercurial > repos > public > sbplib
comparison +multiblock/Laplace.m @ 748:ec0a594bea9f feature/grids
Add a multiblock wrapper for laplace
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 24 May 2018 16:40:12 +0200 |
parents | |
children | 43e64f5b388e |
comparison
equal
deleted
inserted
replaced
747:c3e89f9b2af7 | 748:ec0a594bea9f |
---|---|
1 classdef Laplace < scheme.Scheme | |
2 properties | |
3 grid | |
4 order | |
5 mbDiffOp | |
6 | |
7 D | |
8 H | |
9 J | |
10 end | |
11 methods | |
12 function obj = Laplace(g, order, a, b, opGen) | |
13 default_arg('order', 4); | |
14 default_arg('a', 1); | |
15 default_arg('b', 1); | |
16 default_arg('opGen', @sbp.D4Variable); | |
17 | |
18 obj.grid = g; | |
19 obj.order = order; | |
20 obj.mbDiffOp = multiblock.DiffOp(@scheme.LaplaceCurvilinear, obj.grid, order, {a,b,opGen}); | |
21 | |
22 obj.D = obj.mbDiffOp.D; | |
23 obj.J = obj.jacobian(); | |
24 obj.H = obj.mbDiffOp.H * obj.jacobian(); | |
25 end | |
26 | |
27 function s = size(obj) | |
28 s = size(obj.mbDiffOp); | |
29 end | |
30 | |
31 function J = jacobian(obj) | |
32 N = obj.grid.nBlocks; | |
33 J = cell(N,N); | |
34 | |
35 for i = 1:N | |
36 J{i,i} = obj.mbDiffOp.diffOps{i}.J; | |
37 end | |
38 J = blockmatrix.toMatrix(J); | |
39 end | |
40 | |
41 function op = getBoundaryOperator(obj, opName, boundary) | |
42 op = getBoundaryOperator(obj.mbDiffOp, opName, boundary); | |
43 end | |
44 | |
45 function [closure, penalty] = boundary_condition(obj,boundary,type) % TODO: Change name to boundaryCondition | |
46 [closure, penalty] = boundary_condition(obj.mbDiffOp, boundary, type) | |
47 end | |
48 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary) | |
49 error('Not implemented') | |
50 end | |
51 end | |
52 end |