rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
isequal.m
1 function res = isequal(grid,grid2)
2 %function res = isequal(grid,grid2)
3 % function comparing two grids field by field
4 %
5 % parameters:
6 % grid2: the grid we want to compare with
7 %
8 % Return values:
9 % res: boolean indicating whether the two grids are equal
10 
11 % Bernard Haasdonk 15.2.2011
12 
13 fields = {'nelements','nvertices','nneigh','A','Ainv','VI','X','Y','CX',...
14  'CY','NBI','INB','EL','DC','NX','NY','ECX','ECY','SX','SY','ESX',...
15  'DS','hmin','alpha','JIT'};
16 
17 res = 1;
18 for i = 1:length(fields)
19  res = res && isequal(getfield(grid,fields{i}),getfield(grid2,fields{i}));
20 end
21