Changeset 674 for trunk/src/tps_coeff_field.m
- Timestamp:
- Aug 23, 2013, 2:56:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tps_coeff_field.m
r651 r674 40 40 X=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end)});% value of x coordinate 41 41 Y=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end-1)});% value of x coordinate 42 check_interp_tps=false(numel( CellInfo{icell}.VarIndex),1);42 check_interp_tps=false(numel(DataIn.ListVarName),1); 43 43 %for ivar=1:numel(CellInfo{icell}.VarIndex) 44 44 Index_interp=[]; … … 52 52 Index_interp=[Index_interp CellInfo{icell}.VarIndex_vector_y]; 53 53 end 54 for i var=Index_interp55 Attr=DataIn.VarAttribute{ CellInfo{icell}.VarIndex(ivar)};54 for iselect=1:numel(Index_interp) 55 Attr=DataIn.VarAttribute{Index_interp(iselect)}; 56 56 if ~isfield(Attr,'VarIndex_tps')&& (checkall || (isfield(Attr,'ProjModeRequest')&&strcmp(Attr.ProjModeRequest,'interp_tps'))) 57 check_interp_tps( ivar)=1;57 check_interp_tps(Index_interp(iselect))=1; 58 58 end 59 59 end 60 VarIndexInterp=CellInfo{icell}.VarIndex(check_interp_tps);% indices of variables to interpolate through tps 61 if ~isempty(VarIndexInterp) 62 ListVarInterp=DataIn.ListVarName(VarIndexInterp); 60 61 %VarIndexInterp=CellInfo{icell}.VarIndex(check_interp_tps);% indices of variables to interpolate through tps 62 % if ~isempty(VarIndexInterp) 63 ListVarInterp=DataIn.ListVarName(check_interp_tps); 64 VarIndexInterp=find(check_interp_tps); 65 if ~isempty(ListVarInterp) 63 66 % exclude data points marked 'false' for interpolation 64 67 if isfield(CellInfo{icell},'VarIndex_errorflag') … … 66 69 X=X(FF==0); 67 70 Y=Y(FF==0); 68 for ilist=1:numel( VarIndexInterp)71 for ilist=1:numel(ListVarInterp) 69 72 DataIn.(ListVarInterp{ilist})=DataIn.(ListVarInterp{ilist})(FF==0); 70 73 end … … 74 77 term=['_' num2str(nbtps-1)]; 75 78 end 76 ListNewVar=cell(1,numel( VarIndexInterp)+3);79 ListNewVar=cell(1,numel(ListVarInterp)+3); 77 80 ListNewVar(1:3)={['SubRange' term],['NbCentre' term],['Coord_tps' term]}; 78 for ilist=1:numel( VarIndexInterp)81 for ilist=1:numel(ListVarInterp) 79 82 ListNewVar{ilist+3}=[ListVarInterp{ilist} '_tps' term]; 80 83 end 81 84 nbvar=numel(DataIn.ListVarName); 82 85 DataOut.ListVarName=[DataIn.ListVarName ListNewVar]; 83 %ListNewDim={['nb_tps' term],['nb_subdomain' term]};84 86 DataOut.VarDimName=[DataIn.VarDimName {{'nb_coord','nb_bounds',['nb_subdomain' term]}} {['nb_subdomain' term]} ... 85 87 {{['nb_tps' term],'nb_coord',['nb_subdomain' term]}}]; … … 91 93 DataOut.(['Coord_tps' term])(NbCentre(isub)+1:NbCentre(isub)+3,1:2,isub)=0;%matrix of zeros to complement the matrix Coord_tps (conveninent for file storage) 92 94 %fill=zeros(NbCoord+1,NbCoord,size(SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage) 93 % fill=zeros(NbCoord+1,NbCoord+1,NbCoord); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)94 % Coord_tps=cat(1,Coord_tps,fill);95 end 96 for ivar=1:numel( VarIndexInterp)95 % fill=zeros(NbCoord+1,NbCoord+1,NbCoord); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage) 96 % Coord_tps=cat(1,Coord_tps,fill); 97 end 98 for ivar=1:numel(ListVarInterp) 97 99 DataOut.VarDimName{nbvar+3+ivar}={['nb_tps' term],['nb_subdomain' term]}; 98 100 DataOut.VarAttribute{nbvar+3+ivar}=DataIn.VarAttribute{CellInfo{icell}.VarIndex_vector_x};%reproduce attributes of velocity … … 112 114 DataOut.(['SubRange' term])=SubRange; 113 115 DataOut.(['NbCentre' term])=NbCentre; 114 % DataOut.(['Coord_tps' term])=Coord_tps;116 % DataOut.(['Coord_tps' term])=Coord_tps; 115 117 for ilist=1:numel(VarIndexInterp) 116 % Var_tps=zeros(size(IndSelSubDomain)+[NbCoord+1 0]);%default spline118 % Var_tps=zeros(size(IndSelSubDomain)+[NbCoord+1 0]);%default spline 117 119 for isub=1:size(SubRange,3) 118 120 ind_sel=IndSelSubDomain(1:NbCentre(isub),isub);% array indices selected for the subdomain
Note: See TracChangeset
for help on using the changeset viewer.