Mercurial > repos > public > sbplib
comparison +grid/Cartesian.m @ 812:6b83dcb46f54 feature/grids
Merge with feature/poroelastic
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 27 Jul 2018 10:31:51 -0700 |
parents | 031d6db97270 |
children |
comparison
equal
deleted
inserted
replaced
798:e76321b89c1e | 812:6b83dcb46f54 |
---|---|
3 n % Number of points in the grid | 3 n % Number of points in the grid |
4 d % Number of dimensions | 4 d % Number of dimensions |
5 m % Number of points in each direction | 5 m % Number of points in each direction |
6 x % Cell array of vectors with node placement for each dimension. | 6 x % Cell array of vectors with node placement for each dimension. |
7 h % Spacing/Scaling | 7 h % Spacing/Scaling |
8 lim % Cell array of left and right boundaries for each dimension. | |
8 end | 9 end |
9 | 10 |
10 % General d dimensional grid with n points | 11 % General d dimensional grid with n points |
11 methods | 12 methods |
12 % Creates a cartesian grid given vectors conatining the coordinates | 13 % Creates a cartesian grid given vectors conatining the coordinates |
25 if obj.n == 0 | 26 if obj.n == 0 |
26 error('grid:Cartesian:EmptyGrid','Input parameter gives an empty grid.') | 27 error('grid:Cartesian:EmptyGrid','Input parameter gives an empty grid.') |
27 end | 28 end |
28 | 29 |
29 obj.h = []; | 30 obj.h = []; |
31 | |
32 obj.lim = cell(1,obj.d); | |
33 for i = 1:obj.d | |
34 obj.lim{i} = {obj.x{i}(1), obj.x{i}(end)}; | |
35 end | |
30 end | 36 end |
31 % n returns the number of points in the grid | 37 % n returns the number of points in the grid |
32 function o = N(obj) | 38 function o = N(obj) |
33 o = obj.n; | 39 o = obj.n; |
34 end | 40 end |