annotate +scheme/Heat2dCurvilinear.m @ 741:5a9acf282b34 feature/poroelastic

Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
author Martin Almquist <malmquist@stanford.edu>
date Wed, 09 May 2018 19:29:12 -0700
parents
children 08f3ffe63f48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
741
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
1 classdef Heat2dCurvilinear < scheme.Scheme
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
2
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
3 % Discretizes the Laplacian with variable coefficent, curvilinear,
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
4 % in the Heat equation way (i.e., the discretization matrix is not necessarily
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
5 % symmetric)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
6 % u_t = div * (kappa * grad u )
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
7 % opSet should be cell array of opSets, one per dimension. This
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
8 % is useful if we have periodic BC in one direction.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
9
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
10 properties
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
11 m % Number of points in each direction, possibly a vector
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
12 h % Grid spacing
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
13
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
14 grid
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
15 dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
16
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
17 order % Order of accuracy for the approximation
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
18
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
19 % Diagonal matrix for variable coefficients
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
20 KAPPA % Variable coefficient
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
21
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
22 D % Total operator
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
23 D1 % First derivatives
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
24
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
25 % Second derivatives
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
26 D2_kappa
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
27
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
28 H, Hi % Inner products
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
29 e_l, e_r
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
30 d1_l, d1_r % Normal derivatives at the boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
31 alpha % Vector of borrowing constants
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
32
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
33 % Boundary inner products
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
34 H_boundary_l, H_boundary_r
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
35
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
36 % Metric coefficients
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
37 b % Cell matrix of size dim x dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
38 J, Ji
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
39
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
40 % Numerical boundary flux operators
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
41 flux_l, flux_r
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
42
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
43 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
44
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
45 methods
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
46
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
47 function obj = Heat2dCurvilinear(g ,order, kappa_fun, opSet)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
48 default_arg('opSet',{@sbp.D2Variable, @sbp.D2Variable});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
49 default_arg('kappa_fun', @(x,y) 0*x+1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
50 dim = 2;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
51
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
52 kappa = grid.evalOn(g, kappa_fun);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
53 m = g.size();
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
54 m_tot = g.N();
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
55
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
56 % 1D operators
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
57 ops = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
58 for i = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
59 ops{i} = opSet{i}(m(i), {0, 1}, order);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
60 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
61
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
62 I = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
63 D1 = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
64 D2 = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
65 H = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
66 Hi = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
67 e_l = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
68 e_r = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
69 d1_l = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
70 d1_r = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
71
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
72 for i = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
73 I{i} = speye(m(i));
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
74 D1{i} = ops{i}.D1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
75 D2{i} = ops{i}.D2;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
76 H{i} = ops{i}.H;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
77 Hi{i} = ops{i}.HI;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
78 e_l{i} = ops{i}.e_l;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
79 e_r{i} = ops{i}.e_r;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
80 d1_l{i} = ops{i}.d1_l;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
81 d1_r{i} = ops{i}.d1_r;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
82 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
83
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
84 %====== Assemble full operators ========
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
85 KAPPA = spdiag(kappa);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
86 obj.KAPPA = KAPPA;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
87
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
88 % Allocate
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
89 obj.D1 = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
90 obj.D2_kappa = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
91 obj.e_l = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
92 obj.e_r = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
93 obj.d1_l = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
94 obj.d1_r = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
95
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
96 % D1
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
97 obj.D1{1} = kron(D1{1},I{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
98 obj.D1{2} = kron(I{1},D1{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
99
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
100 % -- Metric coefficients ----
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
101 coords = g.points();
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
102 x = coords(:,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
103 y = coords(:,2);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
104
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
105 % Use non-periodic difference operators for metric even if opSet is periodic.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
106 xmax = max(ops{1}.x);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
107 ymax = max(ops{2}.x);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
108 opSetMetric{1} = sbp.D2Variable(m(1), {0, xmax}, order);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
109 opSetMetric{2} = sbp.D2Variable(m(2), {0, ymax}, order);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
110 D1Metric{1} = kron(opSetMetric{1}.D1, I{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
111 D1Metric{2} = kron(I{1}, opSetMetric{2}.D1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
112
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
113 x_xi = D1Metric{1}*x;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
114 x_eta = D1Metric{2}*x;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
115 y_xi = D1Metric{1}*y;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
116 y_eta = D1Metric{2}*y;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
117
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
118 J = x_xi.*y_eta - x_eta.*y_xi;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
119
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
120 b = cell(dim,dim);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
121 b{1,1} = y_eta./J;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
122 b{1,2} = -x_eta./J;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
123 b{2,1} = -y_xi./J;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
124 b{2,2} = x_xi./J;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
125
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
126 % Scale factors for boundary integrals
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
127 beta = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
128 beta{1} = sqrt(x_eta.^2 + y_eta.^2);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
129 beta{2} = sqrt(x_xi.^2 + y_xi.^2);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
130
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
131 J = spdiag(J);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
132 Ji = inv(J);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
133 for i = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
134 beta{i} = spdiag(beta{i});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
135 for j = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
136 b{i,j} = spdiag(b{i,j});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
137 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
138 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
139 obj.J = J;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
140 obj.Ji = Ji;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
141 obj.b = b;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
142 %----------------------------
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
143
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
144 % Boundary operators
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
145 obj.e_l{1} = kron(e_l{1},I{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
146 obj.e_l{2} = kron(I{1},e_l{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
147 obj.e_r{1} = kron(e_r{1},I{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
148 obj.e_r{2} = kron(I{1},e_r{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
149
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
150 obj.d1_l{1} = kron(d1_l{1},I{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
151 obj.d1_l{2} = kron(I{1},d1_l{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
152 obj.d1_r{1} = kron(d1_r{1},I{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
153 obj.d1_r{2} = kron(I{1},d1_r{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
154
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
155 % D2 coefficients
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
156 kappa_coeff = cell(dim,dim);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
157 for j = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
158 obj.D2_kappa{j} = sparse(m_tot,m_tot);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
159 kappa_coeff{j} = sparse(m_tot,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
160 for i = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
161 kappa_coeff{j} = kappa_coeff{j} + b{i,j}*J*b{i,j}*kappa;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
162 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
163 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
164 ind = grid.funcToMatrix(g, 1:m_tot);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
165
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
166 % x-dir
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
167 j = 1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
168 for col = 1:m(2)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
169 D_kappa = D2{1}(kappa_coeff{j}(ind(:,col)));
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
170
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
171 p = ind(:,col);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
172 obj.D2_kappa{j}(p,p) = D_kappa;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
173 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
174
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
175 % y-dir
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
176 j = 2;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
177 for row = 1:m(1)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
178 D_kappa = D2{2}(kappa_coeff{j}(ind(row,:)));
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
179
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
180 p = ind(row,:);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
181 obj.D2_kappa{j}(p,p) = D_kappa;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
182 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
183
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
184 % Quadratures
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
185 obj.H = kron(H{1},H{2});
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
186 obj.Hi = inv(obj.H);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
187 obj.H_boundary_l = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
188 obj.H_boundary_l{1} = obj.e_l{1}'*beta{1}*obj.e_l{1}*H{2};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
189 obj.H_boundary_l{2} = obj.e_l{2}'*beta{2}*obj.e_l{2}*H{1};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
190 obj.H_boundary_r = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
191 obj.H_boundary_r{1} = obj.e_r{1}'*beta{1}*obj.e_r{1}*H{2};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
192 obj.H_boundary_r{2} = obj.e_r{2}'*beta{2}*obj.e_r{2}*H{1};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
193
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
194 %=== Differentiation matrix D (without SAT) ===
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
195 D2_kappa = obj.D2_kappa;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
196 D1 = obj.D1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
197 D = sparse(m_tot,m_tot);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
198
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
199 d = @kroneckerDelta; % Kronecker delta
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
200 db = @(i,j) 1-d(i,j); % Logical not of Kronecker delta
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
201
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
202 % 2nd derivatives
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
203 for j = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
204 D = D + Ji*D2_kappa{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
205 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
206
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
207 % Mixed terms
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
208 for i = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
209 for j = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
210 for k = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
211 D = D + db(i,j)*Ji*D1{j}*b{i,j}*J*KAPPA*b{i,k}*D1{k};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
212 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
213 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
214 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
215 obj.D = D;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
216 %=========================================%
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
217
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
218 % Normal flux operators for BC.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
219 flux_l = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
220 flux_r = cell(dim,1);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
221
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
222 d1_l = obj.d1_l;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
223 d1_r = obj.d1_r;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
224 e_l = obj.e_l;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
225 e_r = obj.e_r;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
226
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
227 % Loop over boundaries
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
228 for j = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
229 flux_l{j} = sparse(m_tot,m_tot);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
230 flux_r{j} = sparse(m_tot,m_tot);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
231
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
232 % Loop over dummy index
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
233 for i = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
234 % Loop over dummy index
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
235 for k = 1:dim
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
236 flux_l{j} = flux_l{j} ...
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
237 - beta{j}\b{i,j}*J*KAPPA*b{i,k}*( d(j,k)*e_l{k}*d1_l{k}' + db(j,k)*D1{k} );
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
238
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
239 flux_r{j} = flux_r{j} ...
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
240 + beta{j}\b{i,j}*J*KAPPA*b{i,k}*( d(j,k)*e_r{k}*d1_r{k}' + db(j,k)*D1{k} );
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
241 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
242
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
243 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
244 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
245 obj.flux_l = flux_l;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
246 obj.flux_r = flux_r;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
247
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
248 % Misc.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
249 obj.m = m;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
250 obj.h = g.scaling();
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
251 obj.order = order;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
252 obj.grid = g;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
253 obj.dim = dim;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
254 obj.alpha = [ops{1}.borrowing.M.d1, ops{2}.borrowing.M.d1];
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
255
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
256 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
257
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
258
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
259 % Closure functions return the operators applied to the own domain to close the boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
260 % Penalty functions return the operators to force the solution. In the case of an interface it returns the operator applied to the other doamin.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
261 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
262 % type is a string specifying the type of boundary condition.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
263 % data is a function returning the data that should be applied at the boundary.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
264 % neighbour_scheme is an instance of Scheme that should be interfaced to.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
265 % neighbour_boundary is a string specifying which boundary to interface to.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
266 function [closure, penalty] = boundary_condition(obj, boundary, type, symmetric, tuning)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
267 default_arg('type','Neumann');
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
268 default_arg('symmetric', false);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
269 default_arg('tuning',1.2);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
270
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
271 % j is the coordinate direction of the boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
272 % nj: outward unit normal component.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
273 % nj = -1 for west, south, bottom boundaries
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
274 % nj = 1 for east, north, top boundaries
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
275 [j, nj] = obj.get_boundary_number(boundary);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
276 switch nj
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
277 case 1
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
278 e = obj.e_r{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
279 flux = obj.flux_r{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
280 H_gamma = obj.H_boundary_r{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
281 case -1
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
282 e = obj.e_l{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
283 flux = obj.flux_l{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
284 H_gamma = obj.H_boundary_l{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
285 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
286
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
287 Hi = obj.Hi;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
288 Ji = obj.Ji;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
289 KAPPA = obj.KAPPA;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
290 kappa_gamma = e'*KAPPA*e;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
291 h = obj.h(j);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
292 alpha = h*obj.alpha(j);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
293
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
294 switch type
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
295
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
296 % Dirichlet boundary condition
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
297 case {'D','d','dirichlet','Dirichlet'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
298
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
299 if ~symmetric
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
300 closure = -Ji*Hi*flux'*e*H_gamma*(e' );
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
301 penalty = Ji*Hi*flux'*e*H_gamma;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
302 else
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
303 closure = Ji*Hi*flux'*e*H_gamma*(e' )...
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
304 -tuning*2/alpha*Ji*Hi*e*kappa_gamma*H_gamma*(e' ) ;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
305 penalty = -Ji*Hi*flux'*e*H_gamma ...
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
306 +tuning*2/alpha*Ji*Hi*e*kappa_gamma*H_gamma;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
307 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
308
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
309 % Normal flux boundary condition
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
310 case {'N','n','neumann','Neumann'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
311 closure = -Ji*Hi*e*H_gamma*(e'*flux );
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
312 penalty = Ji*Hi*e*H_gamma;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
313
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
314 % Unknown boundary condition
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
315 otherwise
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
316 error('No such boundary condition: type = %s',type);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
317 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
318 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
319
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
320 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
321 % u denotes the solution in the own domain
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
322 % v denotes the solution in the neighbour domain
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
323 error('Interface not implemented');
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
324 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
325
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
326 % Returns the coordinate number and outward normal component for the boundary specified by the string boundary.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
327 function [j, nj] = get_boundary_number(obj, boundary)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
328
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
329 switch boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
330 case {'w','W','west','West', 'e', 'E', 'east', 'East'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
331 j = 1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
332 case {'s','S','south','South', 'n', 'N', 'north', 'North'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
333 j = 2;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
334 otherwise
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
335 error('No such boundary: boundary = %s',boundary);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
336 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
337
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
338 switch boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
339 case {'w','W','west','West','s','S','south','South'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
340 nj = -1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
341 case {'e', 'E', 'east', 'East','n', 'N', 'north', 'North'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
342 nj = 1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
343 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
344 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
345
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
346 % Returns the coordinate number and outward normal component for the boundary specified by the string boundary.
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
347 function [return_op] = get_boundary_operator(obj, op, boundary)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
348
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
349 switch boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
350 case {'w','W','west','West', 'e', 'E', 'east', 'East'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
351 j = 1;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
352 case {'s','S','south','South', 'n', 'N', 'north', 'North'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
353 j = 2;
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
354 otherwise
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
355 error('No such boundary: boundary = %s',boundary);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
356 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
357
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
358 switch op
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
359 case 'e'
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
360 switch boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
361 case {'w','W','west','West','s','S','south','South'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
362 return_op = obj.e_l{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
363 case {'e', 'E', 'east', 'East','n', 'N', 'north', 'North'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
364 return_op = obj.e_r{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
365 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
366 case 'd'
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
367 switch boundary
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
368 case {'w','W','west','West','s','S','south','South'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
369 return_op = obj.d1_l{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
370 case {'e', 'E', 'east', 'East','n', 'N', 'north', 'North'}
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
371 return_op = obj.d1_r{j};
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
372 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
373 otherwise
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
374 error(['No such operator: operatr = ' op]);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
375 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
376
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
377 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
378
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
379 function N = size(obj)
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
380 N = prod(obj.m);
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
381 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
382 end
5a9acf282b34 Add scheme Heat2Dcurvilinear. Neumann and Dirichlet seem to work. Only tested for stretched Cartesian grids though.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
383 end