Changeset 521 for trunk/src/calc_field_interp.m
 Timestamp:
 Aug 18, 2012, 11:17:48 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/calc_field_interp.m
r517 r521 23 23 InputVarList={}; 24 24 if ischar(Operation),Operation={Operation};end 25 check_skipped=zeros(size(Operation)); 26 Operator=cell(size(Operation)); 25 27 for ilist=1:numel(Operation) 26 28 r=regexp(Operation{ilist},'(?<Operator>(^vec^norm))\((?<UName>.+),(?<VName>.+)\)$','names'); 27 29 if isempty(r) % the operation is the variable 28 if isempty(find(strcmp(Operation{ilist},InputVarList))); 29 InputVarList=[InputVarList Operation{ilist}]; 30 if ~isfield(Data,Operation{ilist}) 31 check_skipped(ilist)=1; 32 else 33 if isempty(find(strcmp(Operation{ilist},InputVarList))); 34 InputVarList=[InputVarList Operation{ilist}];% the variable is added to the list if it is not already in the list 35 end 36 Operator{ilist}=''; 30 37 end 31 Operator{ilist}='';32 38 else 33 UName{ilist}=r.UName; 34 VName{ilist}=r.VName; 35 if isempty(find(strcmp(r.UName,InputVarList))); 36 InputVarList=[InputVarList UName{ilist}]; 39 if ~isfield(Data,r.UName)~isfield(Data,r.VName) 40 check_skipped(ilist)=1; 41 else 42 UName{ilist}=r.UName; 43 VName{ilist}=r.VName; 44 if isempty(find(strcmp(r.UName,InputVarList))); 45 InputVarList=[InputVarList UName{ilist}]; %the variable is added to the list if it is not already in the list 46 end 47 if isempty(find(strcmp(r.VName,InputVarList))); 48 InputVarList=[InputVarList VName{ilist}]; %the variable is added to the list if it is not already in the list 49 end 50 Operator{ilist}=r.Operator; 37 51 end 38 if isempty(find(strcmp(r.VName,InputVarList)));39 InputVarList=[InputVarList VName{ilist}];40 end41 Operator{ilist}=r.Operator;42 52 end 43 53 end … … 49 59 end 50 60 for ilist=1:numel(Operation) 61 if ~check_skipped(ilist) 51 62 nbvar=numel(ListVarName); 52 63 switch Operator{ilist} … … 63 74 VarAttribute{nbvar+1}.Role='vector_x'; 64 75 VarAttribute{nbvar+2}.Role='vector_y'; 65 % case 'U'66 % VarVal{nbvar+1}=F_u(XI,YI);67 % ListVarName{nbvar+1}='U';68 % VarAttribute{nbvar+1}.Role='scalar';69 % case 'V'70 % VarVal{nbvar+1}=F_v(XI,YI);71 % ListVarName{nbvar+1}='V';72 % VarAttribute{nbvar+1}.Role='scalar';73 76 case 'norm' 74 77 if exist('XI','var') … … 93 96 end 94 97 end 98 end 95 99 end 96 100 % put an error flag to indicate NaN data
Note: See TracChangeset
for help on using the changeset viewer.