Mercurial > repos > public > sbplib
comparison +multiblock/Grid.m @ 529:2ec8080027ab feature/boundaryGroup
Add some documentation and decide on public function signatures
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 03 Aug 2017 14:09:00 +0200 |
parents | 8ba675cc8827 |
children | 0cd7b8128e04 |
comparison
equal
deleted
inserted
replaced
528:6712655953d3 | 529:2ec8080027ab |
---|---|
7 nPoints | 7 nPoints |
8 end | 8 end |
9 | 9 |
10 % General multiblock grid | 10 % General multiblock grid |
11 methods | 11 methods |
12 | 12 % grids -- cell array of N grids |
13 % grids -- cell array of N grids | 13 % connections -- NxN upper triangular cell matrix. connections{i,j} |
14 % connections -- NxN upper triangular cell matrix. connections{i,j} | 14 % specifies the connection between block i and j. If |
15 % specifies the connection between block i and j. If | 15 % it's empty there is no connection otherwise it's a 2 |
16 % it's empty there is no connection otherwise it's a 2 | 16 % -cell-vector with strings naming the boundaries to be |
17 % -cell-vector with strings naming the boundaries to be | 17 % connected. (inverted coupling?) |
18 % connected. (inverted coupling?) | 18 % boundaryGroups -- A struct of BoundaryGroups. The field names of the |
19 %% Should we have boundary groups at all? maybe it can be handled in a | 19 % struct are the names of each boundary group. |
20 %% cleaner way outside of the class. Maybe the grid class doesn't need to care at all. All boundaryGroup interaction is in DiffOp? | 20 % The boundary groups can be used to collect block |
21 % boundaries into physical boundaries to simplify | |
22 % getting boundary operators and setting boundary conditions | |
21 function obj = Grid(grids, connections, boundaryGroups) | 23 function obj = Grid(grids, connections, boundaryGroups) |
24 default_arg('boundaryGroups', struct()); | |
22 obj.grids = grids; | 25 obj.grids = grids; |
23 obj.connections = connections; | 26 obj.connections = connections; |
24 | 27 |
25 obj.nPoints = 0; | 28 obj.nPoints = 0; |
26 for i = 1:length(grids) | 29 for i = 1:length(grids) |
27 obj.nPoints = obj.nPoints + grids{i}.N(); | 30 obj.nPoints = obj.nPoints + grids{i}.N(); |
28 end | 31 end |
29 | 32 |
30 % if iscell(boundaryGroups) | 33 obj.boundaryGroups = boundaryGroups; |
31 end | 34 end |
32 | 35 |
33 function n = size(obj) | 36 function n = size(obj) |
34 n = length(obj.grids); | 37 n = length(obj.grids); |
35 end | 38 end |
119 % Find what grid a point lies on | 122 % Find what grid a point lies on |
120 end | 123 end |
121 | 124 |
122 end | 125 end |
123 | 126 |
127 % Find all non interface boundaries of all blocks. | |
128 % Return their grid.boundaryIdentifiers in a cell array. | |
124 function bs = getBoundaryNames(obj) | 129 function bs = getBoundaryNames(obj) |
125 bs = []; | 130 error('not implemented'); |
126 end | 131 end |
127 | 132 |
128 % Return coordinates for the given boundary | 133 % Return coordinates for the given boundary/boundaryGroup |
129 function b = getBoundary(obj, name) | 134 function b = getBoundary(obj, name) |
130 b = []; | 135 error('not implemented'); |
131 end | 136 end |
132 end | 137 end |
133 end | 138 end |