Changeset 822 for trunk/src/tps_coeff_field.m
- Timestamp:
- Oct 10, 2014, 10:11:30 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tps_coeff_field.m
r809 r822 6 6 % DataOut: output field structure, reproducing the input field structure DataIn and adding the fields: 7 7 % .Coord_tps 8 % .[VarName '_tps'] for each eligible input variable VarName (scalar o fr vector components)8 % .[VarName '_tps'] for each eligible input variable VarName (scalar or vector components) 9 9 % errormsg: error message, = '' by default 10 10 % 11 11 % INPUT: 12 12 % DataIn: intput field structure 13 % checkall:=1 if tps is needed for all fields (a projection mode interp_tps is needed), =0 otherwise 13 % checkall:=1 if tps is needed for all fields (a projection mode interp_tps has been chosen), 14 % =0 otherwise (tps only needed to get spatial derivatives of scattered data) 14 15 % 15 16 % called functions: … … 53 54 54 55 for icell=1:numel(CellInfo); 55 if NbDimArray(icell)>=2 && strcmp(CellInfo{icell}.CoordType,'scattered') %%if the coordinates are scattered56 if NbDimArray(icell)>=2 && strcmp(CellInfo{icell}.CoordType,'scattered') %if the coordinates are scattered 56 57 NbCoord=NbDimArray(icell);% dimension of space 57 58 nbtps=nbtps+1;% indicate the number of tps coordinate sets in the field structure (in general =1) 58 59 X=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end)});% value of x coordinate 59 Y=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end-1)});% value of xcoordinate60 Y=DataIn.(DataIn.ListVarName{CellInfo{icell}.CoordIndex(end-1)});% value of y coordinate 60 61 check_interp_tps=false(numel(DataIn.ListVarName),1); 61 %for ivar=1:numel(CellInfo{icell}.VarIndex) 62 Index_interp=[]; 63 if isfield(CellInfo{icell},'VarIndex_scalar') 62 Index_interp=[];% indices of variables to interpolate 63 if isfield(CellInfo{icell},'VarIndex_scalar')%interpolate scalar 64 64 Index_interp=[Index_interp CellInfo{icell}.VarIndex_scalar]; 65 65 end 66 if isfield(CellInfo{icell},'VarIndex_vector_x') 66 if isfield(CellInfo{icell},'VarIndex_vector_x')%interpolate vector x component 67 67 Index_interp=[Index_interp CellInfo{icell}.VarIndex_vector_x]; 68 68 end 69 if isfield(CellInfo{icell},'VarIndex_vector_y') 69 if isfield(CellInfo{icell},'VarIndex_vector_y')%interpolate vector y component 70 70 Index_interp=[Index_interp CellInfo{icell}.VarIndex_vector_y]; 71 71 end … … 76 76 end 77 77 end 78 79 %VarIndexInterp=CellInfo{icell}.VarIndex(check_interp_tps);% indices of variables to interpolate through tps80 % if ~isempty(VarIndexInterp)81 78 ListVarInterp=DataIn.ListVarName(check_interp_tps); 82 79 VarIndexInterp=find(check_interp_tps); … … 110 107 DataOut.(['Coord_tps' term])(1:NbCentre(isub),1:2,isub)=[X(ind_sel) Y(ind_sel)]; 111 108 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) 112 %fill=zeros(NbCoord+1,NbCoord,size(SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)113 % fill=zeros(NbCoord+1,NbCoord+1,NbCoord); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)114 % Coord_tps=cat(1,Coord_tps,fill);115 109 end 116 110 for ivar=1:numel(ListVarInterp) … … 132 126 DataOut.(['SubRange' term])=SubRange; 133 127 DataOut.(['NbCentre' term])=NbCentre; 134 % DataOut.(['Coord_tps' term])=Coord_tps;135 128 for ilist=1:numel(VarIndexInterp) 136 % Var_tps=zeros(size(IndSelSubDomain)+[NbCoord+1 0]);%default spline137 129 for isub=1:size(SubRange,3) 138 130 ind_sel=IndSelSubDomain(1:NbCentre(isub),isub);% array indices selected for the subdomain
Note: See TracChangeset
for help on using the changeset viewer.