Changeset 412
- Timestamp:
- May 7, 2012, 11:29:42 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field.m
r411 r412 163 163 [EMDX,EMDY] = tps_eval_dxy(Coord_interp(ind_sel,:),DataIn.Coord_tps(1:nbvec_sub,:,isub));%kernels for calculating the spatial derivatives from tps 'sources' 164 164 end 165 var_count=0;165 ListVar={}; 166 166 for ilist=1:length(FieldList) 167 var_count=numel(ListVar); 167 168 switch FieldList{ilist} 168 169 case 'velocity' 169 List Fields={'U', 'V'};170 ListVar=[ListVar {'U', 'V'}]; 170 171 VarAttribute{var_count+1}.Role='vector_x'; 171 172 VarAttribute{var_count+2}.Role='vector_y'; … … 173 174 DataOut.V(ind_sel)=DataOut.V(ind_sel)+EM *DataIn.V_tps(1:nbvec_sub+3,isub); 174 175 case 'u' 175 List Fields={'u'};176 ListVar=[ListVar {'u'}]; 176 177 VarAttribute{var_count+1}.Role='scalar'; 177 178 DataOut.u(ind_sel)=DataOut.u(ind_sel)+EM *DataIn.U_tps(1:nbvec_sub+3,isub); 178 179 case 'v' 179 List Fields={'v'};180 ListVar=[ListVar {'v'}]; 180 181 VarAttribute{var_count+1}.Role='scalar'; 181 182 DataOut.v(ind_sel)=DataOut.v(ind_sel)+EM *DataIn.V_tps(1:nbvec_sub+3,isub); 182 183 case 'norm_vel' 183 List Fields={'norm_vel'};184 ListVar=[ListVar {'norm_vel'}]; 184 185 VarAttribute{var_count+1}.Role='scalar'; 185 186 U=DataOut.U(ind_sel)+EM *DataIn.U_tps(1:nbvec_sub+3,isub); … … 187 188 DataOut.norm_vel(ind_sel)=sqrt(U.*U+V.*V); 188 189 case 'vort' 189 List Fields={'vort'};190 ListVar=[ListVar {'vort'}]; 190 191 VarAttribute{var_count+1}.Role='scalar'; 191 192 DataOut.vort(ind_sel)=DataOut.vort(ind_sel)-EMDY *DataIn.U_tps(1:nbvec_sub+3,isub)+EMDX *DataIn.V_tps(1:nbvec_sub+3,isub); 192 193 case 'div' 193 List Fields={'div'};194 ListVar=[ListVar {'div'}]; 194 195 VarAttribute{var_count+1}.Role='scalar'; 195 196 DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDY *DataIn.V_tps(1:nbvec_sub+3,isub); 196 197 case 'strain' 197 List Fields={'strain'};198 ListVar=[ListVar {'strain'}]; 198 199 VarAttribute{var_count+1}.Role='scalar'; 199 200 DataOut.strain(ind_sel)=DataOut.strain(ind_sel)+EMDY*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDX *DataIn.V_tps(1:nbvec_sub+3,isub); … … 202 203 end 203 204 DataOut.FF=nbval==0; %put errorflag to 1 for points outside the interpolation rang 204 nbval(nbval==0)=1; 205 nbval(nbval==0)=1;% to avoid division by zero for averaging 205 206 if isempty(find(strcmp('FF',DataOut.ListVarName),1))% if FF is not already listed 206 207 DataOut.ListVarName=[DataOut.ListVarName {'FF'}]; … … 208 209 DataOut.VarAttribute{length(DataOut.ListVarName)}.Role='errorflag'; 209 210 end 210 DataOut.ListVarName=[DataOut.ListVarName List Fields];211 for ifield=1:numel(List Fields)211 DataOut.ListVarName=[DataOut.ListVarName ListVar]; 212 for ifield=1:numel(ListVar) 212 213 VarDimName{ifield}={'coord_y','coord_x'}; 213 DataOut.(ListFields{ifield})=reshape(DataOut.(ListFields{ifield}),npy,npx); 214 DataOut.(ListVar{ifield})=DataOut.(ListVar{ifield})./nbval; 215 DataOut.(ListVar{ifield})=reshape(DataOut.(ListVar{ifield}),npy,npx); 214 216 end 215 217 DataOut.FF=reshape(DataOut.FF,npy,npx); -
trunk/src/civ.m
r406 r412 1253 1253 Param.Civ1.ImageWidth=ImageInfo.Width; 1254 1254 Param.Civ1.ImageHeight=ImageInfo.Height; 1255 Param.Civ1.i1=i1_civ1(ifile ,j);1256 Param.Civ1.i2=i2_civ1(ifile ,j);1255 Param.Civ1.i1=i1_civ1(ifile); 1256 Param.Civ1.i2=i2_civ1(ifile); 1257 1257 % read mask parameters 1258 1258 if Param.Civ1.CheckMask % the lines below should be changed with the new gui
Note: See TracChangeset
for help on using the changeset viewer.