%% WORKFLOW_p3dResults_Sensitivity_positionbc_figures.m % AUTHOR: Morgan Sawyer % DATE CREATED: 06/10/2021 % DATE MODIFIED: 06/25/2021 % VERSION: v.1 % PURPOSE: Visualize the dikes maximum opening and volume from variable % dike lengths, heights, and a specified upper tip position % DEPENDENCIES: % - WORKFLOW_p3d_SV_toy_dikes_Sensitivity_positionbc.m % - WORKFLOW_p3dResults_Sensitivity_positionbc_interrogation_3d % CURRENT MODEL SPECIFICATIONS: % half space % bouyancy pressure case clear all, close all % avoid contamination with prior runs %% Add path to local bin folders containg supporting scripts/functions addpath('bin') % bin of scripts to generate toy model discontinuities and BC addpath('bin_p3d') % bin of scripts to generate and run p3d model addpath('bin_geomech'); % bin of geomechanics functions addpath('bin_SV'); % bin of SV data and constraints addpath('bin_mesh'); % bin of functions and scripts for meshing surfaces %% I/O import output file % path_in = strcat('InputOutput_bc_Pb_VP/'); path_in = strcat('InputOutput_bc_Pb_HCRHW/'); % path_in = strcat('InputOutput_bc_Pb_HCRFW/'); filename = 'SV_dike_bouyancy_'; % load(fullfile(path_in,'SV_toy_dike_Sensitivity_bc_Pb_VP.mat')); % key workspace variables from the model run load(fullfile(path_in,'SV_toy_dike_Sensitivity_bc_Pb_HCRHW.mat')); % load(fullfile(path_in,'SV_toy_dike_Sensitivity_bc_Pb_HCRFW.mat')); %% Load data % load(fullfile(path_in,'SV_toy_dike_Sensitivity_position_bc_VP_interrogation.mat')); load(fullfile(path_in,'SV_toy_dike_Sensitivity_position_bc_HCRHW_interrogation.mat')); % load(fullfile(path_in,'SV_toy_dike_Sensitivity_position_bc_HCRFW_interrogation.mat')); %% Visulization L = 5; % chooses index of upper tip position to analyze (manually input) % NOTE: The maximum opening visulaization uses a linear interpolation to fill in % the points where data was removed due to bad data % cognating points for each layer X2R_con = X2R(:,:,L); X1R_con = X1R(:,:,L); U3MAX_con = U3MAX(:,:,L); % setting up the linear 3d linear interpolation: % finding the removed data points in the array I = find(isnan(U3MAX_con)); % indices that are nan J = find(isnan(U3MAX_con)==0); % indices that are not nan (correct data) % interpolate % Using scatteredInterpolant to independently find the relationship among % points in the data set based on their coordinates and uses it to define % the object F. F can then be used to interpolate values at specified % locations. This allows a matrix to have bad values removed, then % interpolate new estimates at the coordinates of the "bad values." These % new estimates will need to be placed back in the grid which can be % accomplished with a FOR loop. F = scatteredInterpolant(X2R_con(J),X1R_con(J),U3MAX_con(J)); Zidummy = F(X2R_con(I),X1R_con(I)); Zi = U3MAX_con; for i=1:length(I) Zi(I(i)) = Zidummy(i); end OF = {'wo','MarkerFaceColor','w','MarkerSize',8}; OFi = {'ko','LineWidth',1,'MarkerSize',10}; OS = {'FaceAlpha',0.95,'LineWidth',0.5,'EdgeAlpha',0.3}; f1 = figure; nuU3MAX = surf(X2R_con,X1R_con,Zi,OS{:}); hold on % contour plot [M1,C1]=contour3(X2R_con+0.25, X1R_con+0.25,U3MAX_con+0.25,20); C1.LineWidth=2; C1.Color='w'; plot3(X2R_con,X1R_con,U3MAX_con,'.k','markersize',6); plot3(X2R_con(I),X1R_con(I),Zi(I),OF{:}) plot3(X2R_con(I),X1R_con(I),Zidummy,OFi{:}) % formatting shading faceted xlabel('Dike Semi-Length, m') ylabel('Dike Semi-Height, m') zlabel('maximum opening, m') title('Sensitivity of Dike Geometry on Dike Opening'); hc = colorbar; ylabel(hc,'maximum opening, du3, m'); box on, grid on view([0,90]) linkprop(gca,'ax','equal'); savefig([path_in,'FIG - HL max opening']) % u3max without interpolation % f1 = figure; % nuU3MAX = surf(X2R(:,:,L),X1R(:,:,L),U3MAX(:,:,L)); hold on % % contour plot % [M1,C1]=contour3(X2R(:,:,L)+0.25, X1R(:,:,L)+0.25,U3MAX(:,:,L)+0.25,20); C1.LineWidth=2; C1.Color='w'; % plot3(X2R(:,:,L),X1R(:,:,L),U3MAX(:,:,L),'.k','markersize',6); % % formatting % shading faceted % xlabel('Dike Length, m') % ylabel('Dike Height, m') % zlabel('maximum opening, m') % title('Sensitivity of Dike Geometry on Dike Opening'); % hc = colorbar; ylabel(hc,'maximum opening, du3, m'); % box on, grid on % view([0,90]) % linkprop(gca,'ax','equal'); % savefig([path_in,'FIG - HL max opening']) % f2 = figure; % hVOL = surf(X2R(:,:,L), X1R(:,:,L),VOL(:,:,L)); hold on % % contour plot % [M2,C2]=contour3(X2R(:,:,L)-20,X1R(:,:,L)-20,VOL(:,:,L)-20,20); C2.LineWidth=2; C2.Color='w'; % plot3(X2R(:,:,L), X1R(:,:,L), VOL(:,:,L),'.k', 'markersize',6); % % formatting % shading faceted % xlabel('Dike Semi-Length, m') % ylabel('Dike Semi-Height, m') % zlabel('volume, m^3') % title('Sensitivity of Dike Geometry on Dike Volume'); % hc = colorbar; ylabel(hc,'volume, m^3'); % box on, grid on % view([0,90]) % linkprop(gca,'ax','equal'); % savefig([path_in,'FIG - HL volume']) % % %% Quality control % % Traction: % f3 = figure; % nuU3MAX = surf(X2R(:,:,L),X1R(:,:,L),T3MAX(:,:,L)); hold on % % contour plot % [M1,C1]=contour3(X2R(:,:,L)+0.25, X1R(:,:,L)+0.25,T3MAX(:,:,L)+0.25,20); C1.LineWidth=2; C1.Color='w'; % plot3(X2R(:,:,L),X1R(:,:,L),U3MAX(:,:,L),'.k','markersize',6); % % formatting % shading faceted % xlabel('Dike Length, m') % ylabel('Dike Height, m') % zlabel('maximum traction, Pascals') % title('Sensitivity of Dike Geometry on Maximum Traction Boundary Condition'); % hc = colorbar; ylabel(hc,'maximum traction, du3, m'); % box on, grid on % view([0,90]) % linkprop(gca,'ax','equal'); % savefig([path_in,'FIG - HL normal traction']) % % % Element interior angles % f4 = figure; % hbadtri = surf(X2R(:,:,L),X1R(:,:,L),BADTRI(:,:,L)); % hold on % % formatting % zlim([0 60]); % caxis([0,60]); % shading faceted % xlabel('Dike Length, m') % ylabel('Dike Height, m') % zlabel('element interior angles, m') % title('Sensitivity of Dike Geometry on Dike Opening'); % hc = colorbar; ylabel(hc,'element interior angles, degrees'); % box on, grid on % view([0,90]) % linkprop(gca,'ax','equal'); % savefig([path_in,'FIG - HL interior angles']) % % % Last mesh imported % f5 = figure; % trisurf(tri,v(:,1),v(:,2),v(:,3)) % axis equal % box on, axis square