Changeset 2395
- Timestamp:
- 10/08/09 09:32:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/recover_areas.m
r1338 r2395 7 7 % [hutterflag macayealflag pattynflag stokesflag filltype]=recover_areas(md,varargin); 8 8 9 %initialize elementstype 10 hutterflag=zeros(md.numberofelements,1); 11 macayealflag=zeros(md.numberofelements,1); 12 pattynflag=zeros(md.numberofelements,1); 13 stokesflag=zeros(md.numberofelements,1); 14 filltype='none'; 9 %go through varargin, extract options and plug them into subtype options, by order of appearance 10 options=pairoptions(varargin{:}); 11 options=deleteduplicates(options,1); 15 12 16 %make sure length(varargin) is even 17 if mod(length(varargin),2), 18 error('recover_elementstype_options error message: an even number of options is necessary'); 19 end 13 %recover elements distribution 14 hutterflag =BuildFlag(md,getfieldvalue(options,'hutter','')); 15 macayealflag=BuildFlag(md,getfieldvalue(options,'macayeal','')); 16 pattynflag =BuildFlag(md,getfieldvalue(options,'pattyn','')); 17 stokesflag =BuildFlag(md,getfieldvalue(options,'stokes','')); 18 hutterflag =BuildFlag(md,getfieldvalue(options,'hutter','')); 19 filltype =getfieldvalue(options,'fill','none'); 20 20 21 %go through varargin, extract options and plug them into subtype options, by order of appearance22 for i=1:length(varargin)/2,23 24 optionstring=varargin{2*i-1};25 optionvalue=varargin{2*i};26 27 if strcmpi(optionstring,'hutter'),28 hutterflag=BuildFlag(md,optionvalue);29 elseif strcmpi(optionstring,'macayeal'),30 macayealflag=BuildFlag(md,optionvalue);31 elseif strcmpi(optionstring,'pattyn'),32 pattynflag=BuildFlag(md,optionvalue);33 elseif strcmpi(optionstring,'stokes'),34 stokesflag=BuildFlag(md,optionvalue);35 elseif strcmpi(optionstring,'fill'),36 filltype=optionvalue;37 else38 error('elementstype_options error message: bad elementstype options');39 end40 end41 21 end %end function 42 22
Note:
See TracChangeset
for help on using the changeset viewer.