Mercurial > repos > public > sbplib
annotate +scheme/Elastic2dStaggeredCurvilinearAnisotropic.m @ 1334:df8c71b80c33 feature/D2_boundary_opt
Use the logic grid associated with a CurvilinearGrid instead of creating a new one
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sat, 07 May 2022 10:40:47 +0200 |
parents | 01a0500de446 |
children |
rev | line source |
---|---|
1281
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
1 classdef Elastic2dStaggeredCurvilinearAnisotropic < scheme.Scheme |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
2 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
3 % Discretizes the elastic wave equation: |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
4 % rho u_{i,tt} = dj C_{ijkl} dk u_j |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
5 % in curvilinear coordinates, using Lebedev staggered grids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
6 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
7 properties |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
8 m % Number of points in each direction, possibly a vector |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
9 h % Grid spacing |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
10 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
11 grid |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
12 dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
13 nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
14 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
15 order % Order of accuracy for the approximation |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
16 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
17 % Diagonal matrices for variable coefficients |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
18 J, Ji |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
19 RHO % Density |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
20 C % Elastic stiffness tensor |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
21 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
22 D % Total operator |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
23 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
24 % Dx, Dy % Physical derivatives |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
25 n_w, n_e, n_s, n_n % Physical normals |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
26 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
27 % Boundary operators in cell format, used for BC |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
28 T_w, T_e, T_s, T_n |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
29 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
30 % Traction operators |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
31 % tau_w, tau_e, tau_s, tau_n % Return vector field |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
32 % tau1_w, tau1_e, tau1_s, tau1_n % Return scalar field |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
33 % tau2_w, tau2_e, tau2_s, tau2_n % Return scalar field |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
34 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
35 % Inner products |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
36 H |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
37 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
38 % Boundary inner products (for scalar field) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
39 H_w, H_e, H_s, H_n |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
40 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
41 % Surface Jacobian vectors |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
42 s_w, s_e, s_s, s_n |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
43 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
44 % Boundary restriction operators |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
45 e_w_u, e_e_u, e_s_u, e_n_u % Act on scalar field, return scalar field at boundary |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
46 e_w_s, e_e_s, e_s_s, e_n_s % Act on scalar field, return scalar field at boundary |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
47 % e1_w, e1_e, e1_s, e1_n % Act on vector field, return scalar field at boundary |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
48 % e2_w, e2_e, e2_s, e2_n % Act on vector field, return scalar field at boundary |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
49 % e_scalar_w, e_scalar_e, e_scalar_s, e_scalar_n; % Act on scalar field, return scalar field |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
50 % en_w, en_e, en_s, en_n % Act on vector field, return normal component |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
51 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
52 % U{i}^T picks out component i |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
53 U |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
54 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
55 % G{i}^T picks out displacement grid i |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
56 G |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
57 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
58 % Elastic2dVariableAnisotropic object for reference domain |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
59 refObj |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
60 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
61 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
62 methods |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
63 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
64 % The coefficients can either be function handles or grid functions |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
65 % optFlag -- if true, extra computations are performed, which may be helpful for optimization. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
66 function obj = Elastic2dStaggeredCurvilinearAnisotropic(g, order, rho, C) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
67 default_arg('rho', @(x,y) 0*x+1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
68 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
69 opSet = @sbp.D1StaggeredUpwind; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
70 dim = 2; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
71 nGrids = 2; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
72 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
73 C_default = cell(dim,dim,dim,dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
74 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
75 for j = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
76 for k = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
77 for l = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
78 C_default{i,j,k,l} = @(x,y) 0*x; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
79 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
80 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
81 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
82 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
83 default_arg('C', C_default); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
84 assert(isa(g, 'grid.Staggered')); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
85 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
86 g_u = g.gridGroups{1}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
87 g_s = g.gridGroups{2}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
88 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
89 m_u = {g_u{1}.size(), g_u{2}.size()}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
90 m_s = {g_s{1}.size(), g_s{2}.size()}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
91 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
92 if isa(rho, 'function_handle') |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
93 rho_vec = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
94 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
95 rho_vec{a} = grid.evalOn(g_u{a}, rho); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
96 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
97 rho = rho_vec; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
98 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
99 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
100 RHO{a} = spdiag(rho{a}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
101 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
102 obj.RHO = RHO; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
103 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
104 C_mat = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
105 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
106 C_mat{a} = cell(dim,dim,dim,dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
107 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
108 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
109 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
110 for j = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
111 for k = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
112 for l = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
113 if numel(C) == dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
114 C_mat{a}{i,j,k,l} = spdiag(C{a}{i,j,k,l}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
115 else |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
116 C_mat{a}{i,j,k,l} = spdiag(grid.evalOn(g_s{a}, C{i,j,k,l})); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
117 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
118 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
119 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
120 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
121 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
122 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
123 obj.C = C_mat; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
124 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
125 C = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
126 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
127 C{a} = cell(dim,dim,dim,dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
128 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
129 for j = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
130 for k = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
131 for l = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
132 C{a}{i,j,k,l} = diag(C_mat{a}{i,j,k,l}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
133 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
134 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
135 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
136 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
137 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
138 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
139 % Reference m for primal grid |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
140 m = g_u{1}.size(); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
141 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
142 % 1D operators |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
143 ops = cell(dim,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
144 D1p = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
145 D1d = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
146 mp = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
147 md = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
148 Ip = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
149 Id = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
150 Hp = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
151 Hd = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
152 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
153 opSet = @sbp.D1StaggeredUpwind; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
154 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
155 ops{i} = opSet(m(i), {0,1}, order); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
156 D1p{i} = ops{i}.D1_dual; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
157 D1d{i} = ops{i}.D1_primal; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
158 mp{i} = length(ops{i}.x_primal); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
159 md{i} = length(ops{i}.x_dual); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
160 Ip{i} = speye(mp{i}, mp{i}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
161 Id{i} = speye(md{i}, md{i}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
162 Hp{i} = ops{i}.H_primal; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
163 Hd{i} = ops{i}.H_dual; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
164 ep_l{i} = ops{i}.e_primal_l; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
165 ep_r{i} = ops{i}.e_primal_r; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
166 ed_l{i} = ops{i}.e_dual_l; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
167 ed_r{i} = ops{i}.e_dual_r; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
168 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
169 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
170 % D1_u2s{a, b}{i} approximates ddi and |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
171 % takes from u grid number b to s grid number a |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
172 % Some of D1_x2y{a, b} are 0. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
173 D1_u2s = cell(nGrids, nGrids); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
174 D1_s2u = cell(nGrids, nGrids); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
175 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
176 N_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
177 N_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
178 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
179 N_u{a} = g_u{a}.N(); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
180 N_s{a} = g_s{a}.N(); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
181 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
182 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
183 %---- Grid layout ------- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
184 % gu1 = xp o yp; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
185 % gu2 = xd o yd; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
186 % gs1 = xd o yp; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
187 % gs2 = xp o yd; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
188 %------------------------ |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
189 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
190 % Logical operators |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
191 D1_u2s{1,1}{1} = kron(D1p{1}, Ip{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
192 D1_s2u{1,1}{1} = kron(D1d{1}, Ip{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
193 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
194 D1_u2s{1,2}{2} = kron(Id{1}, D1d{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
195 D1_u2s{2,1}{2} = kron(Ip{1}, D1p{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
196 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
197 D1_s2u{1,2}{2} = kron(Ip{1}, D1d{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
198 D1_s2u{2,1}{2} = kron(Id{1}, D1p{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
199 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
200 D1_u2s{2,2}{1} = kron(D1d{1}, Id{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
201 D1_s2u{2,2}{1} = kron(D1p{1}, Id{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
202 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
203 D1_u2s{1,1}{2} = sparse(N_s{1}, N_u{1}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
204 D1_s2u{1,1}{2} = sparse(N_u{1}, N_s{1}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
205 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
206 D1_u2s{2,2}{2} = sparse(N_s{2}, N_u{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
207 D1_s2u{2,2}{2} = sparse(N_u{2}, N_s{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
208 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
209 D1_u2s{1,2}{1} = sparse(N_s{1}, N_u{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
210 D1_s2u{1,2}{1} = sparse(N_u{1}, N_s{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
211 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
212 D1_u2s{2,1}{1} = sparse(N_s{2}, N_u{1}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
213 D1_s2u{2,1}{1} = sparse(N_u{2}, N_s{1}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
214 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
215 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
216 %---- Combine grids and components ----- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
217 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
218 % U{a}{i}^T picks out u component i on grid a |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
219 U = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
220 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
221 U{a} = cell(dim, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
222 I = speye(N_u{a}, N_u{a}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
223 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
224 E = sparse(dim,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
225 E(i) = 1; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
226 U{a}{i} = kron(I, E); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
227 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
228 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
229 obj.U = U; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
230 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
231 % Order grids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
232 % u1, u2 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
233 Iu1 = speye(dim*N_u{1}, dim*N_u{1}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
234 Iu2 = speye(dim*N_u{2}, dim*N_u{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
235 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
236 Gu1 = cell2mat( {Iu1; sparse(dim*N_u{2}, dim*N_u{1})} ); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
237 Gu2 = cell2mat( {sparse(dim*N_u{1}, dim*N_u{2}); Iu2} ); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
238 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
239 G = {Gu1; Gu2}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
240 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
241 %---- Grid layout ------- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
242 % gu1 = xp o yp; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
243 % gu2 = xd o yd; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
244 % gs1 = xd o yp; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
245 % gs2 = xp o yd; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
246 %------------------------ |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
247 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
248 % Boundary restriction ops |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
249 e_w_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
250 e_s_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
251 e_e_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
252 e_n_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
253 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
254 e_w_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
255 e_s_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
256 e_e_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
257 e_n_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
258 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
259 e_w_u{1} = kron(ep_l{1}, Ip{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
260 e_e_u{1} = kron(ep_r{1}, Ip{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
261 e_s_u{1} = kron(Ip{1}, ep_l{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
262 e_n_u{1} = kron(Ip{1}, ep_r{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
263 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
264 e_w_u{2} = kron(ed_l{1}, Id{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
265 e_e_u{2} = kron(ed_r{1}, Id{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
266 e_s_u{2} = kron(Id{1}, ed_l{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
267 e_n_u{2} = kron(Id{1}, ed_r{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
268 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
269 e_w_s{1} = kron(ed_l{1}, Ip{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
270 e_e_s{1} = kron(ed_r{1}, Ip{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
271 e_s_s{1} = kron(Id{1}, ep_l{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
272 e_n_s{1} = kron(Id{1}, ep_r{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
273 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
274 e_w_s{2} = kron(ep_l{1}, Id{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
275 e_e_s{2} = kron(ep_r{1}, Id{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
276 e_s_s{2} = kron(Ip{1}, ed_l{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
277 e_n_s{2} = kron(Ip{1}, ed_r{2}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
278 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
279 % --- Metric coefficients on stress grids ------- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
280 x = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
281 y = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
282 J = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
283 x_xi = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
284 x_eta = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
285 y_xi = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
286 y_eta = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
287 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
288 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
289 coords = g_u{a}.points(); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
290 x{a} = coords(:,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
291 y{a} = coords(:,2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
292 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
293 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
294 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
295 x_xi{a} = zeros(N_s{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
296 y_xi{a} = zeros(N_s{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
297 x_eta{a} = zeros(N_s{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
298 y_eta{a} = zeros(N_s{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
299 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
300 for b = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
301 x_xi{a} = x_xi{a} + D1_u2s{a,b}{1}*x{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
302 y_xi{a} = y_xi{a} + D1_u2s{a,b}{1}*y{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
303 x_eta{a} = x_eta{a} + D1_u2s{a,b}{2}*x{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
304 y_eta{a} = y_eta{a} + D1_u2s{a,b}{2}*y{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
305 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
306 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
307 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
308 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
309 J{a} = x_xi{a}.*y_eta{a} - x_eta{a}.*y_xi{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
310 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
311 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
312 K = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
313 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
314 K{a} = cell(dim, dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
315 K{a}{1,1} = y_eta{a}./J{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
316 K{a}{1,2} = -y_xi{a}./J{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
317 K{a}{2,1} = -x_eta{a}./J{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
318 K{a}{2,2} = x_xi{a}./J{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
319 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
320 % ---------------------------------------------- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
321 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
322 % --- Metric coefficients on displacement grids ------- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
323 x_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
324 y_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
325 J_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
326 x_xi_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
327 x_eta_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
328 y_xi_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
329 y_eta_u = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
330 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
331 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
332 coords = g_s{a}.points(); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
333 x_s{a} = coords(:,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
334 y_s{a} = coords(:,2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
335 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
336 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
337 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
338 x_xi_u{a} = zeros(N_u{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
339 y_xi_u{a} = zeros(N_u{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
340 x_eta_u{a} = zeros(N_u{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
341 y_eta_u{a} = zeros(N_u{a}, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
342 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
343 for b = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
344 x_xi_u{a} = x_xi_u{a} + D1_s2u{a,b}{1}*x_s{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
345 y_xi_u{a} = y_xi_u{a} + D1_s2u{a,b}{1}*y_s{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
346 x_eta_u{a} = x_eta_u{a} + D1_s2u{a,b}{2}*x_s{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
347 y_eta_u{a} = y_eta_u{a} + D1_s2u{a,b}{2}*y_s{b}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
348 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
349 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
350 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
351 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
352 J_u{a} = x_xi_u{a}.*y_eta_u{a} - x_eta_u{a}.*y_xi_u{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
353 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
354 % ---------------------------------------------- |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
355 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
356 % x_u = Du*x; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
357 % x_v = Dv*x; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
358 % y_u = Du*y; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
359 % y_v = Dv*y; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
360 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
361 % J = x_u.*y_v - x_v.*y_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
362 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
363 % K = cell(dim, dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
364 % K{1,1} = y_v./J; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
365 % K{1,2} = -y_u./J; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
366 % K{2,1} = -x_v./J; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
367 % K{2,2} = x_u./J; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
368 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
369 % Physical derivatives |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
370 % obj.Dx = spdiag( y_v./J)*Du + spdiag(-y_u./J)*Dv; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
371 % obj.Dy = spdiag(-x_v./J)*Du + spdiag( x_u./J)*Dv; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
372 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
373 % Wrap around Aniosotropic Cartesian. Transformed density and stiffness |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
374 rho_tilde = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
375 PHI = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
376 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
377 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
378 rho_tilde{a} = J_u{a}.*rho{a}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
379 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
380 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
381 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
382 PHI{a} = cell(dim,dim,dim,dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
383 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
384 for j = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
385 for k = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
386 for l = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
387 PHI{a}{i,j,k,l} = 0*C{a}{i,j,k,l}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
388 for m = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
389 for n = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
390 PHI{a}{i,j,k,l} = PHI{a}{i,j,k,l} + J{a}.*K{a}{m,i}.*C{a}{m,j,n,l}.*K{a}{n,k}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
391 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
392 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
393 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
394 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
395 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
396 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
397 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
398 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
399 refObj = scheme.Elastic2dStaggeredAnisotropic(g.logic, order, rho_tilde, PHI); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
400 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
401 G = refObj.G; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
402 U = refObj.U; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
403 H_u = refObj.H_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
404 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
405 % Volume quadrature |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
406 [m, n] = size(refObj.H); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
407 obj.H = sparse(m, n); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
408 obj.J = sparse(m, n); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
409 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
410 for i = 1:dim |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
411 obj.H = obj.H + G{a}*U{a}{i}*spdiag(J_u{a})*refObj.H_u{a}*U{a}{i}'*G{a}'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
412 obj.J = obj.J + G{a}*U{a}{i}*spdiag(J_u{a})*U{a}{i}'*G{a}'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
413 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
414 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
415 obj.Ji = inv(obj.J); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
416 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
417 % Boundary quadratures on stress grids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
418 s_w = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
419 s_e = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
420 s_s = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
421 s_n = cell(nGrids, 1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
422 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
423 % e_w_u = refObj.e_w_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
424 % e_e_u = refObj.e_e_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
425 % e_s_u = refObj.e_s_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
426 % e_n_u = refObj.e_n_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
427 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
428 e_w_s = refObj.e_w_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
429 e_e_s = refObj.e_e_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
430 e_s_s = refObj.e_s_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
431 e_n_s = refObj.e_n_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
432 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
433 for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
434 s_w{a} = sqrt((e_w_s{a}'*x_eta{a}).^2 + (e_w_s{a}'*y_eta{a}).^2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
435 s_e{a} = sqrt((e_e_s{a}'*x_eta{a}).^2 + (e_e_s{a}'*y_eta{a}).^2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
436 s_s{a} = sqrt((e_s_s{a}'*x_xi{a}).^2 + (e_s_s{a}'*y_xi{a}).^2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
437 s_n{a} = sqrt((e_n_s{a}'*x_xi{a}).^2 + (e_n_s{a}'*y_xi{a}).^2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
438 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
439 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
440 obj.s_w = s_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
441 obj.s_e = s_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
442 obj.s_s = s_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
443 obj.s_n = s_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
444 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
445 % for a = 1:nGrids |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
446 % obj.H_w_s{a} = refObj.H_w_s{a}*spdiag(s_w{a}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
447 % obj.H_e_s{a} = refObj.H_e_s{a}*spdiag(s_e{a}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
448 % obj.H_s_s{a} = refObj.H_s_s{a}*spdiag(s_s{a}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
449 % obj.H_n_s{a} = refObj.H_n_s{a}*spdiag(s_n{a}); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
450 % end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
451 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
452 % Restriction operators |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
453 obj.e_w_u = refObj.e_w_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
454 obj.e_e_u = refObj.e_e_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
455 obj.e_s_u = refObj.e_s_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
456 obj.e_n_u = refObj.e_n_u; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
457 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
458 obj.e_w_s = refObj.e_w_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
459 obj.e_e_s = refObj.e_e_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
460 obj.e_s_s = refObj.e_s_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
461 obj.e_n_s = refObj.e_n_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
462 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
463 % Adapt things from reference object |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
464 obj.D = refObj.D; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
465 obj.U = refObj.U; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
466 obj.G = refObj.G; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
467 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
468 % obj.e1_w = refObj.e1_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
469 % obj.e1_e = refObj.e1_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
470 % obj.e1_s = refObj.e1_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
471 % obj.e1_n = refObj.e1_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
472 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
473 % obj.e2_w = refObj.e2_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
474 % obj.e2_e = refObj.e2_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
475 % obj.e2_s = refObj.e2_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
476 % obj.e2_n = refObj.e2_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
477 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
478 % obj.e_scalar_w = refObj.e_scalar_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
479 % obj.e_scalar_e = refObj.e_scalar_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
480 % obj.e_scalar_s = refObj.e_scalar_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
481 % obj.e_scalar_n = refObj.e_scalar_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
482 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
483 % e1_w = obj.e1_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
484 % e1_e = obj.e1_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
485 % e1_s = obj.e1_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
486 % e1_n = obj.e1_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
487 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
488 % e2_w = obj.e2_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
489 % e2_e = obj.e2_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
490 % e2_s = obj.e2_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
491 % e2_n = obj.e2_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
492 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
493 % obj.tau1_w = (spdiag(1./s_w)*refObj.tau1_w')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
494 % obj.tau1_e = (spdiag(1./s_e)*refObj.tau1_e')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
495 % obj.tau1_s = (spdiag(1./s_s)*refObj.tau1_s')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
496 % obj.tau1_n = (spdiag(1./s_n)*refObj.tau1_n')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
497 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
498 % obj.tau2_w = (spdiag(1./s_w)*refObj.tau2_w')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
499 % obj.tau2_e = (spdiag(1./s_e)*refObj.tau2_e')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
500 % obj.tau2_s = (spdiag(1./s_s)*refObj.tau2_s')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
501 % obj.tau2_n = (spdiag(1./s_n)*refObj.tau2_n')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
502 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
503 % obj.tau_w = (refObj.e_w'*obj.e1_w*obj.tau1_w')' + (refObj.e_w'*obj.e2_w*obj.tau2_w')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
504 % obj.tau_e = (refObj.e_e'*obj.e1_e*obj.tau1_e')' + (refObj.e_e'*obj.e2_e*obj.tau2_e')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
505 % obj.tau_s = (refObj.e_s'*obj.e1_s*obj.tau1_s')' + (refObj.e_s'*obj.e2_s*obj.tau2_s')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
506 % obj.tau_n = (refObj.e_n'*obj.e1_n*obj.tau1_n')' + (refObj.e_n'*obj.e2_n*obj.tau2_n')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
507 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
508 % % Physical normals |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
509 % e_w = obj.e_scalar_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
510 % e_e = obj.e_scalar_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
511 % e_s = obj.e_scalar_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
512 % e_n = obj.e_scalar_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
513 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
514 % e_w_vec = obj.e_w; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
515 % e_e_vec = obj.e_e; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
516 % e_s_vec = obj.e_s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
517 % e_n_vec = obj.e_n; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
518 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
519 % nu_w = [-1,0]; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
520 % nu_e = [1,0]; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
521 % nu_s = [0,-1]; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
522 % nu_n = [0,1]; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
523 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
524 % obj.n_w = cell(2,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
525 % obj.n_e = cell(2,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
526 % obj.n_s = cell(2,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
527 % obj.n_n = cell(2,1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
528 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
529 % n_w_1 = (1./s_w).*e_w'*(J.*(K{1,1}*nu_w(1) + K{1,2}*nu_w(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
530 % n_w_2 = (1./s_w).*e_w'*(J.*(K{2,1}*nu_w(1) + K{2,2}*nu_w(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
531 % obj.n_w{1} = spdiag(n_w_1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
532 % obj.n_w{2} = spdiag(n_w_2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
533 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
534 % n_e_1 = (1./s_e).*e_e'*(J.*(K{1,1}*nu_e(1) + K{1,2}*nu_e(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
535 % n_e_2 = (1./s_e).*e_e'*(J.*(K{2,1}*nu_e(1) + K{2,2}*nu_e(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
536 % obj.n_e{1} = spdiag(n_e_1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
537 % obj.n_e{2} = spdiag(n_e_2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
538 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
539 % n_s_1 = (1./s_s).*e_s'*(J.*(K{1,1}*nu_s(1) + K{1,2}*nu_s(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
540 % n_s_2 = (1./s_s).*e_s'*(J.*(K{2,1}*nu_s(1) + K{2,2}*nu_s(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
541 % obj.n_s{1} = spdiag(n_s_1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
542 % obj.n_s{2} = spdiag(n_s_2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
543 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
544 % n_n_1 = (1./s_n).*e_n'*(J.*(K{1,1}*nu_n(1) + K{1,2}*nu_n(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
545 % n_n_2 = (1./s_n).*e_n'*(J.*(K{2,1}*nu_n(1) + K{2,2}*nu_n(2))); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
546 % obj.n_n{1} = spdiag(n_n_1); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
547 % obj.n_n{2} = spdiag(n_n_2); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
548 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
549 % % Operators that extract the normal component |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
550 % obj.en_w = (obj.n_w{1}*obj.e1_w' + obj.n_w{2}*obj.e2_w')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
551 % obj.en_e = (obj.n_e{1}*obj.e1_e' + obj.n_e{2}*obj.e2_e')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
552 % obj.en_s = (obj.n_s{1}*obj.e1_s' + obj.n_s{2}*obj.e2_s')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
553 % obj.en_n = (obj.n_n{1}*obj.e1_n' + obj.n_n{2}*obj.e2_n')'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
554 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
555 % Misc. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
556 obj.refObj = refObj; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
557 obj.m = refObj.m; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
558 obj.h = refObj.h; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
559 obj.order = order; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
560 obj.grid = g; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
561 obj.dim = dim; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
562 obj.nGrids = nGrids; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
563 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
564 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
565 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
566 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
567 % Closure functions return the operators applied to the own domain to close the boundary |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
568 % Penalty functions return the operators to force the solution. In the case of an interface it returns the operator applied to the other doamin. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
569 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
570 % bc is a cell array of component and bc type, e.g. {1, 'd'} for Dirichlet condition |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
571 % on the first component. Can also be e.g. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
572 % {'normal', 'd'} or {'tangential', 't'} for conditions on |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
573 % tangential/normal component. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
574 % data is a function returning the data that should be applied at the boundary. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
575 % neighbour_scheme is an instance of Scheme that should be interfaced to. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
576 % neighbour_boundary is a string specifying which boundary to interface to. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
577 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
578 % For displacement bc: |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
579 % bc = {comp, 'd', dComps}, |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
580 % where |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
581 % dComps = vector of components with displacement BC. Default: 1:dim. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
582 % In this way, we can specify one BC at a time even though the SATs depend on all BC. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
583 function [closure, penalty] = boundary_condition(obj, boundary, bc, tuning) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
584 default_arg('tuning', 1.0); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
585 assert( iscell(bc), 'The BC type must be a 2x1 or 3x1 cell array' ); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
586 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
587 [closure, penalty] = obj.refObj.boundary_condition(boundary, bc, tuning); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
588 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
589 type = bc{2}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
590 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
591 switch type |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
592 case {'F','f','Free','free','traction','Traction','t','T'} |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
593 s = obj.(['s_' boundary]); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
594 s = spdiag(cell2mat(s)); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
595 penalty = penalty*s; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
596 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
597 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
598 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
599 % type Struct that specifies the interface coupling. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
600 % Fields: |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
601 % -- tuning: penalty strength, defaults to 1.0 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
602 % -- interpolation: type of interpolation, default 'none' |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
603 function [closure, penalty] = interface(obj,boundary,neighbour_scheme,neighbour_boundary,type) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
604 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
605 defaultType.tuning = 1.0; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
606 defaultType.interpolation = 'none'; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
607 default_struct('type', defaultType); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
608 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
609 [closure, penalty] = obj.refObj.interface(boundary,neighbour_scheme.refObj,neighbour_boundary,type); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
610 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
611 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
612 % Returns h11 for the boundary specified by the string boundary. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
613 % op -- string |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
614 function h11 = getBorrowing(obj, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
615 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
616 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
617 switch boundary |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
618 case {'w','e'} |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
619 h11 = obj.refObj.h11{1}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
620 case {'s', 'n'} |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
621 h11 = obj.refObj.h11{2}; |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
622 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
623 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
624 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
625 % Returns the outward unit normal vector for the boundary specified by the string boundary. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
626 % n is a cell of diagonal matrices for each normal component, n{1} = n_1, n{2} = n_2. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
627 function n = getNormal(obj, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
628 error('Not implemented'); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
629 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
630 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
631 n = obj.(['n_' boundary]); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
632 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
633 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
634 % Returns the boundary operator op for the boundary specified by the string boundary. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
635 % op -- string |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
636 function o = getBoundaryOperator(obj, op, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
637 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
638 assertIsMember(op, {'e', 'e1', 'e2', 'tau', 'tau1', 'tau2', 'en'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
639 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
640 o = obj.([op, '_', boundary]); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
641 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
642 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
643 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
644 % Returns the boundary operator op for the boundary specified by the string boundary. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
645 % op -- string |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
646 function o = getBoundaryOperatorForScalarField(obj, op, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
647 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
648 assertIsMember(op, {'e_u', 'e_s'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
649 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
650 switch op |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
651 case 'e_u' |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
652 o = obj.(['e_', boundary, '_u']); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
653 case 'e_s' |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
654 o = obj.(['e_', boundary, '_s']); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
655 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
656 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
657 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
658 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
659 % Returns the boundary operator T_ij (cell format) for the boundary specified by the string boundary. |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
660 % Formula: tau_i = T_ij u_j |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
661 % op -- string |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
662 function T = getBoundaryTractionOperator(obj, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
663 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
664 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
665 T = obj.(['T', '_', boundary]); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
666 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
667 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
668 % Returns square boundary quadrature matrix, of dimension |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
669 % corresponding to the number of boundary unknowns |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
670 % |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
671 % boundary -- string |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
672 function H = getBoundaryQuadrature(obj, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
673 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
674 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
675 H = obj.getBoundaryQuadratureForScalarField(boundary); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
676 I_dim = speye(obj.dim, obj.dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
677 H = kron(H, I_dim); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
678 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
679 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
680 % Returns square boundary quadrature matrix, of dimension |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
681 % corresponding to the number of boundary grid points |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
682 % |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
683 % boundary -- string |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
684 function H_b = getBoundaryQuadratureForScalarField(obj, boundary) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
685 assertIsMember(boundary, {'w', 'e', 's', 'n'}) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
686 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
687 H_b = obj.(['H_', boundary]); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
688 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
689 |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
690 function N = size(obj) |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
691 N = length(obj.D); |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
692 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
693 end |
01a0500de446
Add working implementation of Elastic2dStaggeredCurvilinearAnisotropic, which wraps around the Cartesian anisotropic scheme.
Martin Almquist <malmquist@stanford.edu>
parents:
diff
changeset
|
694 end |