rbmatlab 0.10.01
|
00001 function grid = construct_grid(params) 00002 %function grid = construct_grid(params) 00003 % 00004 % function giving a simple common constructor syntax to different 00005 % grid types. See the constructors of the grid types with a single 00006 % params option for details on specifications 00007 % 00008 % required fields of params: 00009 % gridtype : 'rectgrid' or 'triagrid' 00010 00011 % Bernard Haasdonk 18.5.2007 00012 00013 if isfield(params,'gridtype') || isprop(params, 'gridtype') 00014 switch params.gridtype 00015 case 'rectgrid' 00016 grid = rectgrid(params); 00017 case 'onedgrid' 00018 grid = onedgrid(params); 00019 case 'triagrid' 00020 grid = triagrid(params); 00021 grid = set_boundary_types(grid, params); 00022 case 'none' 00023 % nothing to do 00024 grid = []; 00025 otherwise 00026 error('gridtype not known') 00027 end; 00028 else 00029 grid = []; 00030 end;