Changeset 530 for trunk/src/calc_tps.m
- Timestamp:
- Aug 27, 2012, 4:38:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_tps.m
r516 r530 5 5 SubDomain=DataIn.SubDomain;% 6 6 end 7 [CellVarIndex,NbDimVec,VarTypeCell,errormsg]=find_field_cells(DataIn); 7 %[CellVarIndex,NbDimVec,VarTypeCell,errormsg]=find_field_cells(DataIn); 8 [CellInfo,NbDimArray,errormsg]=find_field_cells(DataIn); 8 9 nbtps=0; 9 for icell=1:numel(Cell VarIndex);10 VarType=VarTypeCell{icell};11 if NbDim Vec(icell)>=2&& ~isempty(VarType.coord_x)10 for icell=1:numel(CellInfo); 11 %VarType=VarTypeCell{icell}; 12 if NbDimArray(icell)>=2 && strcmp(CellInfo{icell}.CoordType,'scattered')%'&& ~isempty(VarType.coord_x) 12 13 nbtps=nbtps+1; 13 X=DataIn.(DataIn.ListVarName{ VarType.coord_x});14 Y=DataIn.(DataIn.ListVarName{ VarType.coord_y});15 if ~isempty(VarType.vector_x)&&~isempty(VarType.vector_y)16 Attr=DataIn.VarAttribute{ VarType.vector_x};14 X=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end)}); 15 Y=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end-1)}); 16 if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y') 17 Attr=DataIn.VarAttribute{CellInfo{icell}.VarIndex_vector_x}; 17 18 if ~isfield(Attr,'VarIndex_tps')&& (checkall || (isfield(Attr,'FieldRequest')&&strcmp(Attr.FieldRequest,'interp_tps'))) 18 U=DataIn.(DataIn.ListVarName{ VarType.vector_x});19 V=DataIn.(DataIn.ListVarName{ VarType.vector_y});19 U=DataIn.(DataIn.ListVarName{CellInfo{icell}.VarIndex_vector_x}); 20 V=DataIn.(DataIn.ListVarName{CellInfo{icell}.VarIndex_vector_y}); 20 21 else 21 22 continue 22 23 end 23 24 end 24 if ~isempty(VarType.errorflag)25 FF=DataIn.(DataIn.ListVarName{ VarType.errorflag});25 if isfield(CellInfo{icell},'VarIndex_errorflag') 26 FF=DataIn.(DataIn.ListVarName{CellInfo{icell}.VarIndex_errorflag}); 26 27 X=X(FF==0); 27 28 Y=Y(FF==0); … … 47 48 48 49 DataOut.VarAttribute{nbvar+3}.Role='coord_tps'; 49 DataOut.VarAttribute{nbvar+4}=DataIn.VarAttribute{ VarType.vector_x};%reproduce attributes of velocity50 DataOut.VarAttribute{nbvar+4}=DataIn.VarAttribute{CellInfo{icell}.VarIndex_vector_x};%reproduce attributes of velocity 50 51 DataOut.VarAttribute{nbvar+4}.Role='vector_x_tps'; 51 DataIn.VarAttribute{ VarType.vector_x}.VarIndex_tps=nbvar+4;% indicte the correspondance with initial data52 DataOut.VarAttribute{nbvar+5}=DataIn.VarAttribute{ VarType.vector_y};%reproduce attributes of velocity52 DataIn.VarAttribute{CellInfo{icell}.VarIndex_vector_x}.VarIndex_tps=nbvar+4;% indicte the correspondance with initial data 53 DataOut.VarAttribute{nbvar+5}=DataIn.VarAttribute{CellInfo{icell}.VarIndex_vector_y};%reproduce attributes of velocity 53 54 DataOut.VarAttribute{nbvar+5}.Role='vector_y_tps'; 54 55 if isfield(DataOut,'ListDimName')%cleaning'
Note: See TracChangeset
for help on using the changeset viewer.