rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
construct_grid.m
1 function grid = construct_grid(params)
2 %function grid = construct_grid(params)
3 %
4 % function giving a simple common constructor syntax to different
5 % grid types. See the constructors of the grid types with a single
6 % params option for details on specifications
7 %
8 % required fields of params:
9 % gridtype : 'rectgrid' or 'triagrid'
10 
11 % Bernard Haasdonk 18.5.2007
12 
13 if isfield(params,'gridtype')
14  switch params.gridtype
15  case 'rectgrid'
16  grid = rectgrid(params);
17  case 'onedgrid'
18  grid = onedgrid(params);
19  case 'triagrid'
20  grid = triagrid(params);
21  grid = set_boundary_types(grid, params);
22  case 'none'
23  % nothing to do
24  grid = [];
25  otherwise
26  error('gridtype not known')
27  end;
28 else
29  grid = [];
30 end;
A triangular conforming grid in two dimensions.
Definition: triagrid.m:17
A cartesian rectangular grid in two dimensions with axis parallel elements.
Definition: rectgrid.m:17
a one dimensional grid implementation
Definition: onedgrid.m:17