Changeset 1137 for trunk/src/filter_tps.m
- Timestamp:
- Apr 24, 2024, 7:45:09 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/filter_tps.m
r1135 r1137 95 95 break % go to next subdomain 96 96 % if too few selected vectors, increase the subrange for next iteration 97 elseif numel(ind_sel)<SubDomainSize/4 && ~isequal( ind_sel,ind_sel_previous) ;97 elseif numel(ind_sel)<SubDomainSize/4 && ~isequal( ind_sel,ind_sel_previous) 98 98 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz'/4; 99 99 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz'/4; … … 112 112 % if no value exceeds threshold, the result is recorded 113 113 if isequal(numel(ind_ind_sel),numel(ind_sel)) 114 U_smooth(ind_sel)=U_smooth(ind_sel)+U_smooth_sub; 115 V_smooth(ind_sel)=V_smooth(ind_sel)+V_smooth_sub; 114 x_width=(SubRange(1,2,isub)-SubRange(1,1,isub))/pi; 115 y_width=(SubRange(2,2,isub)-SubRange(2,1,isub))/pi; 116 x_dist=(Coord(ind_sel,1)-CentreX(isub))/x_width;% relative x distance to the retangle centre 117 y_dist=(Coord(ind_sel,2)-CentreY(isub))/y_width;% relative ydistance to the retangle centre 118 weight=cos(x_dist).*cos(y_dist);%weighting fct =1 at the rectangle center and 0 at edge 119 U_smooth(ind_sel)=U_smooth(ind_sel)+weight.*U_smooth_sub; 120 V_smooth(ind_sel)=V_smooth(ind_sel)+weight.*V_smooth_sub; 116 121 NbCentre(isub)=numel(ind_sel); 117 122 Coord_tps(1:NbCentre(isub),:,isub)=Coord(ind_sel,:); 118 123 U_tps(1:NbCentre(isub)+3,isub)=U_tps_sub; 119 124 V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub; 120 nb_select(ind_sel)=nb_select(ind_sel)+ 1;125 nb_select(ind_sel)=nb_select(ind_sel)+weight; 121 126 display(['tps done in subdomain # ' num2str(isub) ' among ' num2str(NbSubDomain)]) 122 127 break 123 128 % if too few selected vectors, increase the subrange for next iteration 124 elseif numel(ind_ind_sel)<SubDomainSize/4 && ~isequal( ind_sel,ind_sel_previous) ;129 elseif numel(ind_ind_sel)<SubDomainSize/4 && ~isequal( ind_sel,ind_sel_previous) 125 130 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz'/4; 126 131 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz'/4; … … 129 134 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)),rho); 130 135 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)),rho); 131 U_smooth(ind_sel(ind_ind_sel))=U_smooth(ind_sel(ind_ind_sel))+U_smooth_sub; 132 V_smooth(ind_sel(ind_ind_sel))=V_smooth(ind_sel(ind_ind_sel))+V_smooth_sub; 136 x_width=(SubRange(1,2,isub)-SubRange(1,1,isub))/pi; 137 y_width=(SubRange(2,2,isub)-SubRange(2,1,isub))/pi; 138 x_dist=(Coord(ind_sel(ind_ind_sel),1)-CentreX(isub))/x_width;% relative x distance to the retangle centre 139 y_dist=(Coord(ind_sel(ind_ind_sel),2)-CentreY(isub))/y_width;% relative ydistance to the retangle centre 140 weight=cos(x_dist).*cos(y_dist);%weighting fct =1 at the rectangle center and 0 at edge 141 U_smooth(ind_sel(ind_ind_sel))=U_smooth(ind_sel(ind_ind_sel))+weight.*U_smooth_sub; 142 V_smooth(ind_sel(ind_ind_sel))=V_smooth(ind_sel(ind_ind_sel))+weight.*V_smooth_sub; 133 143 NbCentre(isub)=numel(ind_ind_sel); 134 144 Coord_tps(1:NbCentre(isub),:,isub)=Coord(ind_sel(ind_ind_sel),:); 135 145 U_tps(1:NbCentre(isub)+3,isub)=U_tps_sub; 136 146 V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub; 137 nb_select(ind_sel(ind_ind_sel))=nb_select(ind_sel(ind_ind_sel))+ 1;147 nb_select(ind_sel(ind_ind_sel))=nb_select(ind_sel(ind_ind_sel))+weight; 138 148 display(['tps redone after elimination of erratic vectors in subdomain # ' num2str(isub) ' among ' num2str(NbSubDomain)]) 139 149 break
Note: See TracChangeset
for help on using the changeset viewer.