annotate +multiblock/+domain/Line.m @ 761:8ed102db8e9c feature/d1_staggered

Add discont interface in 1D acoustics staggered, using the hat variable interface coupling.
author Martin Almquist <malmquist@stanford.edu>
date Mon, 18 Jun 2018 16:36:24 -0700
parents 408fb46f7266
children 532b58a9e849
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
760
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
1 classdef Line < multiblock.Definition
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
2 properties
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
3
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
4 xlims
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
5 blockNames % Cell array of block labels
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
6 nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
7 connections % Cell array specifying connections between blocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
8 boundaryGroups % Structure of boundaryGroups
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
9
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
10 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
11
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
12
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
13 methods
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
14 % Creates a divided line
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
15 % x is a vector of boundary and interface positions.
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
16 % blockNames: cell array of labels. The id is default.
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
17 function obj = Line(x,blockNames)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
18 default_arg('blockNames',[]);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
19
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
20 N = length(x)-1; % number of blocks in the x direction.
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
21
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
22 if ~issorted(x)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
23 error('The elements of x seem to be in the wrong order');
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
24 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
25
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
26 % Dimensions of blocks and number of points
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
27 blockTi = cell(N,1);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
28 xlims = cell(N,1);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
29 for i = 1:N
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
30 xlims{i} = {x(i), x(i+1)};
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
31 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
32
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
33 % Interface couplings
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
34 conn = cell(N,N);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
35 for i = 1:N
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
36 conn{i,i+1} = {'r','l'};
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
37 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
38
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
39 % Block names (id number as default)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
40 if isempty(blockNames)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
41 obj.blockNames = cell(1, N);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
42 for i = 1:N
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
43 obj.blockNames{i} = sprintf('%d', i);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
44 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
45 else
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
46 assert(length(blockNames) == N);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
47 obj.blockNames = blockNames;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
48 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
49 nBlocks = N;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
50
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
51 % Boundary groups
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
52 boundaryGroups = struct();
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
53 L = { {1, 'l'} };
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
54 R = { {N, 'r'} };
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
55 boundaryGroups.L = multiblock.BoundaryGroup(L);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
56 boundaryGroups.R = multiblock.BoundaryGroup(R);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
57 boundaryGroups.all = multiblock.BoundaryGroup([L,R]);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
58
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
59 obj.connections = conn;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
60 obj.nBlocks = nBlocks;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
61 obj.boundaryGroups = boundaryGroups;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
62 obj.xlims = xlims;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
63
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
64 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
65
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
66
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
67 % Returns a multiblock.Grid given some parameters
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
68 % ms: cell array of m values
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
69 % For same m in every block, just input one scalar.
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
70 function g = getGrid(obj, ms, varargin)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
71
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
72 default_arg('ms',21)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
73
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
74 % Extend ms if input is a single scalar
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
75 if (numel(ms) == 1) && ~iscell(ms)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
76 m = ms;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
77 ms = cell(1,obj.nBlocks);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
78 for i = 1:obj.nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
79 ms{i} = m;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
80 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
81 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
82
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
83 grids = cell(1, obj.nBlocks);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
84 for i = 1:obj.nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
85 grids{i} = grid.equidistant(ms{i}, obj.xlims{i}, obj.ylims{i});
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
86 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
87
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
88 g = multiblock.Grid(grids, obj.connections, obj.boundaryGroups);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
89 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
90
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
91 % Returns a multiblock.Grid given some parameters
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
92 % ms: cell array of m values
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
93 % For same m in every block, just input one scalar.
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
94 function g = getStaggeredGrid(obj, ms, varargin)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
95
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
96 default_arg('ms',21)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
97
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
98 % Extend ms if input is a single scalar
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
99 if (numel(ms) == 1) && ~iscell(ms)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
100 m = ms;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
101 ms = cell(1,obj.nBlocks);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
102 for i = 1:obj.nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
103 ms{i} = m;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
104 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
105 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
106
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
107 grids = cell(1, obj.nBlocks);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
108 for i = 1:obj.nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
109 [g_primal, g_dual] = grid.primalDual1D(ms{i}, obj.xlims{i});
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
110 grids{i} = grid.Staggered1d(g_primal, g_dual);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
111 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
112
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
113 g = multiblock.Grid(grids, obj.connections, obj.boundaryGroups);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
114 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
115
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
116 % label is the type of label used for plotting,
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
117 % default is block name, 'id' show the index for each block.
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
118 function show(obj, label)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
119 default_arg('label', 'name')
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
120
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
121 m = 10;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
122 figure
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
123 for i = 1:obj.nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
124 x = linspace(obj.xlims{i}{1}, obj.xlims{i}{2}, m);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
125 y = 0*x + 0.05* ( (-1)^i + 1 ) ;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
126 plot(x,y,'+');
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
127 hold on
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
128 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
129 hold off
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
130
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
131 switch label
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
132 case 'name'
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
133 labels = obj.blockNames;
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
134 case 'id'
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
135 labels = {};
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
136 for i = 1:obj.nBlocks
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
137 labels{i} = num2str(i);
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
138 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
139 otherwise
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
140 axis equal
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
141 return
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
142 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
143
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
144 legend(labels)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
145 axis equal
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
146 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
147
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
148 % Returns the grid size of each block in a cell array
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
149 % The input parameters are determined by the subclass
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
150 function ms = getGridSizes(obj, varargin)
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
151 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
152 end
408fb46f7266 Add +multiblock/+domain/Line for 1D multiblock.
Martin Almquist <malmquist@stanford.edu>
parents:
diff changeset
153 end