Mercurial > repos > public > sbplib
annotate +grid/Grid.m @ 1198:2924b3a9b921 feature/d2_compatible
Add OpSet for fully compatible D2Variable, created from regular D2Variable by replacing d1 by first row of D1. Formal reduction by one order of accuracy at the boundary point.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 16 Aug 2019 14:30:28 -0700 |
parents | 763d50caddf3 |
children |
rev | line source |
---|---|
153
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 classdef Grid < handle |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 % General d dimensional grid with n points |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 methods (Abstract) |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
4 % n returns the number of points in the grid |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 o = N(obj) |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
6 |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
7 % d returns the spatial dimension of the grid |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
8 o = D(obj) |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
9 |
155
cf748f33cd5b
Removed some extra lines, added some notes and comments. Fixed classname.
Jonatan Werpers <jonatan@werpers.com>
parents:
153
diff
changeset
|
10 % points returns a n x d matrix containing the coordinates for all points. |
153
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
11 X = points(obj) |
158
685ba6e6c679
Added abstract methods to Grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
155
diff
changeset
|
12 |
685ba6e6c679
Added abstract methods to Grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
155
diff
changeset
|
13 % Restricts the grid function gf on obj to the subgrid g. |
164
772365e2cf96
Correct method signatures in Grid.m
Jonatan Werpers <jonatan@werpers.com>
parents:
158
diff
changeset
|
14 gf = restrictFunc(obj, gf, g) |
158
685ba6e6c679
Added abstract methods to Grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
155
diff
changeset
|
15 |
685ba6e6c679
Added abstract methods to Grid.
Jonatan Werpers <jonatan@werpers.com>
parents:
155
diff
changeset
|
16 % Projects the grid function gf on obj to the grid g. |
164
772365e2cf96
Correct method signatures in Grid.m
Jonatan Werpers <jonatan@werpers.com>
parents:
158
diff
changeset
|
17 gf = projectFunc(obj, gf, g) |
188
c5ca9bbfed41
Added methods to hande boundaries to Grid. Added failing tests and method stubs.
Jonatan Werpers <jonatan@werpers.com>
parents:
182
diff
changeset
|
18 |
527
763d50caddf3
Move the description of boundary identifiers to the grid package and update documentation for grid.Grid.getBoundaryNames
Jonatan Werpers <jonatan@werpers.com>
parents:
188
diff
changeset
|
19 % Return the grid.boundaryIdentifiers of all boundaries in a cell array. |
188
c5ca9bbfed41
Added methods to hande boundaries to Grid. Added failing tests and method stubs.
Jonatan Werpers <jonatan@werpers.com>
parents:
182
diff
changeset
|
20 bs = getBoundaryNames(obj) |
c5ca9bbfed41
Added methods to hande boundaries to Grid. Added failing tests and method stubs.
Jonatan Werpers <jonatan@werpers.com>
parents:
182
diff
changeset
|
21 |
c5ca9bbfed41
Added methods to hande boundaries to Grid. Added failing tests and method stubs.
Jonatan Werpers <jonatan@werpers.com>
parents:
182
diff
changeset
|
22 % Return coordinates for the given boundary |
c5ca9bbfed41
Added methods to hande boundaries to Grid. Added failing tests and method stubs.
Jonatan Werpers <jonatan@werpers.com>
parents:
182
diff
changeset
|
23 b = getBoundary(obj, name) |
153
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
24 end |
7aee9eba3bb8
Added abstract classes for some different types of grids.
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
25 end |