Changeset 1142 for trunk/src/filter_tps.m
- Timestamp:
- May 5, 2024, 12:29:30 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/filter_tps.m
r1141 r1142 6 6 % SubRange(NbCoord,2,NbSubdomain): range (min, max) of the coordinates x and y respectively, for each subdomain 7 7 % NbCentre(NbSubdomain): number of source points for each subdomain 8 % FF: false flags 8 % FF: false flags preserved from the input, or equal to 20 for vectors excluded by the difference with the smoothed field 9 9 % U_smooth, V_smooth: filtered velocity components at the positions of the initial data 10 10 % Coord_tps(NbCentre,NbCoord,NbSubdomain): positions of the tps centres 11 % U_tps,V_tps: weight of the tps for each subdomain11 % U_tps,V_tps: weight of the tps centers for each subdomain 12 12 % to get the interpolated field values, use the function calc_field.m 13 13 % … … 62 62 %% smoothing parameter: CHANGED 03 May 2024 TO GET RESULTS INDEPENDENT OF SUBDOMAINSIZE 63 63 %smoothing=Siz(1)*Siz(2)*FieldSmooth/1000%optimum smoothing increase as the area of the subdomain (division by 1000 to reach good values with the default GUI input) 64 smoothing=sqrt(Siz(1)*Siz(2)/SubDomainSize)*FieldSmooth;%optimum smoothing increase as the typical mesh size =sqrt(SizX*SizY/SubDomainSize)^1/2 64 NbVecSub=NbVec/NbSubDomain;% refined estimation of the nbre of vectors per subdomain 65 smoothing=sqrt(Siz(1)*Siz(2)/NbVecSub)*FieldSmooth;%optimum smoothing increase as the typical mesh size =sqrt(SizX*SizY/NbVecSub)^1/2 65 66 %% default output 66 67 SubRange=zeros(NbCoord,2,NbSubDomain);%initialise the boundaries of subdomains … … 80 81 %% calculate tps coeff in each subdomain 81 82 for isub=1:NbSubDomain 82 isub83 83 SubRange(1,:,isub)=[CentreX(isub)-0.55*Siz(1) CentreX(isub)+0.55*Siz(1)];%bounds of subdomain #isub in x coordinate 84 84 SubRange(2,:,isub)=[CentreY(isub)-0.55*Siz(2) CentreY(isub)+0.55*Siz(2)];%bounds of subdomain #isub in y coordinate … … 89 89 ind_sel_previous=ind_sel;% record the set of selected vector indices for next iteration 90 90 ind_sel=find(Coord(:,1)>=SubRange(1,1,isub) & Coord(:,1)<=SubRange(1,2,isub) & Coord(:,2)>=SubRange(2,1,isub) & Coord(:,2)<=SubRange(2,2,isub)); 91 numel(ind_sel)91 %disp([numel(ind_sel) ' vectors in subdomain #' num2str(isub)]) 92 92 % if no vector in the subdomain #isub, skip the subdomain 93 93 if isempty(ind_sel) … … 124 124 V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub; 125 125 nb_select(ind_sel)=nb_select(ind_sel)+weight; 126 display(['tps done in subdomain # ' num2str(isub) ' among ' num2str(NbSubDomain)])126 display(['tps done with ' num2str(numel(ind_sel)) ' vectors in subdomain # ' num2str(isub) ' among ' num2str(NbSubDomain)]) 127 127 break 128 128 % if too few selected vectors, increase the subrange for next iteration … … 146 146 V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub; 147 147 nb_select(ind_sel(ind_ind_sel))=nb_select(ind_sel(ind_ind_sel))+weight; 148 display(['tps redone after elimination oferratic vectors in subdomain # ' num2str(isub) ' among ' num2str(NbSubDomain)])148 display(['tps redone with ' num2str(numel(ind_sel)) ' vectors after elimination of ' num2str(numel(ind_ind_sel)) ' erratic vectors in subdomain # ' num2str(isub) ' among ' num2str(NbSubDomain)]) 149 149 break 150 150 end
Note: See TracChangeset
for help on using the changeset viewer.