- Timestamp:
- Apr 25, 2024, 5:56:32 PM (8 months ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field_tps.m
r1137 r1139 143 143 DataOut.curl(ind_sel)=DataOut.curl(ind_sel)-weight.*EMDY *FieldVar(1:nbvec_sub+3,isub,1)+weight.*EMDX *FieldVar(1:nbvec_sub+3,isub,2); 144 144 case 'div(U,V)' 145 DataOut.div(ind_sel)=DataOut.div(ind_sel)+weight.*EMDX*FieldVar(1:nbvec_sub+3,isub,1)+ EMDY*FieldVar(1:nbvec_sub+3,isub,2);145 DataOut.div(ind_sel)=DataOut.div(ind_sel)+weight.*EMDX*FieldVar(1:nbvec_sub+3,isub,1)+weight.*EMDY*FieldVar(1:nbvec_sub+3,isub,2); 146 146 case 'strain(U,V)' 147 DataOut.strain(ind_sel)=DataOut.strain(ind_sel)+weight.*EMDY*FieldVar(1:nbvec_sub+3,isub,1)+ EMDX*FieldVar(1:nbvec_sub+3,isub,2);147 DataOut.strain(ind_sel)=DataOut.strain(ind_sel)+weight.*EMDY*FieldVar(1:nbvec_sub+3,isub,1)+weight.*EMDX*FieldVar(1:nbvec_sub+3,isub,2); 148 148 case 'DUDX(U,V)' 149 149 DataOut.DUDX(ind_sel)=DataOut.DUDX(ind_sel)+weight.*EMDX *FieldVar(1:nbvec_sub+3,isub,1); -
trunk/src/filter_tps.m
r1137 r1139 1 1 %'filter_tps': find the thin plate spline coefficients for interpolation-smoothing 2 2 %------------------------------------------------------------------------ 3 % [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize, Rho,Threshold)3 % [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize,FieldSmooth,Threshold) 4 4 % 5 5 % OUTPUT: … … 16 16 % U,V, possibly W: set of velocity components of the initial data 17 17 % SubdomainSize: estimated number of data points in each subdomain 18 % Rho: smoothing parameter18 % FieldSmooth: smoothing parameter 19 19 % Threshold: max diff accepted between smoothed and initial data 20 20 … … 38 38 %======================================================================= 39 39 40 function [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize, Rho,Threshold)40 function [SubRange,NbCentre,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomainSize,FieldSmooth,Threshold) 41 41 42 42 %% adjust subdomain decomposition … … 61 61 62 62 %% smoothing parameter 63 rho=Siz(1)*Siz(2)*Rho/1000;%optimum rhoincrease as the area of the subdomain (division by 1000 to reach good values with the default GUI input)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 64 65 65 %% default output … … 100 100 % subdomain includes enough vectors, perform tps interpolation 101 101 else 102 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel,:),U(ind_sel), rho);103 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel,:),V(ind_sel), rho);102 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel,:),U(ind_sel),smoothing); 103 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel,:),V(ind_sel),smoothing); 104 104 UDiff=U_smooth_sub-U(ind_sel);% difference between interpolated U component and initial value 105 105 VDiff=V_smooth_sub-V(ind_sel);% difference between interpolated V component and initial value … … 132 132 % else interpolation-smoothing is done again with the selected vectors 133 133 else 134 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)), rho);135 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)), rho);134 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)),smoothing); 135 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)),smoothing); 136 136 x_width=(SubRange(1,2,isub)-SubRange(1,1,isub))/pi; 137 137 y_width=(SubRange(2,2,isub)-SubRange(2,1,isub))/pi; -
trunk/src/series/civ_input.m
r1137 r1139 424 424 Param.Patch1.FieldSmooth=10; 425 425 Param.Patch1.MaxDiff=1.5000; 426 Param.Patch1.SubDomainSize= 1000;426 Param.Patch1.SubDomainSize=250; 427 427 Param.Patch1.TestPatch1=0; 428 428 … … 451 451 Param.Patch2.FieldSmooth=2; 452 452 Param.Patch2.MaxDiff=1.5000; 453 Param.Patch2.SubDomainSize= 1000;453 Param.Patch2.SubDomainSize=500; 454 454 Param.Patch2.TestPatch2=0; 455 455 -
trunk/src/test_tps.m
r1127 r1139 21 21 %U=exp(-(x-pi).*(x-pi)-(y-pi).*(y-pi));% gaussian 22 22 U=x; 23 [U_smooth,U_tps]=tps_coeff([x y],U,0);%calculate tps coeff 23 [U_smooth,U_tps]=tps_coeff([x y],U,0);%calculate tps coeff, no smoothing 24 24 xI=0:0.1:2*pi;%interpolation grid 25 25 yI=0:0.1:2*pi; … … 32 32 U_eval=reshape(U_eval,npy,npx); 33 33 figure(1) 34 imagesc(U_eval,[-1 1]) 34 imagesc(U_eval,[0 6]) 35 title('U matrix') 36 colorbar 35 37 [DMX,DMY] = tps_eval_dxy([XI YI],[x y]); 36 38 DUX_eval=DMX*U_tps; -
trunk/src/tps_coeff.m
r1127 r1139 12 12 % 13 13 %------------------------------------------------------------------------ 14 % [U_smooth,U_tps]=tps_coeff(ctrs,U, Smoothing)14 % [U_smooth,U_tps]=tps_coeff(ctrs,U,smoothing) 15 15 %------------------------------------------------------------------------ 16 16 % OUTPUT: … … 21 21 % ctrs: NxNbDim matrix representing the positions of the N centers, sources of the tps (NbDim=space dimension) 22 22 % U: Nx1 column vector representing the values of the considered scalar measured at the centres ctrs 23 % Smoothing: smoothing parameter: the result is smoother for larger Smoothing.23 % smoothing: smoothing parameter: the result is smoother for larger smoothing. 24 24 % 25 25 % RELATED FUNCTIONS: … … 45 45 %======================================================================= 46 46 47 function [U_smooth,U_tps]=tps_coeff(ctrs,U, Smoothing)47 function [U_smooth,U_tps]=tps_coeff(ctrs,U,smoothing) 48 48 %------------------------------------------------------------------------ 49 49 warning off … … 52 52 U = [U; zeros(NbDim+1,1)]; 53 53 EM = tps_eval(ctrs,ctrs); 54 SmoothingMat= Smoothing*eye(N,N);% Smoothing=1/(2*omega) , omega given by fasshauer;54 SmoothingMat=smoothing*eye(N,N);% smoothing=1/(2*omega) , omega given by fasshauer; 55 55 SmoothingMat=[SmoothingMat zeros(N,NbDim+1)]; 56 56 PM=[ones(N,1) ctrs];
Note: See TracChangeset
for help on using the changeset viewer.