Changeset 383 for trunk/src


Ignore:
Timestamp:
Feb 7, 2012, 8:34:31 AM (13 years ago)
Author:
sommeria
Message:

bugs corrected , new Matlab patch introduced for patch2

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/calc_field.m

    r382 r383  
    6767    %% interpolation with new civ data
    6868    %if isfield(DataIn,'X_SubRange')
    69     if strcmp(VelType,'filter1')||strcmp(VelType,'filter2')
     69    if isfield(DataIn,'SubRange') &&(strcmp(VelType,'filter1')||strcmp(VelType,'filter2'))
    7070        XMax=max(max(DataIn.SubRange(1,:,:)));
    7171        YMax=max(max(DataIn.SubRange(2,:,:)));
  • trunk/src/civ_matlab.m

    r382 r383  
    182182        ind_good=1:numel(Data.Civ1_X);
    183183    end
    184 %     [SubRange,NbPoints,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF]
    185184    [Data.Civ1_SubRange,Data.Civ1_NbSites,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=...
    186                             filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Threshold,Data.Patch1_Rho);
     185            filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Rho,Data.Patch1_Threshold);
    187186      Data.Civ1_U_Diff(ind_good)=Data.Civ1_U(ind_good)-Ures;
    188187      Data.Civ1_V_Diff(ind_good)=Data.Civ1_V(ind_good)-Vres;
     
    226225        DVDY=zeros(size(GridX));
    227226    end
    228     [NbSubDomain,xx]=size(Data.Civ1_X_SubRange);
     227    NbSubDomain=size(Data.Civ1_SubRange,3);
    229228    % get the guess from patch1
    230229    for isub=1:NbSubDomain
    231230        nbvec_sub=Data.Civ1_NbSites(isub);
    232         ind_sel=find(GridX>=Data.Civ1_X_SubRange(isub,1) & GridX<=Data.Civ1_X_SubRange(isub,2) & GridY>=Data.Civ1_Y_SubRange(isub,1) & GridY<=Data.Civ1_Y_SubRange(isub,2));
     231        ind_sel=find(GridX>=Data.Civ1_SubRange(1,1,isub) & GridX<=Data.Civ1_SubRange(1,2,isub) & GridY>=Data.Civ1_SubRange(2,1,isub) & GridY<=Data.Civ1_SubRange(2,2,isub));
    233232        epoints = [GridX(ind_sel) GridY(ind_sel)];% coordinates of interpolation sites
    234         ctrs=[Data.Civ1_X_tps(1:nbvec_sub,isub) Data.Civ1_Y_tps(1:nbvec_sub,isub)];%(=initial points) ctrs
     233        ctrs=Data.Civ1_Coord_tps(1:nbvec_sub,:,isub) ;%(=initial points) ctrs
    235234        nbval(ind_sel)=nbval(ind_sel)+1;% records the number of values for eacn interpolation point (in case of subdomain overlap)
    236235        EM = tps_eval(epoints,ctrs);
     
    336335    Data.Patch2_Threshold=Param.Patch2.MaxDiff;
    337336    Data.Patch2_SubDomain=Param.Patch2.SubdomainSize;
    338     Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_X_SubRange','Civ2_Y_SubRange','Civ2_X_tps','Civ2_Y_tps','Civ2_U_tps','Civ2_V_tps','Civ2_Indices_tps'}];
    339     Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbSubDomain2','Two'},{'NbSubDomain2','Two'},...
    340              {'NbVec2Sub','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'}}];
     337    Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_SubRange','Civ2_NbSites','Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps'}];
     338    Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbCoord','Two','NbSubDomain2'},{'NbSubDomain2'},...
     339             {'NbVec2Sub','NbCoord','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'}}];
     340%     Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_X_SubRange','Civ2_Y_SubRange','Civ2_X_tps','Civ2_Y_tps','Civ2_U_tps','Civ2_V_tps','Civ2_Indices_tps'}];
     341%     Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbSubDomain2','Two'},{'NbSubDomain2','Two'},...
     342%              {'NbVec2Sub','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'}}];
    341343    nbvar=length(Data.ListVarName);
    342344    Data.VarAttribute{nbvar-1}.Role='vector_x';
     
    348350    else
    349351        ind_good=1:numel(Data.Civ2_X);
    350     end
     352    end 
    351353    [Data.Civ2_SubRange,Data.Civ2_NbSites,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures, Vres,tild,FFres]=...
    352                             filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold);
     354         filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold);
    353355      Data.Civ2_U_Diff(ind_good)=Data.Civ2_U(ind_good)-Ures;
    354356      Data.Civ2_V_Diff(ind_good)=Data.Civ2_V(ind_good)-Vres;
  • trunk/src/uvmat.m

    r382 r383  
    22162216
    22172217%% update tps in phys coordinates if needed
    2218 if (strcmp(VelType,'filter1')||strcmp(VelType,'filter2'))&& isfield(Field{1},'U')&& isfield(Field{1},'V')
     2218if (strcmp(VelType,'filter1')||strcmp(VelType,'filter2'))&& strcmp(FileType,'civdata')&&isfield(Field{1},'U')&& isfield(Field{1},'V')
    22192219    [Field{1}.SubRange,Field{1}.NbSites,Field{1}.Coord_tps,Field{1}.U_tps,Field{1}.V_tps]=filter_tps([Field{1}.X Field{1}.Y],Field{1}.U,Field{1}.V,[],1500,0);
    22202220end
     
    22252225end
    22262226if numel(Field)==2 && ~test_keepdata_1 && isequal(FileType_1(1:3),'civ') && ~isequal(ParamOut_1.FieldName,'get_field...')%&&~isempty(FieldName_1)
     2227    %update tps in phys coordinates if needed
     2228    if (strcmp(VelType_1,'filter1')||strcmp(VelType_1,'filter2'))&& strcmp(FileType_1,'civdata')&&isfield(Field{2},'U')&& isfield(Field{2},'V')
     2229        [Field{2}.SubRange,Field{2}.NbSites,Field{2}.Coord_tps,Field{2}.U_tps,Field{2}.V_tps]=filter_tps([Field{2}.X Field{2}.Y],Field{2}.U,Field{2}.V,[],1500,0);
     2230    end
    22272231    Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2},VelType_1);
    22282232end
Note: See TracChangeset for help on using the changeset viewer.