Changeset 2660
- Timestamp:
- 11/16/09 10:02:36 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/ismodelselfconsistent.m
r2528 r2660 122 122 error(['model not consistent: models with rifts are only supported in 2d for now!']); 123 123 end 124 end 125 if ~isstruct(md.rifts), 124 if ~isstruct(md.rifts), 125 error(['model not consistent: md.rifts should be a structure!']); 126 end 127 if ~isempty(find(md.segmentmarkers>=2)), 128 %We have segments with rift markers, but no rift structure! 129 error(['model not consistent: model ' md.name ' should be processed for rifts (run meshprocessrifts)!']); 130 end 131 %Check that rifts are filled with proper material 132 checkvalues(md,{'rifts.fill'},[WaterEnum() AirEnum() IceEnum() MelangeEnum()]); 133 else 126 134 if ~isnan(md.rifts), 127 if ~isempty(find(md.segmentmarkers>=2)), 128 %We have segments with rift markers, but no rift structure! 129 error(['model not consistent: model ' md.name ' should be processed for rifts (run meshprocessrifts)!']); 130 end 135 error(['model not consistent: md.rifts shoud be NaN since md.numrifts is 0!']); 131 136 end 132 137 end … … 432 437 end 433 438 end 439 440 function checkvalues(md,fields,values) 441 %CHECKVALUE - check that a field has a certain value 442 for i=1:length(fields), 443 if eval(['~ismember( md.' fields{i} ',values)']), 444 error(['model not consistent: field ' fields{i} ' should have values in ' num2str(values)]); 445 end 446 end 447 end
Note:
See TracChangeset
for help on using the changeset viewer.