function [prop] = get_interp_stiff(x,i,j,k,l,i_loc,i_type) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % get_interp_stiff: gets the (i,j,k,l) component of the homogenized % stiffness tensor at the coordinate x % input: % x = coordinate of the tensile bar - x if at the nozzle exit, y if at % the bead end % i,j,k,l = indices designating the respective component of % i_loc == 1, the location is at the exit of the nozzle % i_loc == 2, the location is at the end of the deposited bead % i_type == 1, the IRD flow is used % i_type == 2, the RSC flow is used % output: % prop = the requested component of , for example, if i=j=1 & % k=l=2, C1122 will be returned %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Note, on DRDJ-Bali, this file is saved to C:\MATLAB\R2016a. I uncomment % the following two save commands only for debugging purposes. %save('bob_x.txt','x','-ascii'); x = x*1000; % Convert Comsol's distance to millimeters %save('bob_x2.txt','x','-ascii'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Load the data obtained from the COMSOL study at the individual % streamlines. dir_loc = 'C:\Users\russellti\Desktop\SAMPE_2019\Computational_Methods\Data_Files\'; if(i_loc==1 & i_type==1) % Nozzle exit, IRD flow x_data = load([dir_loc,'xi_exit_IRD.mat']); x_data = x_data.xi_exit; Cijkl_data = load([dir_loc,'Cijkl_exit_IRD.mat']); Cijkl_data = Cijkl_data.Cijkl_exit_full; elseif(i_loc==2 & i_type==1) % Extrudate end, IRD flow x_data = load([dir_loc,'yi_end_IRD.mat']); x_data = x_data.yi_end; Cijkl_data = load([dir_loc,'Cijkl_end_IRD.mat']); Cijkl_data = Cijkl_data.Cijkl_end_full; elseif(i_loc==1 & i_type==2) % Nozzle exit, RSC flow x_data = load([dir_loc,'xi_exit_RSC.mat']); x_data = x_data.xi_exit; Cijkl_data = load([dir_loc,'Cijkl_exit_RSC.mat']); Cijkl_data = Cijkl_data.Cijkl_exit_full; elseif(i_loc==2 & i_type==2) % Extrudate end, RSC flow x_data = load([dir_loc,'yi_end_RSC.mat']); x_data = x_data.yi_end; Cijkl_data = load([dir_loc,'Cijkl_end_RSC.mat']); Cijkl_data = Cijkl_data.Cijkl_end_full; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Go through each of the points in x to identify the interpolated values % for aij and then the corresponding stiffness value prop = 0*x; for ii = 1:length(x) if(x(ii) < min(x_data)) x(ii) = min(x_data); elseif(x(ii) > max(x_data)) x(ii) = max(x_data); end prop(ii) = interp1(x_data,squeeze(Cijkl_data(i(ii),j(ii),k(ii),l(ii),:)),x(ii)); end