Ignore:
Timestamp:
May 5, 2024, 12:29:30 PM (5 months ago)
Author:
sommeria
Message:

filter parameter improved in filter_tps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/filter_tps.m

    r1141 r1142  
    66% SubRange(NbCoord,2,NbSubdomain): range (min, max) of the coordinates x and y respectively, for each subdomain
    77% 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
    99% U_smooth, V_smooth: filtered velocity components at the positions of the initial data
    1010% Coord_tps(NbCentre,NbCoord,NbSubdomain): positions of the tps centres
    11 % U_tps,V_tps: weight of the tps for each subdomain
     11% U_tps,V_tps: weight of the tps centers for each subdomain
    1212% to get the interpolated field values, use the function calc_field.m
    1313%
     
    6262%% smoothing parameter: CHANGED 03 May 2024 TO GET RESULTS INDEPENDENT OF SUBDOMAINSIZE
    6363%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
     64NbVecSub=NbVec/NbSubDomain;% refined estimation of the nbre of vectors per subdomain
     65smoothing=sqrt(Siz(1)*Siz(2)/NbVecSub)*FieldSmooth;%optimum smoothing increase as the typical mesh size =sqrt(SizX*SizY/NbVecSub)^1/2
    6566%% default output
    6667SubRange=zeros(NbCoord,2,NbSubDomain);%initialise the boundaries of subdomains
     
    8081%% calculate tps coeff in each subdomain
    8182for isub=1:NbSubDomain
    82     isub
    8383    SubRange(1,:,isub)=[CentreX(isub)-0.55*Siz(1) CentreX(isub)+0.55*Siz(1)];%bounds of subdomain #isub in x coordinate
    8484    SubRange(2,:,isub)=[CentreY(isub)-0.55*Siz(2) CentreY(isub)+0.55*Siz(2)];%bounds of subdomain #isub in y coordinate
     
    8989        ind_sel_previous=ind_sel;% record the set of selected vector indices for next iteration
    9090        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)])
    9292        % if no vector in the subdomain  #isub, skip the subdomain
    9393        if isempty(ind_sel)
     
    124124                V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub;
    125125                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)])
    127127                break
    128128            % if too few selected vectors, increase the subrange for next iteration
     
    146146                V_tps(1:NbCentre(isub)+3,isub)=V_tps_sub;
    147147                nb_select(ind_sel(ind_ind_sel))=nb_select(ind_sel(ind_ind_sel))+weight;
    148                 display(['tps redone after elimination of erratic 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)])
    149149                break
    150150            end
Note: See TracChangeset for help on using the changeset viewer.