Changeset 316 for trunk/src/civ_matlab.m
- Timestamp:
- Dec 4, 2011, 5:54:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ_matlab.m
r315 r316 105 105 eval(['Data.' ListName '=Param.Fix1.' ParamName ';']) 106 106 end 107 % Data.ListGlobalAttribute=[Data.ListGlobalAttribute {'Fix1_WarnFlags','Fix1_TreshCorr','Fix1_TreshVel','Fix1_UpperBoundTest'}];108 % Data.Fix1_WarnFlags=Param.Fix1.WarnFlags;109 % Data.Fix1_ThreshCorr=Param.Fix1.ThreshCorr;110 % Data.Fix1_ThreshVel=Param.Fix1.ThreshVel;111 % Data.Fix1_UpperBoundTest=Param.Fix1.UpperBoundTest;112 113 107 if check_civx 114 108 if ~isfield(Data,'fix') … … 131 125 if isfield (Param,'Patch1') 132 126 check_patch1=1; 127 Param.Patch1 133 128 Data.ListGlobalAttribute=[Data.ListGlobalAttribute {'Patch1_Rho','Patch1_Threshold','Patch1_SubDomain'}]; 134 Data.Patch1_Rho= str2double(Param.Patch1.Rho);135 Data.Patch1_Threshold= str2double(Param.Patch1.Threshold);136 Data.Patch1_SubDomain= str2double(Param.Patch1.SubDomain);129 Data.Patch1_Rho=Param.Patch1.SmoothingParam; 130 Data.Patch1_Threshold=Param.Patch1.MaxDiff; 131 Data.Patch1_SubDomain=Param.Patch1.SubdomainSize; 137 132 Data.ListVarName=[Data.ListVarName {'Civ1_U_Diff','Civ1_V_Diff','Civ1_X_SubRange','Civ1_Y_SubRange','Civ1_NbSites','Civ1_X_tps','Civ1_Y_tps','Civ1_U_tps','Civ1_V_tps'}]; 138 133 Data.VarDimName=[Data.VarDimName {'NbVec1','NbVec1',{'NbSubDomain1','Two'},{'NbSubDomain1','Two'},'NbSubDomain1',... … … 146 141 ind_good=find(Data.Civ1_FF==0); 147 142 else 143 148 144 ind_good=1:numel(Data.Civ1_X); 149 145 end … … 171 167 isx2=ibx2+2; 172 168 isy2=iby2+2; 169 173 170 %get the previous guess for displacement 171 174 172 if ~check_patch1 175 [Guess,VelType]=read_civdata(ObjectName,InputField,ParamIn.VelType);%TO DEVELOP 176 else 177 Data.Civ1_U_Diff=zeros(size(Data.Civ1_X)); 178 Data.Civ1_V_Diff=zeros(size(Data.Civ1_X)); 179 if isfield(Data,'Civ1_FF') 180 ind_good=find(Data.Civ1_FF==0); 181 else 182 ind_good=1:numel(Data.Civ1_X); 183 end 184 [Data.Civ1_X_SubRange,Data.Civ1_Y_SubRange,Data.Civ1_NbSites,FFres,Ures, Vres,Data.Civ1_X_tps,Data.Civ1_Y_tps,Data.Civ1_U_tps,Data.Civ1_V_tps]=... 185 patch(Data.Civ1_X(ind_good)',Data.Civ1_Y(ind_good)',Data.Civ1_U(ind_good)',Data.Civ1_V(ind_good)',Data.Patch1_Rho,Data.Patch1_Threshold,Data.Patch1_SubDomain); 186 end 173 [Data,VelType]=read_civdata(ObjectName,InputField,ParamIn.VelType);%TO DEVELOP 174 end 175 176 Guess =interp_tps(Data,X,Y) 177 % Data.Civ1_U_Diff=zeros(size(Data.Civ1_X)); 178 % Data.Civ1_V_Diff=zeros(size(Data.Civ1_X)); 179 % if isfield(Data,'Civ1_FF') 180 % ind_good=find(Data.Civ1_FF==0); 181 % else 182 % ind_good=1:numel(Data.Civ1_X); 183 % end 184 % [Data.Civ1_X_SubRange,Data.Civ1_Y_SubRange,Data.Civ1_NbSites,FFres,Ures, Vres,Data.Civ1_X_tps,Data.Civ1_Y_tps,Data.Civ1_U_tps,Data.Civ1_V_tps]=... 185 % patch(Data.Civ1_X(ind_good)',Data.Civ1_Y(ind_good)',Data.Civ1_U(ind_good)',Data.Civ1_V(ind_good)',Data.Patch1_Rho,Data.Patch1_Threshold,Data.Patch1_SubDomain); 186 % end 187 187 % shiftx=str2num(par_civ1.shiftx); 188 188 % shifty=str2num(par_civ1.shifty); … … 597 597 FF=FF==1 | C<Param.MinCorr; 598 598 end 599 if isfield (Param,'MinVel')||(isfield (Param,'MaxVel')&&~isempty(Param.MaxVel))599 if (isfield(Param,'MinVel')&&~isempty(Param.MinVel))||(isfield (Param,'MaxVel')&&~isempty(Param.MaxVel)) 600 600 Umod= U.*U+V.*V; 601 if isfield (Param,'MinVel') 601 if isfield (Param,'MinVel')&&~isempty(Param.MinVel) 602 602 FF=FF==1 | Umod<(Param.MinVel*Param.MinVel); 603 603 end … … 722 722 CentreY=linspace(MinY+SizY/2,MaxY-SizY/2,NbSubDomainY); 723 723 [CentreX,CentreY]=meshgrid(CentreX,CentreY); 724 CentreY=reshape(CentreY,1,[]); 725 CentreX=reshape(CentreX,1,[]); 724 CentreY=reshape(CentreY,1,[]);% Y positions of subdomain centres 725 CentreX=reshape(CentreX,1,[]);% X positions of subdomain centres 726 726 rho=SizX*SizY*Rho/1000000;%optimum rho increase as the area of the subdomain (division by 10^6 to reach good values with the default GUI input) 727 727 U_tps_sub=zeros(length(X),NbSubDomain);%default spline
Note: See TracChangeset
for help on using the changeset viewer.