├── Case1_SEM_use_inner_mesh.m ├── Case2_SEM_use_Gmsh_mesh.m ├── README.md ├── Write_Gmsh.m ├── figures ├── PML.png ├── Topo-Zinc.png ├── Topo.png ├── model.png └── waveforms.png ├── mesh ├── .DS_Store ├── Mesh.jpg ├── Mesh2.jpg ├── mymesh.geo ├── mymesh.msh └── topo_data.dat └── src ├── Assemble_Global_Jacobian.m ├── Assemble_Global_K.m ├── Assemble_Global_M_and_C.m ├── Check_Stability_After.m ├── Check_Stability_Before.m ├── Find_Nearest_Node.m ├── GetGLL.m ├── Get_California_Model.m ├── Get_Layer_Model.m ├── Lagrange_Any.m ├── MeshBox.m ├── Mesh_Geometry.m ├── Mesh_Global.m ├── Moment_Tensor_Solution.m ├── Plot_Trace.m ├── Plot_Wavefield.m ├── Plot_tri_used.m ├── Read_Gmsh.m ├── Set_PML.m ├── Set_Source_Array.m ├── Shape_Functions.m ├── Source_Time_Function.m ├── WMatrix.m ├── gll_library ├── gll_03.tab ├── gll_04.tab ├── gll_05.tab ├── gll_06.tab ├── gll_07.tab ├── gll_08.tab ├── gll_09.tab ├── gll_10.tab ├── gll_11.tab ├── gll_12.tab ├── gll_13.tab ├── gll_14.tab ├── gll_15.tab ├── gll_16.tab ├── gll_17.tab ├── gll_18.tab ├── gll_19.tab └── gll_20.tab ├── plot_waveform.m └── redblue.m /Case1_SEM_use_inner_mesh.m: -------------------------------------------------------------------------------- 1 | % SEM 2D Elastic wave code. 2 | % 3 | % by Haipeng Li, Hongbo Han, and Wancong Zhao. 4 | % at University of Science and Technology of China 5 | % Contact: haipengl@mail.ustc.edu.cn 6 | 7 | clear; clc; close all; 8 | addpath(genpath(pwd), '-begin'); warning('off'); 9 | 10 | %%%%%%% Model Size Pars %%%%%%%% 11 | NDIM = 2; % 2-D simulation 12 | xmin = 0; % xmin 13 | zmin = 0; % zmin 14 | xmax = 4000; % xmax 15 | zmax = 2000; % zmax 16 | nelem_x = 80; % number of spectral elements along X 17 | nelem_z = 40; % number of spectral elements along Z 18 | P = 4; % polynomial degree (inside each element, along each direction) 19 | NGLLX = P + 1; % number of GLL integration points in x direction of an element 20 | NGLLZ = NGLLX; % number of GLL integration points in z direction of an element 21 | ngnod = 4; % use 4-node elements to describe the geometry of the mesh, other option like 9-node 22 | 23 | %%%%%%% Time Evolution Pars %%%%%%%% 24 | dt = 5e-4; 25 | nt = 3001; 26 | t = linspace(0, (nt-1)*dt, nt); 27 | time = dt * nt; 28 | threshold = 1.e+20; % displacement threshold above which we consider that the code became unstable 29 | output_step = 100; 30 | 31 | %%%%%%%% PML Pars %%%%%%%% 32 | use_pml_or_not = true; 33 | pml_x_thick = 300; 34 | pml_z_thick = 300; 35 | free_surface = 1; 36 | 37 | %%%%%%%% Source & Receiver Pars %%%%%%%% 38 | %% Source time function 39 | f0 = 15; 40 | t0 = 1.2 / f0; 41 | amplitude = 1.e10; 42 | src_wavelet = amplitude * Source_Time_Function(t,'ricker',f0, t0); 43 | 44 | %% Source type: choose between 'vector_source' and 'moment_tensor_source' 45 | src_type = 'vector_source'; 46 | % for vector_source 47 | force_angle = 90; 48 | % for moment_tensor_source 49 | strike = 45; 50 | dip = 30; 51 | rake = 104; 52 | Moment_Tensor = Moment_Tensor_Solution(strike, dip, rake); 53 | %% Source location 54 | src_n = 1; 55 | src_xz = zeros(2, src_n); 56 | src_xz(1,:) = 1000; 57 | src_xz(2,:) = 2000; 58 | 59 | %%%%%%%%%%%%%%%%% Mesh Regular Model %%%%%%%%%%%%%%%%% 60 | % Mesh information 61 | NSPEC = nelem_x * nelem_z; % number of spectral elements of the mesh 62 | NGLOB = (nelem_x*(NGLLX-1) + 1) * (nelem_z*(NGLLZ-1) + 1); % number of unique grid points of the mesh 63 | NPGEO = (nelem_x+1)*(nelem_z+1); % total number of geometrical points that describe the geometry 64 | % Geometrical points that describe the mesh: 65 | [coorg, knods] = Mesh_Geometry(xmin, xmax, zmin, zmax, nelem_x, nelem_z, 'q4'); % only q4 at present. coorg and knods: coordinates and numbering of control nodes 66 | % Calculation points that describe the mesh: 67 | [ibool] = Mesh_Global(nelem_x, nelem_z, NGLOB, NGLLX, NSPEC); % ibool: numbering of all the calculation points 68 | % for plot 69 | geo_x = [xmin, xmax, xmax, xmin, xmin]; 70 | geo_z = [zmin, zmin, zmax, zmax, zmin]; 71 | geo_xz = [geo_x;geo_z]; 72 | %% Receiver location 73 | rec_n = 101; 74 | rec_xz = zeros(2, rec_n); 75 | rec_xz(1,:) = linspace(0, xmax, rec_n); 76 | rec_xz(2,:) = 2000; 77 | 78 | %%%%%%%%%%%%%%%%% Mesh Irregular Model %%%%%%%%%%%%%%%%% 79 | % [coorg, knods, ibool] = Read_Gmsh('./mesh/mymesh.msh', NGLLX, NGLLZ); 80 | % NSPEC = size(ibool,3); % number of spectral elements of the mesh 81 | % NGLOB = size(coorg,2); % number of unique grid points of the mesh 82 | % NPGEO = size(knods,1) * size(knods,2); % total number of geometrical points that describe the geometry 83 | % % for plot 84 | % topo_z = load('./mesh/topo_data.dat');topo_z = topo_z(1:3:end); 85 | % topo_z = smooth(topo_z, 4)'; 86 | % topo_x = linspace(xmin, xmax, length(topo_z)); 87 | % geo_x = [topo_x, xmax, xmin, xmin]; 88 | % geo_z = [topo_z, zmin, zmin, topo_z(1)]; 89 | % geo_xz = [geo_x;geo_z]; 90 | % 91 | % %% Receiver location 92 | % rec_n = length(topo_z); 93 | % rec_xz = zeros(2, rec_n); 94 | % rec_xz(1,:) = topo_x; 95 | % rec_xz(2,:) = topo_z; 96 | 97 | %%%%%%%%%%%%%%%%% Assemble Global Jacobian %%%%%%%%%%%%%%%%% 98 | [coord, xix, xiz, gammax, gammaz, jacobian] = Assemble_Global_Jacobian(ibool,coorg,knods,NGLLX,NGLLZ); 99 | 100 | %%%%%%%%%%%%%%%%% Model Medium Pars %%%%%%%%%%%%%%%%% 101 | % Case 1: isotropic media 102 | rho = ones(NGLOB, 1) * 2700; 103 | vp = ones(NGLOB, 1) * 5000; 104 | vs = vp / 1.732; 105 | mu = rho .* vs .* vs; 106 | lambda = rho .* vp .* vp - 2.0 * mu; 107 | lambdaplus2mu = lambda + 2.0 * mu; 108 | c11 = lambdaplus2mu; 109 | c13 = lambda; 110 | c33 = lambdaplus2mu; 111 | c44 = mu; 112 | 113 | % Case 2: anisotropic media zinc 114 | % scale_aniso = 1e9; 115 | % rho = ones(NGLOB, 1) * 7100; 116 | % c11 = ones(NGLOB, 1) * 165.0 * scale_aniso; 117 | % c13 = ones(NGLOB, 1) * 50.0 * scale_aniso; 118 | % c33 = ones(NGLOB, 1) * 62.0 * scale_aniso; 119 | % c44 = ones(NGLOB, 1) * 39.6 * scale_aniso; 120 | % vp = sqrt(c33./rho); 121 | % vs = sqrt(c44./rho); 122 | 123 | 124 | %%%%%%%%%%%%%%%%% PML damping profiles %%%%%%%%%%%%%%%%% 125 | [pml_dx, pml_dz, pml_dxx, pml_dzz] = Set_PML( vp, xmin, xmax, zmin, zmax, NSPEC, NGLOB, NGLLX, NGLLZ, pml_x_thick, pml_z_thick, free_surface, coord, ibool); 126 | if use_pml_or_not==false % if pml is not used, set the dampping profiles to zeros. 127 | pml_dx(:) = 0.0; pml_dz(:) = 0.0; pml_dxx(:) = 0.0; pml_dzz(:) = 0.0; 128 | end 129 | 130 | %%%%%%%%%%%%%%%%% Build the mass matrix %%%%%%%%%%%%%%%%% 131 | [M, Cx, Cz, Cxx, Cxz, Czz] = Assemble_Global_M_and_C(NSPEC, NGLOB, NGLLX, NGLLZ, jacobian, ibool, rho, pml_dx, pml_dz); 132 | 133 | %%%%%%%%%%%%%%%%% Build the stiffness matrix, with elastic tensor and PML %%%%%%%%%%%%%%%%% 134 | [Kx1, Kx2, Kx3, Kx4, Kx5, Kz1, Kz2, Kz3, Kz4, Kz5] = Assemble_Global_K(NGLOB, NGLLX, NGLLZ, jacobian, gammax, gammaz, xix, xiz, ibool, c11, c13, c33, c44, pml_dxx, pml_dzz); 135 | 136 | %%%%%%%% Constant value %%%%%%%% 137 | a0 = 1 / dt^2; a1 = 1 / (2 * dt); a2 = 2 * a0; a3 = 1 / a2; 138 | 139 | A1 = a0 * M + a1 * 2 * Cx; 140 | A2 = a0 * M + a1 * ( Cx + Cz ); 141 | A3 = a0 * M + a1 * 2 * Cz; 142 | AL = 2 * a1 * M; 143 | % invert the these matrices here once and for all 144 | A1_inv = zeros(NGLOB,1); 145 | A2_inv = zeros(NGLOB,1); 146 | A3_inv = zeros(NGLOB,1); 147 | AL_inv = zeros(NGLOB,1); 148 | M_inv = zeros(NGLOB,1); 149 | for i = 1:NGLOB 150 | A1_inv(i) = 1.0 / A1(i); 151 | A2_inv(i) = 1.0 / A2(i); 152 | A3_inv(i) = 1.0 / A3(i); 153 | AL_inv(i) = 1.0 / AL(i); 154 | M_inv(i) = 1.0 / M(i); 155 | end 156 | 157 | %%%%%%%% Wavefield plot Pars %%%%%%%% 158 | xx = linspace(xmin, xmax, nelem_x*(NGLLX-1) + 1); 159 | zz = linspace(zmin, zmax, nelem_z*(NGLLZ-1) + 1); 160 | [xGrid, zGrid] = meshgrid(xx,zz); 161 | tri_used = Plot_tri_used(coord); 162 | plot_ratio= max(coord(1,:)) / max(coord(2,:)); 163 | 164 | %%%%%%%% Relocate S & R %%%%%%%% 165 | [src_xz, src_node, ~] = Find_Nearest_Node(src_xz,coord); 166 | [rec_xz, rec_node, ~] = Find_Nearest_Node(rec_xz,coord); 167 | 168 | %%%%%%%% Check the simulation is OK %%%%%%%% 169 | Check_Stability_Before(dt, f0, xmin, xmax, zmin, zmax, nelem_x, nelem_z, NGLLX, NGLLZ, vp, vs); 170 | 171 | %%%%%%%% Set source arrays, this is how to add source in SEM %%%%%%%% 172 | [sourcearray, ispec_source] = Set_Source_Array(src_node, src_type, force_angle, Moment_Tensor, ibool, xix, xiz, gammax, gammaz, NDIM, NGLLX, NGLLZ); 173 | 174 | % plot the velocity model 175 | figure(1) 176 | trisurf(tri_used, coord(1,:)/1000, (coord(2,:) - geo_xz(2,end))/1000, vp(:)); view(2); shading interp; hold on; 177 | scatter3(rec_xz(1,:)/1000, (rec_xz(2,:)-geo_xz(2,end))/1000,vp(rec_node),100,'rv', 'filled');hold on; 178 | scatter3(src_xz(1,:)/1000, (src_xz(2,:)-geo_xz(2,end))/1000,vp(src_node),400,'bp', 'filled'); 179 | xlabel('Distance (km)'); ylabel('Depth (km)'); pbaspect([1 1/plot_ratio 1]); set(gca, 'FontSize', 16); 180 | hcb = colorbar; title(hcb,{'V_{s} (m/s)'}, 'FontName','Times New Roman','FontSize',10); 181 | set(gcf,'position',[50,50,1000,600]) 182 | print(gcf, './results/vp.png', '-dpng', '-r300'); 183 | 184 | %%%%%%%% Initial arrays %%%%%%%% 185 | seism = zeros(NDIM,rec_n,nt); % seismogram recorded at the receiver 186 | displ_now = zeros(NGLOB, NDIM); % global displacement vector 187 | displ_old_term1 = zeros(NGLOB, NDIM); % global displacement vector 188 | displ_old_term2 = zeros(NGLOB, NDIM); % global displacement vector 189 | displ_old_term3 = zeros(NGLOB, NDIM); % global displacement vector 190 | displ_now_term1 = zeros(NGLOB, NDIM); % global displacement vector 191 | displ_now_term2 = zeros(NGLOB, NDIM); % global displacement vector 192 | displ_now_term3 = zeros(NGLOB, NDIM); % global displacement vector 193 | displ_new_term1 = zeros(NGLOB, NDIM); % global displacement vector 194 | displ_new_term2 = zeros(NGLOB, NDIM); % global displacement vector 195 | displ_new_term3 = zeros(NGLOB, NDIM); % global displacement vector 196 | p_x = zeros(NGLOB, NDIM); 197 | p_z = zeros(NGLOB, NDIM); 198 | energy = zeros(nt,1); 199 | 200 | % start of the time loop 201 | for it = 1 : nt 202 | % compute current time 203 | time = (it-1)*dt; 204 | % compute maximum of norm of displacement from time to time and display it in order to monitor the simulation 205 | if (mod(it,output_step) == 0 || it == 1 || it == nt) 206 | Check_Stability_After(displ_now', NGLOB, it, dt, nt, threshold); 207 | %Plot_Wavefield(displ_now', tri_used, geo_xz, rec_xz, src_xz, coord, time, plot_ratio, src_node, rec_node, it); 208 | Plot_Wavefield_For_DB(displ_now', tri_used, geo_xz, rec_xz, src_xz, coord, time, plot_ratio, src_node, rec_node, it, seism,t,vp); 209 | end 210 | energy(it) = sum(displ_now(:,1).*displ_now(:,1) + displ_now(:,2).*displ_now(:,2)); 211 | % Time evlolution scheme. 212 | displ_new_term1(:,1) = A1_inv.* (M .* p_x(:,1) - Kx1 * displ_now(:,1) - ( Cxx - a2 * M ) .* displ_now_term1(:,1) - ( a0 * M - a1 * 2 * Cx ) .* displ_old_term1(:,1)); 213 | displ_new_term2(:,1) = A2_inv.* ( - Kx2 * displ_now(:,2) - ( Cxz - a2 * M ) .* displ_now_term2(:,1) - ( a0 * M - a1 * (Cx+Cz)) .* displ_old_term2(:,1)); 214 | displ_new_term3(:,1) = A3_inv.* (M .* p_x(:,2) - Kx3 * displ_now(:,1) - ( Czz - a2 * M ) .* displ_now_term3(:,1) - ( a0 * M - a1 * 2 * Cz ) .* displ_old_term3(:,1)); 215 | p_x(:,1) = AL_inv.* ( - Kx4 * displ_now(:,1) - Cx .* p_x(:,1) + 2 * a1 * M .* p_x(:,1)); 216 | p_x(:,2) = AL_inv.* ( - Kx5 * displ_now(:,1) - Cz .* p_x(:,2) + 2 * a1 * M .* p_x(:,2)); 217 | 218 | displ_new_term1(:,2) = A1_inv.* (M .* p_z(:,1) - Kz1 * displ_now(:,2) - ( Cxx - a2 * M ) .* displ_now_term1(:,2) - ( a0 * M - a1 * 2 * Cx ) .* displ_old_term1(:,2)); 219 | displ_new_term2(:,2) = A2_inv.* ( - Kz2 * displ_now(:,1) - ( Cxz - a2 * M ) .* displ_now_term2(:,2) - ( a0 * M - a1 * (Cx+Cz)) .* displ_old_term2(:,2)); 220 | displ_new_term3(:,2) = A3_inv.* (M .* p_z(:,2) - Kz3 * displ_now(:,2) - ( Czz - a2 * M ) .* displ_now_term3(:,2) - ( a0 * M - a1 * 2 * Cz ) .* displ_old_term3(:,2)); 221 | p_z(:,1) = AL_inv.* ( - Kz4 * displ_now(:,2) - Cx .* p_z(:,1) + 2 * a1 * M .* p_z(:,1) ); 222 | p_z(:,2) = AL_inv.* ( - Kz5 * displ_now(:,2) - Cz .* p_z(:,2) + 2 * a1 * M .* p_z(:,2)); 223 | 224 | displ_old_term1 = displ_now_term1; 225 | displ_old_term2 = displ_now_term2; 226 | displ_old_term3 = displ_now_term3; 227 | 228 | displ_now_term1 = displ_new_term1; 229 | displ_now_term2 = displ_new_term2; 230 | displ_now_term3 = displ_new_term3; 231 | displ_now = displ_now_term1 + displ_now_term2 + displ_now_term3; 232 | displ_now(src_node,1) = displ_now(src_node,1) + sin(force_angle*pi/180) * src_wavelet(it); 233 | displ_now(src_node,2) = displ_now(src_node,2) + cos(force_angle*pi/180) * src_wavelet(it); 234 | 235 | 236 | % add the source here 237 | % for j = 1:NGLLZ 238 | % for i = 1:NGLLX 239 | % iglob = ibool(i,j,ispec_source); 240 | % displ_now(iglob,:) = displ_now(iglob,:) - sourcearray(:,i,j)' * src_wavelet(it); 241 | % end 242 | % end 243 | 244 | % displ_new_x = dt * dt * M_inv .* (force_x - (Kx1+Kx3) * displ_now_x - Kx2*displ_now_z) + 2 * displ_now_x - displ_old_x; 245 | % displ_new_z = dt * dt * M_inv .* (force_z - (Kz1+Kz3) * displ_now_z - Kz2*displ_now_x) + 2 * displ_now_z - displ_old_z; 246 | % 247 | % displ_old_x = displ_now_x; 248 | % displ_old_z = displ_now_z; 249 | % 250 | % displ_now_x = displ_new_x; 251 | % displ_now_z = displ_new_z; 252 | 253 | % record a seismogram to check that the simulation went well 254 | seism(:,:,it) = displ_now(rec_node,:)'; 255 | end 256 | 257 | figure 258 | Plot_Trace(rec_xz, t, seism, 1.2, './results/seismgram.png'); 259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /Case2_SEM_use_Gmsh_mesh.m: -------------------------------------------------------------------------------- 1 | % SEM 2D Elastic wave code. 2 | % 3 | % by Haipeng Li, Hongbo Han, and Wancong Zhao. 4 | % at University of Science and Technology of China 5 | % Contact: haipengl@mail.ustc.edu.cn 6 | 7 | 8 | clear; clc; close all; 9 | addpath(genpath(pwd), '-begin'); warning('off'); 10 | 11 | %%%%%%% Model Size Pars %%%%%%%% 12 | NDIM = 2; % 2-D simulation 13 | xmin = 0; % xmin 14 | zmin = 0; % zmin 15 | xmax = 4000; % xmax 16 | zmax = 2000; % zmax 17 | nelem_x = 80; % number of spectral elements along X 18 | nelem_z = 40; % number of spectral elements along Z 19 | P = 4; % polynomial degree (inside each element, along each direction) 20 | NGLLX = P + 1; % number of GLL integration points in x direction of an element 21 | NGLLZ = NGLLX; % number of GLL integration points in z direction of an element 22 | ngnod = 4; % use 4-node elements to describe the geometry of the mesh, other option like 9-node 23 | 24 | %%%%%%% Time Evolution Pars %%%%%%%% 25 | dt = 5e-4; 26 | nt = 2001; 27 | t = linspace(0, (nt-1)*dt, nt); 28 | time = dt * nt; 29 | threshold = 1.e+20; % displacement threshold above which we consider that the code became unstable 30 | output_step = 100; 31 | 32 | %%%%%%%% PML Pars %%%%%%%% 33 | use_pml_or_not = true; 34 | pml_x_thick = 300; 35 | pml_z_thick = 300; 36 | free_surface = 1; 37 | 38 | %%%%%%%% Source & Receiver Pars %%%%%%%% 39 | %% Source time function 40 | f0 = 15; 41 | t0 = 1.2 / f0; 42 | amplitude = 1.e10; 43 | src_wavelet = amplitude * Source_Time_Function(t,'ricker',f0, t0); 44 | 45 | %% Source type: choose between 'vector_source' and 'moment_tensor_source' 46 | src_type = 'vector_source'; 47 | % for vector_source 48 | force_angle = 90; 49 | % for moment_tensor_source 50 | strike = 45; 51 | dip = 30; 52 | rake = 104; 53 | Moment_Tensor = Moment_Tensor_Solution(strike, dip, rake); 54 | %% Source location 55 | src_n = 1; 56 | src_xz = zeros(2, src_n); 57 | src_xz(1,:) = 2000; 58 | src_xz(2,:) = 2000; 59 | 60 | %%%%%%%%%%%%%%%%% Mesh Regular Model %%%%%%%%%%%%%%%%% 61 | % Mesh information 62 | % NSPEC = nelem_x * nelem_z; % number of spectral elements of the mesh 63 | % NGLOB = (nelem_x*(NGLLX-1) + 1) * (nelem_z*(NGLLZ-1) + 1); % number of unique grid points of the mesh 64 | % NPGEO = (nelem_x+1)*(nelem_z+1); % total number of geometrical points that describe the geometry 65 | % % Geometrical points that describe the mesh: 66 | % [coorg, knods] = Mesh_Geometry(xmin, xmax, zmin, zmax, nelem_x, nelem_z, 'q4'); % only q4 at present. coorg and knods: coordinates and numbering of control nodes 67 | % % Calculation points that describe the mesh: 68 | % [ibool] = Mesh_Global(nelem_x, nelem_z, NGLOB, NGLLX, NSPEC); % ibool: numbering of all the calculation points 69 | % % for plot 70 | % geo_x = [xmin, xmax, xmax, xmin, xmin]; 71 | % geo_z = [zmin, zmin, zmax, zmax, zmin]; 72 | % geo_xz = [geo_x;geo_z]; 73 | % %% Receiver location 74 | % rec_n = 21; 75 | % rec_xz = zeros(2, rec_n); 76 | % rec_xz(1,:) = linspace(xmin, xmax, rec_n); 77 | % rec_xz(2,:) = 2000; 78 | 79 | %%%%%%%%%%%%%%%%% Mesh Irregular Model %%%%%%%%%%%%%%%%% 80 | [coorg, knods, ibool] = Read_Gmsh('./mesh/mymesh.msh', NGLLX, NGLLZ); 81 | NSPEC = size(ibool,3); % number of spectral elements of the mesh 82 | NGLOB = size(coorg,2); % number of unique grid points of the mesh 83 | NPGEO = size(knods,1) * size(knods,2); % total number of geometrical points that describe the geometry 84 | % for plot 85 | topo_z = load('./mesh/topo_data.dat');topo_z = topo_z(1:3:end); 86 | topo_z = smooth(topo_z, 4)'; 87 | topo_x = linspace(xmin, xmax, length(topo_z)); 88 | geo_x = [topo_x, xmax, xmin, xmin]; 89 | geo_z = [topo_z, zmin, zmin, topo_z(1)]; 90 | geo_xz = [geo_x;geo_z]; 91 | 92 | %% Receiver location 93 | rec_n = length(topo_z); 94 | rec_xz = zeros(2, rec_n); 95 | rec_xz(1,:) = topo_x; 96 | rec_xz(2,:) = topo_z; 97 | 98 | %%%%%%%%%%%%%%%%% Assemble Global Jacobian %%%%%%%%%%%%%%%%% 99 | [coord, xix, xiz, gammax, gammaz, jacobian] = Assemble_Global_Jacobian(ibool,coorg,knods,NGLLX,NGLLZ); 100 | 101 | %%%%%%%%%%%%%%%%% Model Medium Pars %%%%%%%%%%%%%%%%% 102 | % Case 1: isotropic media 103 | rho = ones(NGLOB, 1) * 2700; 104 | vp = ones(NGLOB, 1) * 5000; 105 | vs = vp / 1.732; 106 | mu = rho .* vs .* vs; 107 | lambda = rho .* vp .* vp - 2.0 * mu; 108 | lambdaplus2mu = lambda + 2.0 * mu; 109 | c11 = lambdaplus2mu; 110 | c13 = lambda; 111 | c33 = lambdaplus2mu; 112 | c44 = mu; 113 | 114 | % Case 2: anisotropic media zinc 115 | % scale_aniso = 1e9; 116 | % rho = ones(NGLOB, 1) * 7100; 117 | % c11 = ones(NGLOB, 1) * 165.0 * scale_aniso; 118 | % c13 = ones(NGLOB, 1) * 50.0 * scale_aniso; 119 | % c33 = ones(NGLOB, 1) * 62.0 * scale_aniso; 120 | % c44 = ones(NGLOB, 1) * 39.6 * scale_aniso; 121 | % vp = sqrt(c33./rho); 122 | % vs = sqrt(c44./rho); 123 | 124 | 125 | %%%%%%%%%%%%%%%%% PML damping profiles %%%%%%%%%%%%%%%%% 126 | [pml_dx, pml_dz, pml_dxx, pml_dzz] = Set_PML( vp, xmin, xmax, zmin, zmax, NSPEC, NGLOB, NGLLX, NGLLZ, pml_x_thick, pml_z_thick, free_surface, coord, ibool); 127 | if use_pml_or_not==false % if pml is not used, set the dampping profiles to zeros. 128 | pml_dx(:) = 0.0; pml_dz(:) = 0.0; pml_dxx(:) = 0.0; pml_dzz(:) = 0.0; 129 | end 130 | 131 | %%%%%%%%%%%%%%%%% Build the mass matrix %%%%%%%%%%%%%%%%% 132 | [M, Cx, Cz, Cxx, Cxz, Czz] = Assemble_Global_M_and_C(NSPEC, NGLOB, NGLLX, NGLLZ, jacobian, ibool, rho, pml_dx, pml_dz); 133 | 134 | %%%%%%%%%%%%%%%%% Build the stiffness matrix, with elastic tensor and PML %%%%%%%%%%%%%%%%% 135 | [Kx1, Kx2, Kx3, Kx4, Kx5, Kz1, Kz2, Kz3, Kz4, Kz5] = Assemble_Global_K(NGLOB, NGLLX, NGLLZ, jacobian, gammax, gammaz, xix, xiz, ibool, c11, c13, c33, c44, pml_dxx, pml_dzz); 136 | 137 | %%%%%%%% Constant value %%%%%%%% 138 | a0 = 1 / dt^2; a1 = 1 / (2 * dt); a2 = 2 * a0; a3 = 1 / a2; 139 | 140 | A1 = a0 * M + a1 * 2 * Cx; 141 | A2 = a0 * M + a1 * ( Cx + Cz ); 142 | A3 = a0 * M + a1 * 2 * Cz; 143 | AL = 2 * a1 * M; 144 | % invert the these matrices here once and for all 145 | A1_inv = zeros(NGLOB,1); 146 | A2_inv = zeros(NGLOB,1); 147 | A3_inv = zeros(NGLOB,1); 148 | AL_inv = zeros(NGLOB,1); 149 | M_inv = zeros(NGLOB,1); 150 | for i = 1:NGLOB 151 | A1_inv(i) = 1.0 / A1(i); 152 | A2_inv(i) = 1.0 / A2(i); 153 | A3_inv(i) = 1.0 / A3(i); 154 | AL_inv(i) = 1.0 / AL(i); 155 | M_inv(i) = 1.0 / M(i); 156 | end 157 | 158 | %%%%%%%% Wavefield plot Pars %%%%%%%% 159 | xx = linspace(xmin, xmax, nelem_x*(NGLLX-1) + 1); 160 | zz = linspace(zmin, zmax, nelem_z*(NGLLZ-1) + 1); 161 | [xGrid, zGrid] = meshgrid(xx,zz); 162 | tri_used = Plot_tri_used(coord); 163 | plot_ratio= max(coord(1,:)) / max(coord(2,:)); 164 | 165 | %%%%%%%% Relocate S & R %%%%%%%% 166 | [src_xz, src_node, ~] = Find_Nearest_Node(src_xz,coord); 167 | [rec_xz, rec_node, ~] = Find_Nearest_Node(rec_xz,coord); 168 | 169 | %%%%%%%% Check the simulation is OK %%%%%%%% 170 | Check_Stability_Before(dt, f0, xmin, xmax, zmin, zmax, nelem_x, nelem_z, NGLLX, NGLLZ, vp, vs); 171 | 172 | %%%%%%%% Set source arrays, this is how to add source in SEM %%%%%%%% 173 | [sourcearray, ispec_source] = Set_Source_Array(src_node, src_type, force_angle, Moment_Tensor, ibool, xix, xiz, gammax, gammaz, NDIM, NGLLX, NGLLZ); 174 | 175 | % plot the velocity model 176 | figure(1) 177 | trisurf(tri_used, coord(1,:)/1000, (coord(2,:) - geo_xz(2,end))/1000, vp(:)); view(2); shading interp; hold on; 178 | scatter3(rec_xz(1,:)/1000, (rec_xz(2,:)-geo_xz(2,end))/1000,vp(rec_node),100,'rv', 'filled');hold on; 179 | scatter3(src_xz(1,:)/1000, (src_xz(2,:)-geo_xz(2,end))/1000,vp(src_node),400,'bp', 'filled'); 180 | xlabel('Distance (km)'); ylabel('Depth (km)'); pbaspect([1 1/plot_ratio 1]); set(gca, 'FontSize', 16); 181 | hcb = colorbar; title(hcb,{'V_{s} (m/s)'}, 'FontName','Times New Roman','FontSize',10); 182 | set(gcf,'position',[50,50,1000,600]) 183 | print(gcf, './results/vp.png', '-dpng', '-r300'); 184 | 185 | %%%%%%%% Initial arrays %%%%%%%% 186 | seism = zeros(NDIM,rec_n,nt); % seismogram recorded at the receiver 187 | displ_now = zeros(NGLOB, NDIM); % global displacement vector 188 | displ_old_term1 = zeros(NGLOB, NDIM); % global displacement vector 189 | displ_old_term2 = zeros(NGLOB, NDIM); % global displacement vector 190 | displ_old_term3 = zeros(NGLOB, NDIM); % global displacement vector 191 | displ_now_term1 = zeros(NGLOB, NDIM); % global displacement vector 192 | displ_now_term2 = zeros(NGLOB, NDIM); % global displacement vector 193 | displ_now_term3 = zeros(NGLOB, NDIM); % global displacement vector 194 | displ_new_term1 = zeros(NGLOB, NDIM); % global displacement vector 195 | displ_new_term2 = zeros(NGLOB, NDIM); % global displacement vector 196 | displ_new_term3 = zeros(NGLOB, NDIM); % global displacement vector 197 | p_x = zeros(NGLOB, NDIM); 198 | p_z = zeros(NGLOB, NDIM); 199 | energy = zeros(nt,1); 200 | 201 | % start of the time loop 202 | for it = 1 : nt 203 | % compute current time 204 | time = (it-1)*dt; 205 | % compute maximum of norm of displacement from time to time and display it in order to monitor the simulation 206 | if (mod(it,output_step) == 0 || it == 1 || it == nt) 207 | Check_Stability_After(displ_now', NGLOB, it, dt, nt, threshold); 208 | Plot_Wavefield(displ_now', tri_used, geo_xz, rec_xz, src_xz, coord, time, plot_ratio, src_node, rec_node, it); 209 | end 210 | energy(it) = sum(displ_now(:,1).*displ_now(:,1) + displ_now(:,2).*displ_now(:,2)); 211 | % Time evlolution scheme. 212 | displ_new_term1(:,1) = A1_inv.* (M .* p_x(:,1) - Kx1 * displ_now(:,1) - ( Cxx - a2 * M ) .* displ_now_term1(:,1) - ( a0 * M - a1 * 2 * Cx ) .* displ_old_term1(:,1)); 213 | displ_new_term2(:,1) = A2_inv.* ( - Kx2 * displ_now(:,2) - ( Cxz - a2 * M ) .* displ_now_term2(:,1) - ( a0 * M - a1 * (Cx+Cz)) .* displ_old_term2(:,1)); 214 | displ_new_term3(:,1) = A3_inv.* (M .* p_x(:,2) - Kx3 * displ_now(:,1) - ( Czz - a2 * M ) .* displ_now_term3(:,1) - ( a0 * M - a1 * 2 * Cz ) .* displ_old_term3(:,1)); 215 | p_x(:,1) = AL_inv.* ( - Kx4 * displ_now(:,1) - Cx .* p_x(:,1) + 2 * a1 * M .* p_x(:,1)); 216 | p_x(:,2) = AL_inv.* ( - Kx5 * displ_now(:,1) - Cz .* p_x(:,2) + 2 * a1 * M .* p_x(:,2)); 217 | 218 | displ_new_term1(:,2) = A1_inv.* (M .* p_z(:,1) - Kz1 * displ_now(:,2) - ( Cxx - a2 * M ) .* displ_now_term1(:,2) - ( a0 * M - a1 * 2 * Cx ) .* displ_old_term1(:,2)); 219 | displ_new_term2(:,2) = A2_inv.* ( - Kz2 * displ_now(:,1) - ( Cxz - a2 * M ) .* displ_now_term2(:,2) - ( a0 * M - a1 * (Cx+Cz)) .* displ_old_term2(:,2)); 220 | displ_new_term3(:,2) = A3_inv.* (M .* p_z(:,2) - Kz3 * displ_now(:,2) - ( Czz - a2 * M ) .* displ_now_term3(:,2) - ( a0 * M - a1 * 2 * Cz ) .* displ_old_term3(:,2)); 221 | p_z(:,1) = AL_inv.* ( - Kz4 * displ_now(:,2) - Cx .* p_z(:,1) + 2 * a1 * M .* p_z(:,1) ); 222 | p_z(:,2) = AL_inv.* ( - Kz5 * displ_now(:,2) - Cz .* p_z(:,2) + 2 * a1 * M .* p_z(:,2)); 223 | 224 | displ_old_term1 = displ_now_term1; 225 | displ_old_term2 = displ_now_term2; 226 | displ_old_term3 = displ_now_term3; 227 | 228 | displ_now_term1 = displ_new_term1; 229 | displ_now_term2 = displ_new_term2; 230 | displ_now_term3 = displ_new_term3; 231 | displ_now = displ_now_term1 + displ_now_term2 + displ_now_term3; 232 | displ_now(src_node,1) = displ_now(src_node,1) + sin(force_angle*pi/180) * src_wavelet(it); 233 | displ_now(src_node,2) = displ_now(src_node,2) + cos(force_angle*pi/180) * src_wavelet(it); 234 | 235 | 236 | % add the source here 237 | % for j = 1:NGLLZ 238 | % for i = 1:NGLLX 239 | % iglob = ibool(i,j,ispec_source); 240 | % displ_now(iglob,:) = displ_now(iglob,:) - sourcearray(:,i,j)' * src_wavelet(it); 241 | % end 242 | % end 243 | 244 | % displ_new_x = dt * dt * M_inv .* (force_x - (Kx1+Kx3) * displ_now_x - Kx2*displ_now_z) + 2 * displ_now_x - displ_old_x; 245 | % displ_new_z = dt * dt * M_inv .* (force_z - (Kz1+Kz3) * displ_now_z - Kz2*displ_now_x) + 2 * displ_now_z - displ_old_z; 246 | % 247 | % displ_old_x = displ_now_x; 248 | % displ_old_z = displ_now_z; 249 | % 250 | % displ_now_x = displ_new_x; 251 | % displ_now_z = displ_new_z; 252 | 253 | % record a seismogram to check that the simulation went well 254 | seism(:,:,it) = displ_now(rec_node,:)'; 255 | end 256 | 257 | figure 258 | Plot_Trace(rec_xz, t, seism, 1.2, './results/seismgram.png'); 259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SeisFEM 2 | 3 | This project is for our class project for Computational Seismology at USTC. 4 | 5 | The team members include: Haipeng Li, Hongbo Han, and Wancong Zhao. 6 | 7 | I will continue to update this repository for more features later. 8 | 9 | Contact: haipengl@mail.ustc.edu.cn 10 | 11 | ## How to use 12 | 13 | #### For regular mesh, 14 | ```bash 15 | run: Case1_SEM_inner_mesh.m 16 | ``` 17 | #### For irregular mesh: 18 | 19 | ```bash 20 | run: Case2_SEM_use_Gmsh_mesh.m 21 | 22 | Before that, you need to: 23 | 24 | 1. Use the topography data (x and z) to generate mymesh.geo file by running Write_Gmsh.m; 25 | 2. Load the mymesh.geo file into Gmsh and click: Mesh->2D. Then save the mesh by clicking: File->Save Mesh 26 | 3. Run Case2_SEM_use_Gmsh_mesh.m 27 | 28 | Please notice that the order of the mesh generated by Gmsh should be the same with that in the main code. Here, P=4 is used. 29 | ``` 30 | 31 | ## References 32 | ```bash 33 | 1. Pozrikidis, C. (2005). Finite and spectral element methods using Matlab. University of California San Diego, USA. 34 | 2. Caltech Lecture notes: GE 263 – Computational Geophysics The spectral element method by Jean-Paul Ampuero 35 | 3. Specfem2D from: https://github.com/geodynamics/specfem2d 36 | ``` 37 | -------------------------------------------------------------------------------- /Write_Gmsh.m: -------------------------------------------------------------------------------- 1 | clear;clc;close all; 2 | 3 | dx = 100; % approximated element size 4 | xmin = 0.0; 5 | xmax = 4000; 6 | zmin = 0.0; 7 | 8 | topo_z = load('./mesh/topo_data.dat'); 9 | % topo_z = [2000*ones(1,15),topo_z, 2000*ones(1,15)]; 10 | topo_z = topo_z(1:3:end); 11 | topo_z = smooth(topo_z, 4)'; 12 | % topo_z = [4000, 4000]; 13 | topo_x = linspace(xmin, xmax, length(topo_z)); 14 | geo_x = [topo_x, xmax, xmin]; 15 | geo_z = [topo_z, zmin, zmin]; 16 | geo_n = length(geo_x); 17 | figure 18 | scatter(geo_x/1000, geo_z/1000-2,'ro'); hold on; 19 | plot(geo_x/1000, geo_z/1000-2, 'b-', 'LineWidth',2.0); hold on; 20 | plot([xmin/1000, zmin/1000], [geo_x(1)/1000-2 , geo_z(1)/1000-2], 'b-', 'LineWidth',2.0); 21 | xlabel('Distance (m)'); ylabel('Depth (m)'); set(gca,'FontSize', 16); 22 | pbaspect([1 1/1.6443 1]) 23 | 24 | height = max(geo_z) - min(geo_z); 25 | width = max(geo_x) - min(geo_x); 26 | 27 | fp = fopen('./mesh/mymesh.geo','w'); 28 | fprintf(fp, '//Define geometry\n', dx); 29 | fprintf(fp, 'dx=%f;\n', dx); 30 | fprintf(fp, 'height=%f;\n', height); 31 | fprintf(fp, 'width=%f;\n', width); 32 | 33 | for i =1 : geo_n 34 | fprintf(fp, 'Point(%d) = { %f, %f, 0.0, dx};\n', i, geo_x(i), geo_z(i)); 35 | end 36 | 37 | % Topography interface, Line 1 38 | for i = 1 : geo_n - 2 39 | if i ==1 40 | fprintf(fp, '\nLine(1) = {%d, ', i); 41 | elseif i < length(geo_x) - 2 42 | fprintf(fp, '%d, ', i); 43 | else 44 | fprintf(fp, '%d};\n',i); 45 | end 46 | end 47 | fprintf(fp, 'Line(2) = {%d, %d};\n', geo_n - 2, geo_n - 1); 48 | fprintf(fp, 'Line(3) = {%d, %d};\n', geo_n - 1, geo_n ); 49 | fprintf(fp, 'Line(4) = {%d, %d};\n', geo_n , 1 ); 50 | 51 | fprintf(fp, '\nTransfinite Line {4, 2} = Ceil(height/dx) Using Progression 1;\n'); 52 | fprintf(fp, 'Transfinite Line {1, 3} = Ceil(width/dx) Using Progression 1;\n'); 53 | 54 | fprintf(fp, '\nLine Loop(1) = {1, 2, 3, 4};\n'); 55 | fprintf(fp, 'Plane Surface(2) = {1};\n'); 56 | fprintf(fp, 'Transfinite Surface {2};\n'); 57 | fprintf(fp, 'Recombine Surface {2};\n'); 58 | 59 | fprintf(fp, '\n// quads mesh;\n'); 60 | fprintf(fp, 'Mesh.SubdivisionAlgorithm = 1;\n'); 61 | % 4-node element, it should be the same with polynomial degree (inside each element, along each direction) 62 | fprintf(fp, 'Mesh.ElementOrder = %d;\n', 4); 63 | fclose(fp); 64 | % More advanced meshing is under construction 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /figures/PML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/figures/PML.png -------------------------------------------------------------------------------- /figures/Topo-Zinc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/figures/Topo-Zinc.png -------------------------------------------------------------------------------- /figures/Topo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/figures/Topo.png -------------------------------------------------------------------------------- /figures/model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/figures/model.png -------------------------------------------------------------------------------- /figures/waveforms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/figures/waveforms.png -------------------------------------------------------------------------------- /mesh/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/mesh/.DS_Store -------------------------------------------------------------------------------- /mesh/Mesh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/mesh/Mesh.jpg -------------------------------------------------------------------------------- /mesh/Mesh2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haipeng-ustc/SeisSEM/a49e6acdcb574d72e8cc5c948cf62dfb02626c6a/mesh/Mesh2.jpg -------------------------------------------------------------------------------- /mesh/mymesh.geo: -------------------------------------------------------------------------------- 1 | //Define geometry 2 | dx=100.000000; 3 | height=2433.825000; 4 | width=4000.000000; 5 | Point(1) = { 0.000000, 2000.000000, 0.0, dx}; 6 | Point(2) = { 153.846154, 2087.760400, 0.0, dx}; 7 | Point(3) = { 307.692308, 2125.393733, 0.0, dx}; 8 | Point(4) = { 461.538462, 2152.633333, 0.0, dx}; 9 | Point(5) = { 615.384615, 2222.812500, 0.0, dx}; 10 | Point(6) = { 769.230769, 2293.512500, 0.0, dx}; 11 | Point(7) = { 923.076923, 2327.991667, 0.0, dx}; 12 | Point(8) = { 1076.923077, 2366.145833, 0.0, dx}; 13 | Point(9) = { 1230.769231, 2382.812500, 0.0, dx}; 14 | Point(10) = { 1384.615385, 2383.333333, 0.0, dx}; 15 | Point(11) = { 1538.461538, 2325.000000, 0.0, dx}; 16 | Point(12) = { 1692.307692, 2266.666667, 0.0, dx}; 17 | Point(13) = { 1846.153846, 2239.062500, 0.0, dx}; 18 | Point(14) = { 2000.000000, 2222.395833, 0.0, dx}; 19 | Point(15) = { 2153.846154, 2225.000000, 0.0, dx}; 20 | Point(16) = { 2307.692308, 2227.604167, 0.0, dx}; 21 | Point(17) = { 2461.538462, 2221.875000, 0.0, dx}; 22 | Point(18) = { 2615.384615, 2224.594900, 0.0, dx}; 23 | Point(19) = { 2769.230769, 2232.801167, 0.0, dx}; 24 | Point(20) = { 2923.076923, 2290.197000, 0.0, dx}; 25 | Point(21) = { 3076.923077, 2380.572933, 0.0, dx}; 26 | Point(22) = { 3230.769231, 2433.825000, 0.0, dx}; 27 | Point(23) = { 3384.615385, 2418.955200, 0.0, dx}; 28 | Point(24) = { 3538.461538, 2356.588533, 0.0, dx}; 29 | Point(25) = { 3692.307692, 2260.546867, 0.0, dx}; 30 | Point(26) = { 3846.153846, 2161.944433, 0.0, dx}; 31 | Point(27) = { 4000.000000, 2039.583300, 0.0, dx}; 32 | Point(28) = { 4000.000000, 0.000000, 0.0, dx}; 33 | Point(29) = { 0.000000, 0.000000, 0.0, dx}; 34 | 35 | Line(1) = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27}; 36 | Line(2) = {27, 28}; 37 | Line(3) = {28, 29}; 38 | Line(4) = {29, 1}; 39 | 40 | Transfinite Line {4, 2} = Ceil(height/dx) Using Progression 1; 41 | Transfinite Line {1, 3} = Ceil(width/dx) Using Progression 1; 42 | 43 | Line Loop(1) = {1, 2, 3, 4}; 44 | Plane Surface(2) = {1}; 45 | Transfinite Surface {2}; 46 | Recombine Surface {2}; 47 | 48 | // quads mesh; 49 | Mesh.SubdivisionAlgorithm = 1; 50 | Mesh.ElementOrder = 4; 51 | -------------------------------------------------------------------------------- /mesh/topo_data.dat: -------------------------------------------------------------------------------- 1 | 2.0000000e+03 2.0585938e+03 2.1062500e+03 2.1382812e+03 2.1500000e+03 2.1421875e+03 2.1250000e+03 2.1078125e+03 2.1000000e+03 2.1129000e+03 2.1444000e+03 2.1837000e+03 2.2200000e+03 2.2578625e+03 2.3006000e+03 2.3355375e+03 2.3500000e+03 2.3421875e+03 2.3250000e+03 2.3078125e+03 2.3000000e+03 2.3234375e+03 2.3750000e+03 2.4265625e+03 2.4500000e+03 2.4375000e+03 2.4083333e+03 2.3750000e+03 2.3500000e+03 2.3359375e+03 2.3250000e+03 2.3140625e+03 2.3000000e+03 2.2750000e+03 2.2416667e+03 2.2125000e+03 2.2000000e+03 2.2078125e+03 2.2250000e+03 2.2421875e+03 2.2500000e+03 2.2421875e+03 2.2250000e+03 2.2078125e+03 2.2000000e+03 2.2078125e+03 2.2250000e+03 2.2421875e+03 2.2500000e+03 2.2421875e+03 2.2250000e+03 2.2078125e+03 2.2000000e+03 2.2044271e+03 2.2159722e+03 2.2320312e+03 2.2500000e+03 2.2746188e+03 2.3084278e+03 2.3455229e+03 2.3800000e+03 2.4163000e+03 2.4556000e+03 2.4871000e+03 2.5000000e+03 2.4800781e+03 2.4343750e+03 2.3839844e+03 2.3500000e+03 2.3353906e+03 2.3256250e+03 2.3155469e+03 2.3000000e+03 2.2637500e+03 2.2066667e+03 2.1462500e+03 2.1000000e+03 2.0679688e+03 2.0395833e+03 2.0164062e+03 2.0000000e+03 2 | -------------------------------------------------------------------------------- /src/Assemble_Global_Jacobian.m: -------------------------------------------------------------------------------- 1 | function [coord, xix, xiz, gammax, gammaz, jacobian]= Assemble_Global_Jacobian(ibool,coorg,knods,NGLLX,NGLLZ) 2 | 3 | if NGLLX ~=NGLLZ 4 | error('NGLLX is not the same with NGLLZ'); 5 | end 6 | 7 | 8 | [xigll,wxgll,hprime_xx, hprimewgll_xx] = GetGLL(NGLLX); 9 | [zigll,wzgll,hprime_zz, hprimewgll_zz] = GetGLL(NGLLZ); 10 | 11 | % These parameters are the same with the main function. 12 | ngnod = size(knods,1); 13 | NSPEC = size(ibool,3); 14 | NDIM = size(coorg,1); 15 | NGLOB = max(ibool(:)); 16 | 17 | coord = zeros(NDIM,NGLOB); % set the coordinates of the points of the global grid 18 | xix = zeros(NGLLX, NGLLZ, NSPEC); 19 | xiz = zeros(NGLLX, NGLLZ, NSPEC); 20 | gammax = zeros(NGLLX, NGLLZ, NSPEC); 21 | gammaz = zeros(NGLLX, NGLLZ, NSPEC); 22 | jacobian = zeros(NGLLX, NGLLZ, NSPEC); 23 | 24 | for ispec = 1:NSPEC 25 | for j = 1:NGLLZ 26 | for i = 1:NGLLX 27 | 28 | xi = xigll(i); 29 | gamma = zigll(j); 30 | 31 | % recompute jacobian for any (xi,gamma) point, not necessarily a GLL point 32 | 33 | % create the 2D shape functions and then the Jacobian 34 | [shape2D, dershape2D] = Shape_Functions(xi,gamma,ngnod,NDIM); 35 | 36 | % compute coordinates and jacobian matrix 37 | x = 0.0; 38 | z = 0.0; 39 | 40 | xxi = 0.0; 41 | zxi = 0.0; 42 | xgamma = 0.0; 43 | zgamma = 0.0; 44 | 45 | for ia=1:ngnod 46 | 47 | nnum = knods(ia,ispec); 48 | 49 | xelm = coorg(1,nnum); 50 | zelm = coorg(2,nnum); 51 | 52 | x = x + shape2D(ia)*xelm; 53 | z = z + shape2D(ia)*zelm; 54 | 55 | xxi = xxi + dershape2D(1,ia)*xelm; 56 | zxi = zxi + dershape2D(1,ia)*zelm; 57 | xgamma = xgamma + dershape2D(2,ia)*xelm; 58 | zgamma = zgamma + dershape2D(2,ia)*zelm; 59 | 60 | end 61 | jacobianl = xxi*zgamma - xgamma*zxi; 62 | 63 | if (jacobianl <= 0.d0) 64 | % If the Jacobian is negative, it means that there is an error in the mesh 65 | % print the coordinates of the mesh points of this element 66 | fprintf('ispec = %d\n', ispec); 67 | fprintf('ngnod = %d\n', ngnod); 68 | for ia=1:ngnod 69 | nnum = knods(ia,ispec); 70 | xelm = coorg(1,nnum); 71 | zelm = coorg(2,nnum); 72 | fprintf('node %d, at numeber %d, (x,y) = %f, %f\n', ia,nnum,xelm,zelm); 73 | end 74 | error('error: negative 2D Jacobian found'); 75 | end 76 | 77 | % invert the relation 78 | xixl = zgamma / jacobianl; 79 | gammaxl = - zxi / jacobianl; 80 | xizl = - xgamma / jacobianl; 81 | gammazl = xxi / jacobianl; 82 | 83 | % assign to global array 84 | coord(1,ibool(i,j,ispec)) = x; 85 | coord(2,ibool(i,j,ispec)) = z; 86 | 87 | xix(i,j,ispec) = xixl; 88 | xiz(i,j,ispec) = xizl; 89 | gammax(i,j,ispec) = gammaxl; 90 | gammaz(i,j,ispec) = gammazl; 91 | jacobian(i,j,ispec) = jacobianl; 92 | 93 | end 94 | end 95 | end 96 | 97 | end -------------------------------------------------------------------------------- /src/Assemble_Global_K.m: -------------------------------------------------------------------------------- 1 | function [Kx1, Kx2, Kx3, Kx4, Kx5, Kz1, Kz2, Kz3, Kz4, Kz5] = Assemble_Global_K(NGLOB, NGLLX, NGLLZ, jacobian, gammax, gammaz, xix, xiz, ibool, ... 2 | c11, c13, c33, c44, pml_dxx, pml_dzz) 3 | 4 | %-------------------------------------- 5 | % Element wise local stiffness matrix: 6 | %-------------------------------------- 7 | %% Stiffness matrix 8 | % K1 dphi_dx * dphi_dx 9 | % K2 dphi_dz * dphi_dz 10 | % K3 dphi_dx * dphi_dz 11 | % K4 dphi_dz * dphi_dx 12 | % K5 phi * dphi_dx 13 | % K6 phi * dphi_dz 14 | 15 | %%%%%%% Set up GLL points, weights and derivation matrices %%%%%%%% 16 | 17 | [xigll,wxgll,hprime_xx, hprimewgll_xx] = GetGLL(NGLLX); 18 | [zigll,wzgll,hprime_zz, hprimewgll_zz] = GetGLL(NGLLZ); 19 | 20 | NGLL = NGLLX; 21 | NSPEC = size(jacobian,3); 22 | % Stiffness matrix for temporary use 23 | K_ele_temp1 = zeros(NGLLX,NGLLZ,NGLLX,NGLLZ); 24 | K_ele_temp2 = zeros(NGLLX,NGLLZ,NGLLX,NGLLZ); 25 | K_ele_temp3 = zeros(NGLLX,NGLLZ,NGLLX,NGLLZ); 26 | K_ele_temp4 = zeros(NGLLX,NGLLZ,NGLLX,NGLLZ); 27 | K_ele_temp5 = zeros(NGLLX,NGLLZ,NGLLX,NGLLZ); 28 | K_ele_temp6 = zeros(NGLLX,NGLLZ,NGLLX,NGLLZ); 29 | % Stiffness matrix for each element 30 | Ke1 = zeros(NGLLX*NGLLZ,NGLLX*NGLLZ); 31 | Ke2 = zeros(NGLLX*NGLLZ,NGLLX*NGLLZ); 32 | Ke3 = zeros(NGLLX*NGLLZ,NGLLX*NGLLZ); 33 | Ke4 = zeros(NGLLX*NGLLZ,NGLLX*NGLLZ); 34 | Ke5 = zeros(NGLLX*NGLLZ,NGLLX*NGLLZ); 35 | Ke6 = zeros(NGLLX*NGLLZ,NGLLX*NGLLZ); 36 | % Stiffness Matrix assembly 37 | I = zeros(length(ibool(:)),1); 38 | J = zeros(length(ibool(:)),1); 39 | V1 = zeros(length(ibool(:)),1); 40 | V2 = zeros(length(ibool(:)),1); 41 | V3 = zeros(length(ibool(:)),1); 42 | V4 = zeros(length(ibool(:)),1); 43 | V5 = zeros(length(ibool(:)),1); 44 | V6 = zeros(length(ibool(:)),1); 45 | 46 | ct = 1; 47 | delta = eye(NGLL); % identity matrix: kronecker delta 48 | for ispec = 1:NSPEC 49 | K_ele_temp1(:) = 0.; 50 | K_ele_temp2(:) = 0.; 51 | K_ele_temp3(:) = 0.; 52 | K_ele_temp4(:) = 0.; 53 | K_ele_temp5(:) = 0.; 54 | K_ele_temp6(:) = 0.; 55 | 56 | for i = 1:NGLLZ 57 | for j = 1:NGLLX 58 | for k = 1:NGLLZ 59 | for l = 1:NGLLX 60 | term1 = 0.0; % K1: phi_xx * phi_xx 61 | term2 = 0.0; % K2: phi_zz * phi_zz 62 | term3 = 0.0; % K3: phi_xx * phi_zz 63 | term4 = 0.0; % K4: phi_zz * phi_xx 64 | term5 = 0.0; % K5: phi * phi_xx 65 | term6 = 0.0; % K6: phi * phi_zz 66 | 67 | for p = 1:NGLLX 68 | for q = 1 : NGLLX 69 | term1 = term1 + wxgll(p) * wzgll(q) * jacobian(p,q,ispec) * ... 70 | ((hprime_xx(i,p) * delta(j,q) * xix(p,q,ispec) + delta(i,p) * hprime_zz(j,q) * gammax(p,q,ispec)) * ... 71 | (hprime_xx(k,p) * delta(l,q) * xix(p,q,ispec) + delta(k,p) * hprime_zz(l,q) * gammax(p,q,ispec))); 72 | term2 = term2 + wxgll(p) * wzgll(q) * jacobian(p,q,ispec) * ... 73 | ((hprime_xx(i,p) * delta(j,q) * xiz(p,q,ispec) + delta(i,p) * hprime_zz(j,q) * gammaz(p,q,ispec)) * ... 74 | (hprime_xx(k,p) * delta(l,q) * xiz(p,q,ispec) + delta(k,p) * hprime_zz(l,q) * gammaz(p,q,ispec))); 75 | term3 = term3 + wxgll(p) * wzgll(q) * jacobian(p,q,ispec) * ... 76 | ((hprime_xx(i,p) * delta(j,q) * xix(p,q,ispec) + delta(i,p) * hprime_zz(j,q) * gammax(p,q,ispec)) * ... 77 | (hprime_xx(k,p) * delta(l,q) * xiz(p,q,ispec) + delta(k,p) * hprime_zz(l,q) * gammaz(p,q,ispec))); 78 | term4 = term4 + wxgll(p) * wzgll(q) * jacobian(p,q,ispec) * ... 79 | ((hprime_xx(i,p) * delta(j,q) * xiz(p,q,ispec) + delta(i,p) * hprime_zz(j,q) * gammaz(p,q,ispec)) * ... 80 | (hprime_xx(k,p) * delta(l,q) * xix(p,q,ispec) + delta(k,p) * hprime_zz(l,q) * gammax(p,q,ispec))); 81 | term5 = term5 + wxgll(p) * wzgll(q) * jacobian(p,q,ispec) * ... 82 | ((hprime_xx(i,p) * delta(j,q) * xix(p,q,ispec) + delta(i,p) * hprime_zz(j,q) * gammax(p,q,ispec)) * delta(k,p) * delta(l,q)); 83 | term6 = term6 + wxgll(p) * wzgll(q) * jacobian(p,q,ispec) * ... 84 | ((hprime_xx(i,p) * delta(j,q) * xiz(p,q,ispec) + delta(i,p) * hprime_zz(j,q) * gammaz(p,q,ispec)) * delta(k,p) * delta(l,q)); 85 | end 86 | end 87 | K_ele_temp1(i,j,k,l) = term1; 88 | K_ele_temp2(i,j,k,l) = term2; 89 | K_ele_temp3(i,j,k,l) = term3; 90 | K_ele_temp4(i,j,k,l) = term4; 91 | K_ele_temp5(i,j,k,l) = term5; 92 | K_ele_temp6(i,j,k,l) = term6; 93 | 94 | end 95 | end 96 | end 97 | end 98 | 99 | Ke1(:,:) = reshape(K_ele_temp1, NGLL*NGLL,NGLL*NGLL); 100 | Ke2(:,:) = reshape(K_ele_temp2, NGLL*NGLL,NGLL*NGLL); 101 | Ke3(:,:) = reshape(K_ele_temp3, NGLL*NGLL,NGLL*NGLL); 102 | Ke4(:,:) = reshape(K_ele_temp4, NGLL*NGLL,NGLL*NGLL); 103 | Ke5(:,:) = reshape(K_ele_temp5, NGLL*NGLL,NGLL*NGLL); 104 | Ke6(:,:) = reshape(K_ele_temp6, NGLL*NGLL,NGLL*NGLL); 105 | 106 | % Assembly: I,J,V are such that K(I,J) = V 107 | ig = ibool(:,:,ispec); 108 | ig = ig(:); 109 | for j = 1:length(ig) 110 | for i = 1:length(ig) 111 | I(ct) = ig(i); 112 | J(ct) = ig(j); 113 | V1(ct) = Ke1(i,j); 114 | V2(ct) = Ke2(i,j); 115 | V3(ct) = Ke3(i,j); 116 | V4(ct) = Ke4(i,j); 117 | V5(ct) = Ke5(i,j); 118 | V6(ct) = Ke6(i,j); 119 | 120 | ct = ct + 1; 121 | end 122 | end 123 | end 124 | % Faster assembly as SparseCSC format 125 | K1 = sparse(I,J,V1,NGLOB,NGLOB); 126 | K2 = sparse(I,J,V2,NGLOB,NGLOB); 127 | K3 = sparse(I,J,V3,NGLOB,NGLOB); 128 | K4 = sparse(I,J,V4,NGLOB,NGLOB); 129 | K5 = sparse(I,J,V5,NGLOB,NGLOB); 130 | K6 = sparse(I,J,V6,NGLOB,NGLOB); 131 | 132 | %% Stiffness matrix 133 | % Kx1 = c11 * dphi_dx * dphi_dx 134 | % Kx2 = c13 * dphi_dx * dphi_dz + c44 * dphi_dz * dphi_dx ?? 135 | % Kx3 = c44 * dphi_dz * dphi_dz 136 | % Kx4 = c11 * phi * dphi_dx * pml_dxx 137 | % Kx5 = c44 * phi * dphi_dz * pml_dzz 138 | % Kz1 = c44 * dphi_dx * dphi_dx 139 | % Kz2 = c44 * dphi_dx * dphi_dz + c13 * dphi_dz * dphi_dx ?? 140 | % Kz3 = c33 * dphi_dz * dphi_dz 141 | % Kz4 = c44 * phi * dphi_dx * pml_dxx 142 | % Kz5 = c33 * phi * dphi_dz * pml_dzz 143 | 144 | Kx1 = K1 .* c11; 145 | Kx2 = K3 .* c13 + K4 .* c44; 146 | Kx3 = K2 .* c44; 147 | Kx4 = K5 .* c11 .* pml_dxx; 148 | Kx5 = K6 .* c44 .* pml_dzz; 149 | 150 | Kz1 = K1 .* c44; 151 | Kz2 = K3 .* c44 + K4 .* c13; 152 | Kz3 = K2 .* c33; 153 | Kz4 = K5 .* c44 .* pml_dxx; 154 | Kz5 = K6 .* c33 .* pml_dzz; 155 | 156 | end -------------------------------------------------------------------------------- /src/Assemble_Global_M_and_C.m: -------------------------------------------------------------------------------- 1 | function [M, Cx, Cz, Cxx, Cxz, Czz] = Assemble_Global_M_and_C(NSPEC, NGLOB, NGLLX, NGLLZ, jacobian, ibool, rho, pml_dx, pml_dz) 2 | 3 | %% Mass matrix 4 | % M = rho * phi * phi 5 | %% Damping matrix 6 | % Cx = rho * phi * phi * pml_dx 7 | % Cz = rho * phi * phi * pml_dz 8 | % Cxx = rho * phi * phi * pml_dx * pml_dx 9 | % Cxz = rho * phi * phi * pml_dx * pml_dz 10 | % Czz = rho * phi * phi * pml_dz * pml_dz 11 | 12 | [xigll,wxgll,hprime_xx, hprimewgll_xx] = GetGLL(NGLLX); 13 | [zigll,wzgll,hprime_zz, hprimewgll_zz] = GetGLL(NGLLZ); 14 | 15 | M = zeros(NGLOB, 1); 16 | for ispec = 1:NSPEC 17 | for j = 1:NGLLZ 18 | for i = 1:NGLLX 19 | iglob = ibool(i,j,ispec); 20 | M(iglob) = M(iglob) + wxgll(i)* wzgll(j) * jacobian(i,j,ispec); 21 | end 22 | end 23 | end 24 | 25 | M = M .* rho; 26 | Cx = M .* pml_dx; 27 | Cz = M .* pml_dz; 28 | Cxx = Cx .* pml_dx; 29 | Cxz = Cx .* pml_dz; 30 | Czz = Cz .* pml_dz; 31 | 32 | 33 | end 34 | -------------------------------------------------------------------------------- /src/Check_Stability_After.m: -------------------------------------------------------------------------------- 1 | function Check_Stability_After(displ, NGLOB, it, deltat, NSTEP, STABILITY_THRESHOLD) 2 | 3 | Usolidnorm = -1.0; 4 | for iglob = 1:NGLOB 5 | current_value = sqrt(displ(1,iglob)^2 + displ(2,iglob)^2); 6 | if (current_value > Usolidnorm) 7 | Usolidnorm = current_value; 8 | end 9 | end 10 | fprintf('Time step %6d out of %d\n',it,NSTEP); 11 | % compute current time 12 | time = (it-1)*deltat; 13 | % check stability of the code, exit if unstable 14 | if (Usolidnorm > STABILITY_THRESHOLD || Usolidnorm < 0) 15 | fprintf('Max norm of displacement is = %f\n',Usolidnorm); 16 | error('The SEM code became unstable and blew up.'); 17 | end 18 | end -------------------------------------------------------------------------------- /src/Check_Stability_Before.m: -------------------------------------------------------------------------------- 1 | function Check_Stability_Before(dt, f0, xmin, xmax, zmin, zmax, nelem_x, nelem_z, NGLLX, NGLLZ, vp, vs) 2 | 3 | 4 | 5 | % define some values 6 | CFL = 0.6; % stability number, sqrt(3.0/8.0) 7 | sample_num = 10; % samping points in the average wavelength 8 | 9 | % average grid size 10 | x_average = (xmax - xmin) /(nelem_x*(NGLLX-1) + 1); 11 | z_average = (zmax - zmin) /(nelem_z*(NGLLZ-1) + 1); 12 | dx = max(x_average, z_average); 13 | 14 | % velocity. 15 | v_min = min(min(vs(vs>0)), min(vp(:))); 16 | v_max = max(vp(:)); 17 | 18 | % maximum frequency. 19 | fmax = v_min / dx / sample_num; 20 | if f0 > fmax 21 | fprintf('\n'); 22 | fprintf('Error: The frequency of source wavelet could cause numerical dispersion.\n'); 23 | fprintf('Set frequency no more than %.2f Hz.\n', fmax); 24 | error('Source requency parameters error'); 25 | end 26 | 27 | % maximum time step. 28 | dtmax = CFL* dx/v_max; 29 | if dt > dtmax 30 | fprintf('\n'); 31 | fprintf('Error: The time step is too large and the simulation could become unstable.\n'); 32 | fprintf('Set time step no more than %f s\n', dtmax); 33 | error('Time step error'); 34 | end 35 | 36 | 37 | 38 | % we need NGLLX == NGLLZ. 39 | if NGLLX ~= NGLLZ 40 | error('NGLLX is not same as NGLLZ.\n'); 41 | end 42 | 43 | 44 | 45 | end -------------------------------------------------------------------------------- /src/Find_Nearest_Node.m: -------------------------------------------------------------------------------- 1 | %FindNearestNode finds the nearest mesh node to a requested location (2D) 2 | 3 | function [xz_out,iglob,dist] = FindNearestNode(xz_in, coord) 4 | 5 | 6 | n = size(xz_in,2); 7 | dist = zeros(n,1); 8 | iglob = zeros(n,1); 9 | 10 | for k=1:n 11 | [dist(k),iglob(k)] = min( (coord(1,:)-xz_in(1,k)).^2+(coord(2,:)-xz_in(2,k)).^2 ); 12 | end 13 | 14 | dist = sqrt(dist); 15 | xz_out = coord(:,iglob); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /src/GetGLL.m: -------------------------------------------------------------------------------- 1 | 2 | function [x,w,h,hw]=GetGLL(ngll) 3 | 4 | % x: Gauss-Lobatto-Legendre points, 5 | % w: weights 6 | % h: derivatives of Lagrange polynomials, H_ij = h'_i(xgll(j)) 7 | % hw: h * w 8 | 9 | name = sprintf('gll_library/%s_%0.2u.tab','gll',ngll); 10 | % get full path 11 | pathstr = fileparts(mfilename('fullpath')); 12 | name = fullfile(pathstr,name); 13 | 14 | if ~exist(name,'file') 15 | error(sprintf('Data file %s does not exist',name)) 16 | end 17 | 18 | fid=fopen(name); 19 | data=fscanf(fid,'%f',[ngll,ngll+2]); 20 | fclose(fid); 21 | 22 | x=data(:,1); 23 | w=data(:,2); 24 | h=data(:,3:end)'; % tranpose is Very important 25 | 26 | hw = zeros(ngll, ngll); 27 | for k1 = 1:ngll 28 | for k2 = 1:ngll 29 | hw(k2,k1) = w(k2) * h(k2,k1); 30 | end 31 | end 32 | 33 | end -------------------------------------------------------------------------------- /src/Get_California_Model.m: -------------------------------------------------------------------------------- 1 | function [vp_model, vs_model, rho_model] = Get_California_Model(depth_in_m) 2 | if depth_in_m >= 0.0 3 | depth_in_m = 0.0; 4 | else 5 | depth_in_m = - depth_in_m; 6 | end 7 | 8 | thick = [ 0.2, 0.03, 10.3, 11.66, 10.36, 300] * 1000; 9 | vp = [3.81, 2.50, 6.10, 6.51, 6.90, 7.5] * 1000; 10 | vs = [1.94, 1.07, 3.53, 3.71, 3.93, 4.5] * 1000; 11 | rho = [0.92, 2.11, 2.74, 2.83, 2.92, 3.0] * 1000; 12 | depth_layer = zeros(size(thick)); 13 | for i = 1 : length(thick) 14 | depth_layer(i) = sum(thick(1:i)); 15 | end 16 | layer_index = min(find(depth_in_m < depth_layer(:))); 17 | vp_model = vp(layer_index); 18 | vs_model = vs(layer_index); 19 | rho_model = rho(layer_index); 20 | 21 | end -------------------------------------------------------------------------------- /src/Get_Layer_Model.m: -------------------------------------------------------------------------------- 1 | function [vp_model, vs_model, rho_model] = Get_Layer_Model(depth_in_m) 2 | depth_in_m = depth_in_m - 2000; 3 | if depth_in_m >= 0.0 4 | depth_in_m = 0.0; 5 | else 6 | depth_in_m = - depth_in_m; 7 | end 8 | 9 | thick = [0.2, 0.5, 1.0, 1.5, 2.0] * 1000; 10 | vp = [3.5, 4.5, 5.5, 6.5, 7.0] * 1000; 11 | vs = vp/1.732; 12 | rho = [0.92, 2.11, 2.74, 2.83, 2.92] * 1000; 13 | depth_layer = zeros(size(thick)); 14 | for i = 1 : length(thick) 15 | depth_layer(i) = sum(thick(1:i)); 16 | end 17 | layer_index = min(find(depth_in_m < depth_layer(:))); 18 | vp_model = vp(layer_index); 19 | vs_model = vs(layer_index); 20 | rho_model = rho(layer_index); 21 | 22 | end -------------------------------------------------------------------------------- /src/Lagrange_Any.m: -------------------------------------------------------------------------------- 1 | function [h,hprime] = Lagrange_Any(xi,NGLL,xigll) 2 | % subroutine to compute the Lagrange interpolants based upon the interpolation points 3 | % and their first derivatives at any point xi in [-1,1] 4 | 5 | h = zeros(NGLL, 1); 6 | hprime = zeros(NGLL, 1); 7 | 8 | for dgr = 1:NGLL 9 | prod1 = 1.0; 10 | prod2 = 1.0; 11 | % lagrangian interpolants 12 | x0 = xigll(dgr); 13 | for i = 1:NGLL 14 | if (i ~= dgr) 15 | x = xigll(i); 16 | prod1 = prod1*(xi-x); 17 | prod2 = prod2*(x0-x); 18 | end 19 | end 20 | 21 | % takes inverse to avoid additional divisions (multiplications are cheaper than divisions) 22 | prod2_inv = 1.0/prod2; 23 | h(dgr) = prod1 * prod2_inv; 24 | 25 | % first derivatives 26 | sum = 0.0; 27 | for i = 1: NGLL 28 | if (i ~= dgr) 29 | prod3 = 1.0; 30 | for j = 1:NGLL 31 | if (j ~= dgr && j ~= i) 32 | prod3 = prod3*(xi-xigll(j)); 33 | end 34 | sum = sum + prod3; 35 | end 36 | end 37 | hprime(dgr) = sum * prod2_inv; 38 | end 39 | end 40 | end -------------------------------------------------------------------------------- /src/MeshBox.m: -------------------------------------------------------------------------------- 1 | % [iglob,x,y]=MeshBox(LX,LY,NELX,NELY,XGLL) 2 | % 3 | % PURPOSE: 4 | % Generates a Spectral Element mesh for a rectangular box, 5 | % elements and their internal Gauss-Lobatto-Legendre (GLL) sub-grids. 6 | % 7 | % INPUT: 8 | % LX x-length of the box 9 | % LY y-length of the box 10 | % NELX number of elements along x 11 | % NELY number of elements along y 12 | % NGLL number of GLL nodes (polynomial degree +1) 13 | % 14 | % OUTPUT: 15 | % iglob(NGLL,NGLL,NELX*NELY) maps the local numbering of the 16 | % computational nodes to their global (non-redundant) numbering. 17 | % I = iglob(i,j,e) is the global node index of the (i,j)-th GLL 18 | % node internal to the e-th element 19 | % Elements are numbered row by row from bottom-left to top-right. 20 | % The table iglob is tipically needed to build or assemble 21 | % global data from local data (contributions from each element) 22 | % x(:) global x-coordinates of the GLL nodes, start at 0 23 | % y(:) global y-coordinates of the GLL nodes, start at 0 24 | % 25 | function [iglob,coorg]=MeshBox(xmin,xmax,zmin,zmax,nelem_x,nelem_z,nglob,NGLL) 26 | 27 | 28 | dx = (xmax-xmin)/nelem_x; 29 | dy = (zmax-zmin)/nelem_z; 30 | 31 | XGLL = GetGLL(NGLL); 32 | iglob = zeros(NGLL,NGLL,nelem_x*nelem_z); % local to global index mapping 33 | x = zeros(nglob,1); % coordinates of GLL nodes 34 | y = zeros(nglob,1); 35 | 36 | e=0; 37 | last_iglob = 0; 38 | igL = reshape([1:NGLL*(NGLL-1)],NGLL-1,NGLL); 39 | igB = reshape([1:NGLL*(NGLL-1)],NGLL,NGLL-1); 40 | igLB = reshape([1:(NGLL-1)*(NGLL-1)],NGLL-1,NGLL-1); 41 | xgll = repmat( 0.5*(1+XGLL) , 1,NGLL); 42 | ygll = dy*xgll'; 43 | xgll = dx*xgll; 44 | 45 | for ey=1:nelem_z 46 | for ex=1:nelem_x 47 | e = e+1; 48 | % Take care of redundant nodes at element edges : 49 | if e==1 % first element: bottom-left 50 | ig = reshape([1:NGLL*NGLL],NGLL,NGLL); 51 | else 52 | if ey==1 % elements on first (bottom) row 53 | ig(1,:) = iglob(NGLL,:,e-1); % left edge 54 | ig(2:NGLL,:) = last_iglob + igL; % the rest 55 | elseif ex==1 % elements on first (left) column 56 | ig(:,1) = iglob(:,NGLL,e-nelem_x); % bottom edge 57 | ig(:,2:NGLL) = last_iglob + igB; % the rest 58 | else % other elements 59 | ig(1,:) = iglob(NGLL,:,e-1); % left edge 60 | ig(:,1) = iglob(:,NGLL,e-nelem_x); % bottom edge 61 | ig(2:NGLL,2:NGLL) = last_iglob + igLB; 62 | end 63 | end 64 | iglob(:,:,e) = ig; 65 | last_iglob = ig(NGLL,NGLL); 66 | % Global coordinates of the computational (GLL) nodes 67 | x(ig) = dx*(ex-1)+xgll; 68 | y(ig) = dy*(ey-1)+ygll; 69 | 70 | end 71 | 72 | coorg=[x,y]; 73 | end 74 | 75 | -------------------------------------------------------------------------------- /src/Mesh_Geometry.m: -------------------------------------------------------------------------------- 1 | function [node_xz, element_node] = Mesh_Geometry(xmin, xmax, zmin, zmax, Nx, Nz, type) 2 | 3 | % I ELEMENT_TYPE Definition 4 | % - ------------ ---------- 5 | % 1 T3 3 node linear triangle; 6 | % 2 T6 6 node quadratic triangle; 7 | % 3 T10 10 node cubic triangle. 8 | % 4 Q4 4 node linear Lagrange/serendipity quadrilateral; 9 | % 5 Q9 9 node quadratic Lagrange quadrilateral; 10 | % 6 Q16 16 node cubic Lagrange quadrilateral; 11 | 12 | % Geometrical points that describe the mesh: 13 | % node_xz: coordinates of all the corners of the mesh elements 14 | % element_node: numbering of the four corners of each mesh element 15 | 16 | 17 | 18 | if ~strcmp(type, 'q4' ) 19 | error('Set type as q4, other mesh is under construction ...'); 20 | end 21 | 22 | if (strcmp(type, 't3' )) 23 | 24 | % 25 | % T3 Grid: 26 | % 27 | % 9---10---11---12 28 | % |\ 8 |\10 |\12 | 29 | % | \ | \ | \ | 30 | % | \ | \ | \ | 31 | % | 7\| 9\| 11\| 32 | % 5----6----7----8 33 | % |\ 2 |\ 4 |\ 6 | 34 | % | \ | \ | \ | 35 | % | \ | \ | \ | 36 | % | 1\| 3\| 5\| 37 | % 1----2----3----4 38 | % 39 | Node_num = (Nx + 1) * (Nz + 1); 40 | 41 | Element_num = 2 * Nx * Nz; 42 | 43 | element = 1; 44 | for j = 1 : Nz 45 | for i = 1 : Nx 46 | 47 | sw = i + ( j - 1 ) * ( Nx + 1 ); 48 | se = i + 1 + ( j - 1 ) * ( Nx + 1 ); 49 | nw = i + j * ( Nx + 1 ); 50 | ne = i + 1 + j * ( Nx + 1 ); 51 | 52 | element_node(element, 1) = sw; 53 | element_node(element, 2) = se; 54 | element_node(element, 3) = nw; 55 | element = element + 1; 56 | 57 | element_node(element, 1) = ne; 58 | element_node(element, 2) = nw; 59 | element_node(element, 3) = se; 60 | element = element + 1; 61 | 62 | end 63 | end 64 | 65 | for j = 1 : Nz + 1 66 | for i = 1 : Nx + 1 67 | 68 | node_xz(i + (j-1) * (Nx + 1), 1 ) = ((Nx - i + 1) * xmin + ( i - 1 )*xmax) / (1.0 * Nx); 69 | node_xz(i + (j-1) * (Nx + 1), 2 ) = ((Nz - j + 1) * zmin + ( j - 1 )*zmax) / (1.0 * Nz); 70 | 71 | end 72 | end 73 | 74 | 75 | elseif(strcmp(type, 't6' )) 76 | 77 | % 78 | % 79 | % T6 Grid: 80 | % 81 | % 29-30-31-32-33-34-35 82 | % |\ 8 |\10 |\12 | 83 | % | \ | \ | \ | 84 | % 22 23 24 25 26 27 28 85 | % | \ | \ | \ | 86 | % | 7 \| 9 \| 11 \| 87 | % 15-16-17-18-19-20-21 88 | % |\ 2 |\ 4 |\ 6 | 89 | % | \ | \ | \ | 90 | % 8 9 10 11 12 13 14 91 | % | \ | \ | \ | 92 | % | 1 \| 3 \| 5 \| 93 | % 1--2--3--4--5--6--7 94 | % 95 | 96 | Node_num = (2 * Nx + 1) * (2 * Nz + 1); 97 | 98 | Element_num = 2 * Nx * Nz; 99 | 100 | element = 1; 101 | 102 | for j = 1 : Nz 103 | for i = 1 : Nx 104 | 105 | sw = 2 * ( j - 1 ) * ( 2 * Nx + 1 ) + 2 * ( i - 1 ) + 1; 106 | w = sw + 2 * Nx + 1; 107 | nw = sw + 2 * ( 2 * Nx + 1 ); 108 | 109 | s = sw + 1; 110 | c = sw + 1 + 2 * Nx + 1; 111 | n = sw + 1 + 2 * ( 2 * Nx + 1 ); 112 | 113 | se = sw + 2; 114 | e = sw + 2 + 2 * Nx + 1; 115 | ne = sw + 2 + 2 * ( 2 * Nx + 1 ); 116 | 117 | element_node(element, 1) = sw; 118 | element_node(element, 2) = se; 119 | element_node(element, 3) = nw; 120 | element_node(element, 4) = s; 121 | element_node(element, 5) = c; 122 | element_node(element, 6) = w; 123 | element = element + 1; 124 | 125 | element_node(element, 1) = ne; 126 | element_node(element, 2) = nw; 127 | element_node(element, 3) = se; 128 | element_node(element, 4) = n; 129 | element_node(element, 5) = c; 130 | element_node(element, 6) = e; 131 | element = element + 1; 132 | 133 | end 134 | end 135 | 136 | for j = 1 : 2 * Nz + 1 137 | for i = 1 : 2 * Nx + 1 138 | 139 | node_xz( i + (j - 1) * (2 * Nx + 1), 1) = (i - 1) * (xmax - xmin) / (2.0 * Nx); 140 | node_xz( i + (j - 1) * (2 * Nx + 1), 2) = (j - 1) * (zmax - zmin) / (2.0 * Nz); 141 | 142 | end 143 | end 144 | 145 | 146 | 147 | elseif(strcmp(type, 't10' )) 148 | 149 | 150 | % 151 | % T10 Grid: 152 | % 153 | % 43-44-45-46-47-48-49 154 | % |\ 6 |\ 8 | 155 | % | \ | \ | 156 | % 36 37 38 39 40 41 42 157 | % | \ | \ | 158 | % | \ | \ | 159 | % 29 30 31 32 33 34 35 160 | % | \ | \ | 161 | % | 5 \| 7 \| 162 | % 22-23-24-25-26-27-28 163 | % |\ 2 |\ 4 | 164 | % | \ | \ | 165 | % 15 16 17 18 19 20 21 166 | % | \ | \ | 167 | % | \ | \ | 168 | % 8 9 10 11 12 13 14 169 | % | \ | \ | 170 | % | 1 \| 3 \| 171 | % 1--2--3--4--5--6--7 172 | % 173 | 174 | Node_num = (3 * Nx + 1) * (3 * Nz + 1); 175 | 176 | Element_num = 2 * Nx * Nz; 177 | 178 | element = 1; 179 | 180 | for j = 1 : Nz 181 | for i = 1 : Nx 182 | 183 | base = (j - 1) * 3 * (3 * Nx + 1) + 3 * i - 2; 184 | 185 | element_node(element, 1) = base; 186 | element_node(element, 2) = base + 1; 187 | element_node(element, 3) = base + 2; 188 | element_node(element, 4) = base + 3; 189 | element_node(element, 5) = base + (3 * Nx + 1) + 2; 190 | element_node(element, 6) = base + 2 * (3 * Nx + 1) + 1; 191 | element_node(element, 7) = base + 3 * (3 * Nx + 1); 192 | element_node(element, 8) = base + 2 * (3 * Nx + 1); 193 | element_node(element, 9) = base + (3 * Nx + 1); 194 | element_node(element, 10) = base + (3 * Nx + 1) + 1; 195 | element = element + 1; 196 | 197 | element_node(element, 1) = base + 3 * (3 * Nx + 1) + 3; 198 | element_node(element, 2) = base + 3 * (3 * Nx + 1) + 2; 199 | element_node(element, 3) = base + 3 * (3 * Nx + 1) + 1; 200 | element_node(element, 4) = base + 3 * (3 * Nx + 1); 201 | element_node(element, 5) = base + 2 * (3 * Nx + 1) + 1; 202 | element_node(element, 6) = base + (3 * Nx + 1) + 2; 203 | element_node(element, 7) = base + 3; 204 | element_node(element, 8) = base + (3 * Nx + 1) + 3; 205 | element_node(element, 9) = base + 2 * (3 * Nx + 1) + 3; 206 | element_node(element, 10) = base + 2 * (3 * Nx + 1) + 2; 207 | element = element + 1; 208 | 209 | end 210 | end 211 | 212 | for j = 1 : 3 * Nz + 1 213 | for i = 1 : 3 * Nx + 1 214 | 215 | node_xz( i + (j - 1) * (3 * Nx + 1), 1) = (i - 1) * (xmax - xmin) / (3.0 * Nx); 216 | node_xz( i + (j - 1) * (3 * Nx + 1), 2) = (j - 1) * (zmax - zmin) / (3.0 * Nz); 217 | 218 | end 219 | end 220 | 221 | 222 | elseif(strcmp(type, 'q4' )) 223 | 224 | % 225 | % Q4 Grid: 226 | % 227 | % 9---10---11---12 228 | % | | | | 229 | % | | | | 230 | % | 4 | 5 | 6 | 231 | % | | | | 232 | % 5----6----7----8 233 | % | | | | 234 | % | | | | 235 | % | 1 | 2 | 3 | 236 | % | | | | 237 | % 1----2----3----4 238 | % 239 | 240 | Node_num = (Nx + 1) * (Nz + 1); 241 | 242 | Element_num = Nx * Nz; 243 | 244 | element = 1; 245 | 246 | for j = 1 : Nz 247 | for i = 1 : Nx 248 | 249 | sw = i + ( j - 1 ) * ( Nx + 1 ); 250 | se = i + 1 + ( j - 1 ) * ( Nx + 1 ); 251 | nw = i + j * ( Nx + 1 ); 252 | ne = i + 1 + j * ( Nx + 1 ); 253 | 254 | element_node(element, 1) = sw; 255 | element_node(element, 2) = se; 256 | element_node(element, 3) = ne; 257 | element_node(element, 4) = nw; 258 | 259 | element = element + 1; 260 | 261 | end 262 | end 263 | 264 | for j = 1 : Nz + 1 265 | for i = 1 : Nx + 1 266 | 267 | node_xz(i + ( j - 1 ) * (Nx + 1),1 ) = ((Nx - i + 1) * xmin + (i - 1) * xmax) / (1.0 * Nx); 268 | node_xz(i + ( j - 1 ) * (Nx + 1),2 ) = ((Nz - j + 1) * zmin + (j - 1) * zmax) / (1.0 * Nz); 269 | 270 | end 271 | end 272 | 273 | 274 | elseif(strcmp(type, 'q9' )) 275 | 276 | 277 | % 278 | % 279 | % Q9 Grid: 280 | % 281 | % 29---30---31---32---33---34---35 282 | % | . | . | . | 283 | % | . | . | . | 284 | % 22 . 23 . 24 . 25 . 26 . 27 . 28 285 | % | . | . | . | 286 | % | 4 . | 5 . | 6 . | 287 | % 15---16---17---18---19---20---21 288 | % | . | . | . | 289 | % | . | . | . | 290 | % 8 . 9 . 10 . 11 . 12 . 13 . 14 291 | % | . | . | . | 292 | % | 1 . | 2 . | 3 . | 293 | % 1----2----3----4----5----6----7 294 | % 295 | % 296 | 297 | Node_num = (2 * Nx + 1) * (2 * Nz + 1); 298 | 299 | Element_num = Nx * Nz; 300 | 301 | element = 1; 302 | 303 | for j = 1 : Nz 304 | 305 | for i = 1 : Nx 306 | 307 | sw = 2 * ( j - 1 ) * ( 2 * Nx + 1 ) + 2 * ( i - 1 ) + 1; 308 | w = sw + 2 * Nx + 1; 309 | nw = sw + 2 * ( 2 * Nx + 1 ); 310 | 311 | s = sw + 1; 312 | c = sw + 1 + 2 * Nx + 1; 313 | n = sw + 1 + 2 * ( 2 * Nx + 1 ); 314 | 315 | se = sw + 2; 316 | e = sw + 2 + 2 * Nx + 1; 317 | ne = sw + 2 + 2 * ( 2 * Nx + 1 ); 318 | 319 | element_node(element, 1) = sw; 320 | element_node(element, 2) = se; 321 | element_node(element, 3) = ne; 322 | element_node(element, 4) = nw; 323 | element_node(element, 5) = s; 324 | element_node(element, 6) = e; 325 | element_node(element, 7) = n; 326 | element_node(element, 8) = w; 327 | element_node(element, 9) = c; 328 | 329 | element = element + 1; 330 | 331 | end 332 | end 333 | 334 | for j = 1 : 2 * Nz + 1 335 | for i = 1 : 2 * Nx + 1 336 | 337 | node_xz(i + (j - 1 ) * (2 * Nx + 1), 1 ) = ( i - 1 ) * (xmax - xmin) / (2.0 * Nx); 338 | node_xz(i + (j - 1 ) * (2 * Nx + 1), 2 ) = ( j - 1 ) * (zmax - zmin) / (2.0 * Nz); 339 | 340 | end 341 | end 342 | 343 | elseif(strcmp(type, 'q16' )) 344 | 345 | % 346 | % q16 Grid: 347 | % 348 | % 43-44-45-46-47-48-49 349 | % | | | 350 | % | | | 351 | % 36 37 38 39 40 41 42 352 | % | | | 353 | % | | | 354 | % 29 30 31 32 33 34 35 355 | % | | | 356 | % | 3 | 4 | 357 | % 22-23-24-25-26-27-28 358 | % | | | 359 | % | | | 360 | % 15 16 17 18 19 20 21 361 | % | | | 362 | % | | | 363 | % 8 9 10 11 12 13 14 364 | % | | | 365 | % | 1 | 2 | 366 | % 1--2--3--4--5--6--7 367 | % 368 | 369 | Node_num = (3 * Nx + 1) * (3 * Nz + 1); 370 | 371 | Element_num = Nx * Nz; 372 | 373 | 374 | element = 1; 375 | 376 | for j = 1 : Nz 377 | 378 | for i = 1 : Nx 379 | 380 | base = (j - 1) * 3 * (3 * Nx + 1) + 3 * i - 2; 381 | 382 | element_node(element, 1) = base; 383 | element_node(element, 2) = base + 1; 384 | element_node(element, 3) = base + 2; 385 | element_node(element, 4) = base + 3; 386 | element_node(element, 5) = base + (3 * Nx + 1); 387 | element_node(element, 6) = base + (3 * Nx + 1) + 1; 388 | element_node(element, 7) = base + (3 * Nx + 1) + 2; 389 | element_node(element, 8) = base + (3 * Nx + 1) + 3; 390 | element_node(element, 9) = base + 2 * (3 * Nx + 1); 391 | element_node(element, 10) = base + 2 * (3 * Nx + 1) + 1; 392 | element_node(element, 11) = base + 2 * (3 * Nx + 1) + 2; 393 | element_node(element, 12) = base + 2 * (3 * Nx + 1) + 3; 394 | element_node(element, 13) = base + 3 * (3 * Nx + 1); 395 | element_node(element, 14) = base + 3 * (3 * Nx + 1) + 1; 396 | element_node(element, 15) = base + 3 * (3 * Nx + 1) + 2; 397 | element_node(element, 16) = base + 3 * (3 * Nx + 1) + 3; 398 | 399 | element = element + 1; 400 | 401 | end 402 | end 403 | for j = 1 : 3 * Nz + 1 404 | for i = 1 : 3 * Nx + 1 405 | 406 | node_xz(i + (j - 1 ) * (3 * Nx + 1), 1 ) = ( i - 1 ) * (xmax - xmin) / (3.0 * Nx); 407 | node_xz(i + (j - 1 ) * (3 * Nx + 1), 2 ) = ( j - 1 ) * (zmax - zmin) / (3.0 * Nz); 408 | 409 | end 410 | end 411 | 412 | else 413 | 414 | Node_num = -1; 415 | Element_num = -1; 416 | node_xz = -1; 417 | element_node = -1; 418 | fprintf('Generate_Mesh - Fatal error!\n'); 419 | fprintf('Wrong element type: %s\n', type); 420 | return; 421 | 422 | end 423 | 424 | node_xz = node_xz'; 425 | element_node = element_node'; 426 | 427 | 428 | end 429 | 430 | 431 | 432 | 433 | 434 | -------------------------------------------------------------------------------- /src/Mesh_Global.m: -------------------------------------------------------------------------------- 1 | function [ibool] = Mesh_Global(nelem_x, nelem_z, NGLOB, NGLL, NSPEC) 2 | % clear;clc 3 | % 4 | % NGLL = 5; 5 | % NGLLX = NGLL; 6 | % NGLLZ = NGLL; 7 | % 8 | % nelem_x = 6; 9 | % nelem_z = 8; 10 | % 11 | % NSPEC = nelem_x * nelem_z; % number of spectral elements of the mesh 12 | % NGLOB = (nelem_x*(NGLLX-1) + 1) * (nelem_z*(NGLLZ-1) + 1); % number of unique grid points of the mesh 13 | % NPGEO = (nelem_x+1)*(nelem_z+1); 14 | 15 | 16 | ibool = zeros(NGLL,NGLL,NSPEC); % local to global index mapping 17 | igL = reshape([1:NGLL*(NGLL-1)],NGLL-1,NGLL); 18 | igB = reshape([1:NGLL*(NGLL-1)],NGLL,NGLL-1); 19 | igLB = reshape([1:(NGLL-1)*(NGLL-1)],NGLL-1,NGLL-1); 20 | e = 0; 21 | last_iglob = 0; 22 | 23 | % use the nelem_z in ex direction 24 | % use the nelem_x in ez direction, it is wired! 25 | for ex=1:nelem_z 26 | for ez=1:nelem_x 27 | e = e+1; 28 | % Take care of redundant nodes at element edges : 29 | if e==1 % first element: bottom-left 30 | ig = reshape([1:NGLL*NGLL],NGLL,NGLL); 31 | else 32 | if ex==1 % elements on first (left) column 33 | ig(:, 1) = ibool(:,NGLL,e-1); % bottom edge 34 | ig(:,2:NGLL) = last_iglob + igB; % the rest 35 | elseif ez==1 % elements on first (bottom) row 36 | ig(1, :) = ibool(NGLL,:,e-nelem_x); % left edge 37 | ig(2:NGLL,:) = last_iglob + igL; % the rest 38 | else % other elements 39 | ig(1,:) = ibool(NGLL,:,e-nelem_x); % left edge 40 | ig(:,1) = ibool(:,NGLL,e-1); % bottom edge 41 | ig(2:NGLL,2:NGLL) = last_iglob + igLB; 42 | end 43 | end 44 | ibool(:,:,e) = ig; 45 | last_iglob = ig(NGLL,NGLL); 46 | end 47 | end 48 | 49 | %% change here 50 | ibool = permute(ibool, [2 1 3]); 51 | 52 | 53 | end 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/Moment_Tensor_Solution.m: -------------------------------------------------------------------------------- 1 | % 2 | % Compute the components of a moment tensor for a fault mechanism 3 | % 4 | % INPUT 5 | % 6 | % str : strike of a fault mechanism 7 | % dip : dip of a fault mechanism 8 | % rake : rake of a fault mechanism 9 | % 10 | % OUTPUT 11 | % 12 | % CM_FD : the moment tensor component for finite difference modeling 13 | % You should directly paste the CM_FD in the corresponding part 14 | % of fd3dinput.asc to define the moment tensor source 15 | % 16 | % 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | 19 | function [CM] = Moment_Tensor_Solution(strike, dip, rake) 20 | 21 | pi180 = pi/180; 22 | CS=cos(strike*pi180); %calculate each moment component 23 | SS=sin(strike*pi180); 24 | CDI=cos(dip*pi180); 25 | SDI=sin(dip*pi180); 26 | CR=cos(rake*pi180); 27 | SR=sin(rake*pi180); 28 | AS1=CR*CS+SR*CDI*SS; 29 | AS2=CR*SS-SR*CDI*CS; 30 | AS3=-SR*SDI; 31 | AN1=-SDI*SS; 32 | AN2=SDI*CS; 33 | AN3=-CDI; 34 | CM11=2.*AS1*AN1; %change to the normal convention by eliminating the minus sign 35 | CM22=2.*AS2*AN2; 36 | CM33=2.*AS3*AN3; 37 | CM12=(AS1*AN2+AS2*AN1); 38 | CM13=(AS1*AN3+AS3*AN1); 39 | CM23=(AS2*AN3+AS3*AN2); 40 | 41 | CM = [ CM11 CM12 CM13; 42 | CM12 CM22 CM23; 43 | CM13 CM23 CM33]; 44 | 45 | end -------------------------------------------------------------------------------- /src/Plot_Trace.m: -------------------------------------------------------------------------------- 1 | function Plot_Trace(rec_xz, t, seism, factor, figpath) 2 | 3 | rec_x = rec_xz(1,:); 4 | seism_x = squeeze(seism(1,:,:)); 5 | seism_z = squeeze(seism(2,:,:)); 6 | 7 | [rec_n, nt] = size(seism_x); 8 | 9 | subplot(121) 10 | ampli = factor * max(abs( seism_x(:) )); 11 | if ampli>0 12 | offset = max(abs(diff(rec_x))); 13 | ampli = offset/ampli; 14 | end 15 | plot(t, seism_x * ampli + reshape(repmat(rec_x,1,nt), [rec_n, nt]), '-k', 'LineWidth', 1.5); 16 | title('Displacement-x'); xlabel('Time (s)'); ylabel('Distance (m)'); 17 | set(gca, 'FontSize', 16); 18 | 19 | subplot(122) 20 | ampli = factor*max(abs( seism_z(:) )); 21 | if ampli>0 22 | offset = max(abs(diff(rec_x))); 23 | ampli = offset/ampli; 24 | end 25 | plot(t, seism_z*ampli + reshape(repmat(rec_x,1,nt), [rec_n, nt]), '-k', 'LineWidth', 1.5); 26 | title('Displacement-z'); xlabel('Time (s)'); ylabel('Distance (m)'); 27 | set(gca, 'FontSize', 16); 28 | set(gcf,'position',[50,50,1600,800]); 29 | print(gcf, figpath, '-dpng', '-r300'); 30 | 31 | end -------------------------------------------------------------------------------- /src/Plot_Wavefield.m: -------------------------------------------------------------------------------- 1 | function Plot_Wavefield(displ, tri, geo_xz, rec_xz, src_xz, coord, time, plot_ratio, src_node, rec_node, it) 2 | 3 | rec_xz = rec_xz/1000; 4 | src_xz = src_xz/1000; 5 | geo_xz = geo_xz/1000; 6 | coord = coord/1000; 7 | coord(2,:) = coord(2,:) - geo_xz(2,end); 8 | rec_xz(2,:) = rec_xz(2,:) - geo_xz(2,end); 9 | src_xz(2,:) = src_xz(2,:) - geo_xz(2,end); 10 | geo_xz(2,:) = geo_xz(2,:) - geo_xz(2,end); 11 | 12 | Fig = figure(2); 13 | max_value = max(abs(displ(:))) * 5; 14 | 15 | subplot(1,2,1) 16 | % trisurf(tri, coord(1,:), coord(2,:), displ(1,:)); view(2); shading interp; hold on; box on 17 | scatter(coord(1,:), coord(2,:), 10, displ(1,:), 'filled'); grid on; hold on; 18 | 19 | plot(geo_xz(1,:), geo_xz(2,:), 'k-', 'LineWidth',2.0); 20 | xlabel('Distance (km)'); ylabel('Depth (km)'); colormap('redblue'); 21 | pbaspect([1 1/plot_ratio 1]); xlim([0, max(coord(1,:))]); 22 | caxis([-0.1 0.1]*max_value); set(gca, 'FontSize', 16); 23 | title(sprintf('Displacement-x at %.2f s', time)) 24 | set(gcf,'position',[50,50,1800,600]); 25 | colorbar 26 | hold off 27 | 28 | 29 | subplot(1,2,2) 30 | % trisurf(tri, coord(1,:), coord(2,:), displ(2,:)); view(2); shading interp; hold on;box on 31 | scatter(coord(1,:), coord(2,:), 10, displ(2,:), 'filled'); grid on; hold on; 32 | plot(geo_xz(1,:), geo_xz(2,:), 'k-', 'LineWidth',2.0); 33 | xlabel('Distance (km)'); ylabel('Depth (km)'); colormap('redblue'); 34 | pbaspect([1 1/plot_ratio 1]); xlim([0, max(coord(1,:))]); 35 | caxis([-0.1 0.1]*max_value); set(gca, 'FontSize', 16); 36 | title(sprintf('Displacement-z at %.2f s', time)) 37 | set(gcf,'position',[50,50,1800,600]); 38 | colorbar 39 | hold off 40 | 41 | % figname = sprintf('./California_Observation_data_new/snap_%d.png',it); 42 | % print(gcf, figname, '-dpng', '-r300'); 43 | end 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/Plot_tri_used.m: -------------------------------------------------------------------------------- 1 | 2 | function tri_used = Plot_tri_used(coord) 3 | 4 | xx_grid_fine = coord(1,:); 5 | zz_grid_fine = coord(2,:); 6 | zz_elev_fine = coord(2,:); 7 | 8 | tri = delaunay(xx_grid_fine, zz_grid_fine); 9 | tri_used = zeros(size(tri)); 10 | 11 | use_count = 0; 12 | for ii=1:size(tri, 1) 13 | flag = 0; 14 | dis1 = sqrt((coord(1,tri(ii,1)) - coord(1,tri(ii,2)))^2 + (coord(2,tri(ii,1)) - coord(2,tri(ii,2)))^2); 15 | dis2 = sqrt((coord(1,tri(ii,2)) - coord(1,tri(ii,3)))^2 + (coord(2,tri(ii,2)) - coord(2,tri(ii,3)))^2); 16 | dis3 = sqrt((coord(1,tri(ii,1)) - coord(1,tri(ii,3)))^2 + (coord(2,tri(ii,1)) - coord(2,tri(ii,3)))^2); 17 | if max([dis1, dis2, dis3]) < 50 18 | use_count = use_count + 1; 19 | tri_used(use_count, :) = tri(ii, :); 20 | end 21 | end 22 | 23 | tri_used(use_count+1:end, :) = []; 24 | 25 | end -------------------------------------------------------------------------------- /src/Read_Gmsh.m: -------------------------------------------------------------------------------- 1 | function [coorg, knods, ibool] = Read_Gmsh(meshpath, NGLLX, NGLLZ) 2 | 3 | if NGLLX ~=5 && NGLLZ~=5 4 | error('Only 5 points element is supported, while other cases are under development'); 5 | end 6 | % open the generated Gmsh 7 | fp = fopen(meshpath,'r'); 8 | for i = 1:4 9 | temp = fgetl(fp); 10 | end 11 | node_num = fscanf(fp, '%d\n',1); 12 | coorg = zeros(node_num,2); 13 | for i = 1:node_num 14 | value = fscanf(fp, '%d %f %f %f\n',4); 15 | if value(1) ~= i 16 | error('Wrong node number!'); 17 | end 18 | coorg(i,1) = value(2); 19 | coorg(i,2) = value(3); 20 | end 21 | for i = 1:2 22 | temp = fgetl(fp); 23 | end 24 | element_num = fscanf(fp, '%d\n',1); 25 | ibool = zeros(element_num,NGLLX*NGLLZ); 26 | iele = 0; 27 | for i = 1:element_num 28 | value = fgetl(fp); 29 | value = str2double(strsplit(value,' ')); 30 | if length(value) == NGLLX*NGLLZ + 5 % 5 addtional values 31 | iele = iele+1; 32 | ibool(iele,1:NGLLX*NGLLZ) = value(end-NGLLX*NGLLZ+1:end); 33 | end 34 | end 35 | element_num = iele; 36 | ibool = ibool(1:element_num,:); 37 | 38 | if min(ibool(:)) ~=1 || max(ibool(:)) ~=node_num 39 | error('Element node numerbing is wrong!'); 40 | end 41 | 42 | % Geometry node numbering 43 | knods = fliplr(ibool(:,1:4)); % 4-node control point, clockwise numerbing 44 | 45 | % Adjust global GLL nodes numerbing 46 | index_change_25_nodes = [4, 14, 15, 16, 1, 13, 20, 24, 17, 5, 12, 23, 25, 21, 6, 11, 19, 22, 18, 7, 3, 10, 9, 8, 2]; 47 | for i = 1 : element_num 48 | ibool(i,:) = ibool(i,index_change_25_nodes); 49 | end 50 | ibool = reshape(ibool', [NGLLX, NGLLZ, element_num]); 51 | ibool = permute(ibool, [2,1,3]); 52 | 53 | % Take the transpose 54 | knods = knods'; 55 | coorg = coorg'; 56 | 57 | end 58 | 59 | -------------------------------------------------------------------------------- /src/Set_PML.m: -------------------------------------------------------------------------------- 1 | function [pml_dx, pml_dz, pml_dxx, pml_dzz] = Set_PML( vp, xmin, xmax, zmin, zmax, NSPEC, NGLOB, NGLLX, NGLLZ, pml_x_thick, pml_z_thick, free_surface, coord, ibool) 2 | 3 | USE_PML_X_Left = true; 4 | USE_PML_X_Right = true; 5 | USE_PML_Z_Bottom = true; 6 | 7 | if ( free_surface == 1 ) 8 | USE_PML_Z_Top = false; 9 | else 10 | USE_PML_Z_Top = true; 11 | end 12 | 13 | Rcoef = 0.0001; 14 | xmin_pml = xmin + pml_x_thick; 15 | xmax_pml = xmax - pml_x_thick; 16 | zmin_pml = zmin + pml_z_thick; 17 | zmax_pml = zmax - pml_z_thick; 18 | 19 | vp_max = max(vp(:)); 20 | d0_x = 3.0 * vp_max * log10(1.0/Rcoef) / (2.0 * pml_x_thick); 21 | d0_z = 3.0 * vp_max * log10(1.0/Rcoef) / (2.0 * pml_z_thick); 22 | 23 | % pml_dx = zeros(NGLLX, NGLLZ, NSPEC); 24 | % pml_dz = zeros(NGLLX, NGLLZ, NSPEC); 25 | % pml_dxx = zeros(NGLLX, NGLLZ, NSPEC); 26 | % pml_dzz = zeros(NGLLX, NGLLZ, NSPEC); 27 | 28 | pml_dx = zeros(NGLOB,1); 29 | pml_dz = zeros(NGLOB,1); 30 | pml_dxx = zeros(NGLOB,1); 31 | pml_dzz = zeros(NGLOB,1); 32 | 33 | %%%%%%%%%% x direction %%%%%%%% 34 | for i = 1 : NGLOB 35 | 36 | x = coord(1,i); 37 | z = coord(2,i); 38 | 39 | if ( (x <= xmin_pml) && USE_PML_X_Left ) 40 | pml_dx_temp = d0_x * ( (xmin_pml-x) / pml_x_thick)^2; 41 | pml_dxx_temp = - d0_x * 2 * (xmin_pml-x) / pml_x_thick ^2; % Be careful when caculate the derivative, expecially the direction 42 | 43 | elseif ( (x >= xmax_pml) && USE_PML_X_Right ) 44 | pml_dx_temp = d0_x * ( (x-xmax_pml) / pml_x_thick)^2; 45 | pml_dxx_temp = d0_x * 2 * (x-xmax_pml) / pml_x_thick ^2; 46 | else 47 | pml_dx_temp = 0.0; 48 | pml_dxx_temp = 0.0; 49 | end 50 | 51 | %%%%%%%%%% z direction %%%%%%%% 52 | if ( (z <= zmin_pml) && USE_PML_Z_Bottom ) 53 | pml_dz_temp = d0_z * ( (zmin_pml-z) / pml_z_thick)^2; 54 | pml_dzz_temp = - d0_z * 2 * (zmin_pml-z) / pml_z_thick ^2; % Be careful when caculate the derivative, expecially the direction 55 | elseif ( (z >= zmax_pml) && USE_PML_Z_Top ) 56 | pml_dz_temp = d0_z * ( (z-zmax_pml) / pml_z_thick)^2; 57 | pml_dzz_temp = d0_z * 2 * (z-zmax_pml) / pml_z_thick ^2; 58 | else 59 | pml_dz_temp = 0.0; 60 | pml_dzz_temp = 0.0; 61 | end 62 | 63 | % for the global matrix 64 | % index = (ibool==i); 65 | pml_dx(i) = pml_dx_temp; 66 | pml_dz(i) = pml_dz_temp; 67 | pml_dxx(i) = pml_dxx_temp; 68 | pml_dzz(i) = pml_dzz_temp; 69 | 70 | end 71 | 72 | % dx = dx'; 73 | % dz = dz'; 74 | % dxx = dxx'; 75 | % dzz = dzz'; 76 | 77 | end -------------------------------------------------------------------------------- /src/Set_Source_Array.m: -------------------------------------------------------------------------------- 1 | function [sourcearray, ispec_source] = Set_Source_Array(src_node, src_type, force_angle, Moment_Tensor, ibool, xix, xiz, gammax, gammaz, NDIM, NGLLX, NGLLZ) 2 | 3 | [xigll,wxgll,hprime_xx, hprimewgll_xx] = GetGLL(NGLLX); 4 | [zigll,wzgll,hprime_zz, hprimewgll_zz] = GetGLL(NGLLZ); 5 | 6 | NSPEC = size(gammax, 3); 7 | % Find the element contains the source and its node 8 | for ispec = 1 : NSPEC 9 | for j = 1:NGLLZ 10 | for i = 1:NGLLX 11 | if (ibool(i,j,ispec) == src_node) 12 | ispec_source = ispec; 13 | i_source = i; 14 | j_source = j; 15 | break; 16 | end 17 | end 18 | end 19 | end 20 | xi_source = xigll(i_source); 21 | gamma_source = zigll(j_source); 22 | 23 | % Moment tensor solution 24 | Mxx = Moment_Tensor(1,1); 25 | Mzz = Moment_Tensor(3,3); 26 | Mxz = Moment_Tensor(1,2); 27 | 28 | [ hxis, hpxis] = Lagrange_Any( xi_source, NGLLX, xigll); 29 | [hgammas, hpgammas] = Lagrange_Any(gamma_source, NGLLZ, zigll); 30 | 31 | sourcearray = zeros(NDIM,NGLLX,NGLLZ); 32 | 33 | if (strcmp(src_type, 'vector_source') == 1) 34 | % collocated force source 35 | for j = 1:NGLLZ 36 | for i = 1:NGLLX 37 | hlagrange = hxis(i) * hgammas(j); 38 | % source element is elastic, and only in P_SV case 39 | sourcearray(1,i,j) = -sin(force_angle*pi/180) * hlagrange; 40 | sourcearray(2,i,j) = cos(force_angle*pi/180) * hlagrange; 41 | end 42 | end 43 | elseif (strcmp(src_type, 'moment_tensor_source') == 1) 44 | dxis_dx = 0.0; 45 | dxis_dz = 0.0; 46 | dgammas_dx = 0.0; 47 | dgammas_dz = 0.0; 48 | for m = 1:NGLLZ 49 | for k = 1:NGLLX 50 | xixd = xix(k,m,ispec_source); 51 | xizd = xiz(k,m,ispec_source); 52 | gammaxd = gammax(k,m,ispec_source); 53 | gammazd = gammaz(k,m,ispec_source); 54 | 55 | hlagrange = hxis(k) * hgammas(m); 56 | 57 | dxis_dx = dxis_dx + hlagrange * xixd; 58 | dxis_dz = dxis_dz + hlagrange * xizd; 59 | dgammas_dx = dgammas_dx + hlagrange * gammaxd; 60 | dgammas_dz = dgammas_dz + hlagrange * gammazd; 61 | end 62 | end 63 | % calculate source array 64 | for m = 1:NGLLZ 65 | for k = 1:NGLLX 66 | dsrc_dx = (hpxis(k)*dxis_dx)*hgammas(m) + hpxis(k)*(hpgammas(m)*dgammas_dx); 67 | dsrc_dz = (hpxis(k)*dxis_dz)*hgammas(m) + hpxis(k)*(hpgammas(m)*dgammas_dz); 68 | sourcearray(1,k,m) = sourcearray(1,k,m) + Mxx*dsrc_dx + Mxz*dsrc_dx; 69 | sourcearray(2,k,m) = sourcearray(2,k,m) + Mxz*dsrc_dx + Mzz*dsrc_dz; 70 | end 71 | end 72 | 73 | end 74 | 75 | sourcearray = sourcearray / max(abs(sourcearray(:))); 76 | 77 | end -------------------------------------------------------------------------------- /src/Shape_Functions.m: -------------------------------------------------------------------------------- 1 | function [shape2D, dershape2D] = Shape_Functions(xi,gamma,ngnod,NDIM) 2 | %======================================================================= 3 | % 4 | % 4 . . . . 7 . . . . 3 5 | % . . 6 | % . gamma . 7 | % . . 8 | % 8 9 xi 6 9 | % . . 10 | % . . 11 | % . . 12 | % 1 . . . . 5 . . . . 2 13 | % 14 | % Local coordinate system : s,t 15 | % 16 | %======================================================================= 17 | 18 | shape2D = zeros(1,ngnod); 19 | dershape2D = zeros(NDIM,ngnod); 20 | 21 | % very small value 22 | TINYVAL = 1.e-9; 23 | 24 | %---- set up the shape functions and their local derivatives 25 | s = xi; 26 | t = gamma; 27 | 28 | %---- 4-node element 29 | if (ngnod == 4) 30 | sp = s + 1.0; 31 | sm = s - 1.0; 32 | tp = t + 1.0; 33 | tm = t - 1.0; 34 | 35 | %---- corner nodes 36 | shape2D(1) = 0.25 * sm * tm; 37 | shape2D(2) = - 0.25 * sp * tm; 38 | shape2D(3) = 0.25 * sp * tp; 39 | shape2D(4) = - 0.25 * sm * tp; 40 | 41 | dershape2D(1,1) = 0.25 * tm; 42 | dershape2D(1,2) = - 0.25 * tm; 43 | dershape2D(1,3) = 0.25 * tp; 44 | dershape2D(1,4) = - 0.25 * tp; 45 | 46 | dershape2D(2,1) = 0.25 * sm; 47 | dershape2D(2,2) = - 0.25 * sp; 48 | dershape2D(2,3) = 0.25 * sp; 49 | dershape2D(2,4) = - 0.25 * sm; 50 | 51 | %---- 9-node element 52 | elseif (ngnod == 9) 53 | 54 | sp = s + 1; 55 | sm = s - 1; 56 | tp = t + 1; 57 | tm = t - 1; 58 | s2 = s * 2; 59 | t2 = t * 2; 60 | ss = s * s; 61 | tt = t * t; 62 | st = s * t; 63 | 64 | %---- corner nodes 65 | shape2D(1) = 0.25 * sm * st * tm; 66 | shape2D(2) = 0.25 * sp * st * tm; 67 | shape2D(3) = 0.25 * sp * st * tp; 68 | shape2D(4) = 0.25 * sm * st * tp; 69 | 70 | dershape2D(1,1) = 0.25 * tm * t * (s2 - 1.0); 71 | dershape2D(1,2) = 0.25 * tm * t * (s2 + 1.0); 72 | dershape2D(1,3) = 0.25 * tp * t * (s2 + 1.0); 73 | dershape2D(1,4) = 0.25 * tp * t * (s2 - 1.0); 74 | 75 | dershape2D(2,1) = 0.25 * sm * s * (t2 - 1.0); 76 | dershape2D(2,2) = 0.25 * sp * s * (t2 - 1.0); 77 | dershape2D(2,3) = 0.25 * sp * s * (t2 + 1.0); 78 | dershape2D(2,4) = 0.25 * sm * s * (t2 + 1.0); 79 | 80 | %---- midside nodes 81 | shape2D(5) = 0.5 * tm * t * (1.0 - ss); 82 | shape2D(6) = 0.5 * sp * s * (1.0 - tt); 83 | shape2D(7) = 0.5 * tp * t * (1.0 - ss); 84 | shape2D(8) = 0.5 * sm * s * (1.0 - tt); 85 | 86 | dershape2D(1,5) = -1.0 * st * tm; 87 | dershape2D(1,6) = 0.5 * (1.0 - tt) * (s2 + 1.0); 88 | dershape2D(1,7) = -1.0 * st * tp; 89 | dershape2D(1,8) = 0.5 * (1.0 - tt) * (s2 - 1.0); 90 | 91 | dershape2D(2,5) = 0.5 * (1.0 - ss) * (t2 - 1.0); 92 | dershape2D(2,6) = -1.0 * st * sp; 93 | dershape2D(2,7) = 0.5 * (1.0 - ss) * (t2 + 1.0); 94 | dershape2D(2,8) = -1.0 * st * sm; 95 | 96 | %---- center node 97 | shape2D(9) = (1.0 - ss) * (1.0 - tt); 98 | 99 | dershape2D(1,9) = -1.0 * s2 * (1.0 - tt); 100 | dershape2D(2,9) = -1.0 * t2 * (1.0 - ss); 101 | 102 | else 103 | error ('Error: wrong number of control nodes'); 104 | end 105 | 106 | %--- check the shape functions and their derivatives 107 | % sum of shape functions should be one 108 | if (abs(sum(shape2D)-1.0) > TINYVAL) 109 | error('error shape functions'); 110 | end 111 | % sum of derivatives of shape functions should be zero 112 | if (abs(sum(dershape2D(1,:))) > TINYVAL) 113 | error( 'error deriv xi shape functions') 114 | end 115 | if (abs(sum(dershape2D(2,:))) > TINYVAL) 116 | error('error deriv gamma shape functions') 117 | end 118 | 119 | 120 | end -------------------------------------------------------------------------------- /src/Source_Time_Function.m: -------------------------------------------------------------------------------- 1 | % SRC_TIMEF Source time functions 2 | % 3 | % f = src_timef(t,name,arguments) 4 | % f = src_timef(t,'ricker',f0 [,t0]) 5 | % f = src_timef(t,'gaussian',f0 [,t0]) 6 | % f = src_timef(t,'gabor',f0,t0,gamma [,theta]) 7 | % f = src_timef(t,'crack',tw,t0,tap_t0,tap_tw) 8 | % 9 | % INPUT t times 10 | % name of a source time function: 11 | % 'gaussian' 12 | % 'ricker' second derivative of a Gaussian 13 | % 'gabor' 14 | % f0 dominant frequency 15 | % t0 time offset [1.5/f0] 16 | % gamma controls the width of the signal 17 | % and the spectral bandwidth 18 | % 19 | % OUTPUT f source time function evaluated at times t 20 | % 21 | 22 | function f = STF(t,name,varargin) 23 | 24 | fun = str2func(name); 25 | f = fun(t,varargin{:}); 26 | 27 | 28 | %-- RICKER ------------------------------------------- 29 | function f = ricker(t,f0,t0) 30 | 31 | % safe offset to guarantee almost zero initial value: 32 | if nargin<3, t0=1.5/f0; end 33 | 34 | arg = pi*f0*(t-t0); 35 | arg = arg.*arg; 36 | f = (2*arg-1).*exp(-arg); 37 | 38 | %-- GABOR wavelet ------------------------------------------- 39 | function f = gabor(t,f0,t0,gamma,theta) 40 | 41 | if nargin<2, theta=pi/2; end 42 | if isempty(t0), t0 = 0.45*gamma/f0; end 43 | 44 | w0 = 2*pi*f0; 45 | f = exp(-( w0/gamma*(t-t0) ).^2) .* cos( w0*(t-t0)+theta); 46 | 47 | %-- GAUSSIAN ------------------------------------------- 48 | function f = gaussian(t,f0,t0) 49 | 50 | if nargin<3, t0=0.45/f0; end 51 | 52 | f = exp(-( 2*pi*f0*(t-t0) ).^2) ; 53 | 54 | %-- CRACK smoothed and tapered ------------------------------- 55 | function f = crack(t,tw,t0, tap_t0,tap_tw) 56 | 57 | if nargin<3, t0=0; end 58 | if isempty(tw), t0=0; end 59 | 60 | t=t-t0; 61 | f = 2/tw *(t>0).*( sqrt(t) - (t>tw).*sqrt(t-tw) ); 62 | 63 | if nargin>3, 64 | f = f.* exp( -((t>tap_t0).*(t-tap_t0)/tap_tw).^2 ); 65 | end 66 | -------------------------------------------------------------------------------- /src/WMatrix.m: -------------------------------------------------------------------------------- 1 | function [ W ] = WMatrix(NSPEC, NGLL, rho, vs) 2 | %WMATRIX Summary of this function goes here 3 | % Local contributions of stiffness matrix (mu*wgll2): the material 4 | % properties and the geometry will go here 5 | 6 | mu = zeros(NGLL,NGLL); 7 | [xgll,wgll,H, HW] = GetGLL(NGLL); 8 | wgll2 = wgll * wgll' ; 9 | W = zeros(NGLL, NGLL, NSPEC); 10 | for ispec = 1 : NSPEC 11 | % mu(:,:) = rho(:,:,ispec).*vs(:,:,ispec).^2; 12 | % add here the properties of heterogeneous medium 13 | W(:,:,ispec) = wgll2.*vs(:,:,ispec).^2; 14 | end 15 | 16 | 17 | end 18 | 19 | -------------------------------------------------------------------------------- /src/gll_library/gll_03.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 0.000000000000000E+00 1.000000000000000 2 | 0.3333333333333333 1.333333333333333 0.3333333333333333 3 | -1.500000000000000 -0.5000000000000000 0.5000000000000000 4 | 2.000000000000000 0.000000000000000E+00 -2.000000000000000 5 | -0.5000000000000000 0.5000000000000000 1.500000000000000 6 | -------------------------------------------------------------------------------- /src/gll_library/gll_04.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.4472135954999580 0.4472135954999580 1.000000000000000 2 | 0.1666666666666667 0.8333333333333335 0.8333333333333335 0.1666666666666667 3 | -3.000000000000000 -0.8090169943749475 0.3090169943749474 -0.5000000000000000 4 | 4.045084971874738 0.000000000000000E+00 -1.118033988749895 1.545084971874737 5 | -1.545084971874737 1.118033988749895 0.000000000000000E+00 -4.045084971874738 6 | 0.5000000000000000 -0.3090169943749474 0.8090169943749475 3.000000000000000 7 | -------------------------------------------------------------------------------- /src/gll_library/gll_05.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.6546536707079772 0.000000000000000E+00 0.6546536707079771 1.000000000000000 2 | 0.1000000000000000 0.5444444444444444 0.7111111111111110 0.5444444444444444 0.1000000000000000 3 | -5.000000000000000 -1.240990253030983 0.3750000000000000 -0.2590097469690172 0.5000000000000000 4 | 6.756502488724241 0.000000000000000E+00 -1.336584577695453 0.7637626158259734 -1.410164177942427 5 | -2.666666666666667 1.745743121887939 0.000000000000000E+00 -1.745743121887940 2.666666666666667 6 | 1.410164177942427 -0.7637626158259734 1.336584577695453 0.000000000000000E+00 -6.756502488724238 7 | -0.5000000000000000 0.2590097469690171 -0.3750000000000000 1.240990253030982 5.000000000000000 8 | -------------------------------------------------------------------------------- /src/gll_library/gll_06.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.7650553239294647 -0.2852315164806451 0.2852315164806451 0.7650553239294647 1.000000000000000 2 | 6.666666666666667E-02 0.3784749562978473 0.5548583770354865 0.5548583770354865 0.3784749562978473 6.666666666666667E-02 3 | -7.500000000000000 -1.786364948339096 0.4849510478535692 -0.2697006108320389 0.2377811779842314 -0.5000000000000000 4 | 10.14141593631967 0.000000000000000E+00 -1.721256952830233 0.7863566722232407 -0.6535475074298002 1.349913314190488 5 | -4.036187270305349 2.523426777429455 0.000000000000000E+00 -1.752961966367866 1.152828158535930 -2.244684648176167 6 | 2.244684648176167 -1.152828158535930 1.752961966367866 0.000000000000000E+00 -2.523426777429455 4.036187270305349 7 | -1.349913314190488 0.6535475074298002 -0.7863566722232407 1.721256952830233 0.000000000000000E+00 -10.14141593631967 8 | 0.5000000000000000 -0.2377811779842314 0.2697006108320389 -0.4849510478535692 1.786364948339096 7.500000000000000 9 | -------------------------------------------------------------------------------- /src/gll_library/gll_07.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.8302238962785670 -0.4688487934707142 0.000000000000000E+00 0.4688487934707142 0.8302238962785670 1.000000000000000 2 | 4.761904761904762E-02 0.2768260473615661 0.4317453812098626 0.4876190476190476 0.4317453812098626 0.2768260473615661 4.761904761904762E-02 3 | -10.50000000000000 -2.442926014244291 0.6252566655153421 -0.3125000000000000 0.2260994009425747 -0.2266118703954454 0.5000000000000000 4 | 14.20157660291981 0.000000000000000E+00 -2.215804283169970 0.9075444712688207 -0.6163908355175793 0.6022471796357857 -1.317373435702434 5 | -5.668985225545507 3.455828214294286 0.000000000000000E+00 -2.006969240588753 1.066441904006375 -0.9613397972887119 2.049964813076742 6 | 3.200000000000000 -1.598606688098367 2.266698087085999 0.000000000000000E+00 -2.266698087085999 1.598606688098367 -3.200000000000000 7 | -2.049964813076742 0.9613397972887119 -1.066441904006375 2.006969240588753 0.000000000000000E+00 -3.455828214294286 5.668985225545507 8 | 1.317373435702434 -0.6022471796357857 0.6163908355175793 -0.9075444712688207 2.215804283169970 0.000000000000000E+00 -14.20157660291981 9 | -0.5000000000000000 0.2266118703954454 -0.2260994009425747 0.3125000000000000 -0.6252566655153421 2.442926014244291 10.50000000000000 10 | -------------------------------------------------------------------------------- /src/gll_library/gll_08.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.8717401485096066 -0.5917001814331423 -0.2092992179024789 0.2092992179024789 0.5917001814331423 0.8717401485096066 1.000000000000000 2 | 3.571428571428571E-02 0.2107042271435059 0.3411226924835043 0.4124587946587038 0.4124587946587038 0.3411226924835043 0.2107042271435059 3.571428571428571E-02 3 | -14.00000000000000 -3.209915703002988 0.7924766813205144 -0.3721504357285949 0.2433307127237910 -0.2032845689005927 0.2199575147713043 -0.5000000000000000 4 | 18.93759860711737 0.000000000000000E+00 -2.806475794736434 1.078944688790453 -0.6611573509003115 0.5370395861576611 -0.5735654149402641 1.297687388320232 5 | -7.569289819348488 4.543585064566565 0.000000000000000E+00 -2.378187233515506 1.135358016881112 -0.8450225565065105 0.8694480983314928 -1.941659425544123 6 | 4.297908164265174 -2.112061214314542 2.875517405972504 0.000000000000000E+00 -2.388924359158239 1.372785831806028 -1.294232050913501 2.810188989257949 7 | -2.810188989257949 1.294232050913501 -1.372785831806028 2.388924359158239 0.000000000000000E+00 -2.875517405972504 2.112061214314542 -4.297908164265174 8 | 1.941659425544123 -0.8694480983314928 0.8450225565065105 -1.135358016881112 2.378187233515506 0.000000000000000E+00 -4.543585064566565 7.569289819348488 9 | -1.297687388320232 0.5735654149402641 -0.5370395861576611 0.6611573509003115 -1.078944688790453 2.806475794736434 0.000000000000000E+00 -18.93759860711737 10 | 0.5000000000000000 -0.2199575147713043 0.2032845689005927 -0.2433307127237910 0.3721504357285949 -0.7924766813205144 3.209915703002988 14.00000000000000 11 | -------------------------------------------------------------------------------- /src/gll_library/gll_09.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.8997579954114601 -0.6771862795107377 -0.3631174638261782 0.000000000000000E+00 0.3631174638261782 0.6771862795107377 0.8997579954114601 1.000000000000000 2 | 2.777777777777778E-02 0.1654953615608049 0.2745387125001617 0.3464285109730463 0.3715192743764172 0.3464285109730463 0.2745387125001617 0.1654953615608049 2.777777777777778E-02 3 | -18.00000000000000 -4.087013702033668 0.9853600900745069 -0.4446134492810906 0.2734375000000000 -0.2077345120355971 0.1896555919783565 -0.2156540187024990 0.5000000000000000 4 | 24.34974517159305 0.000000000000000E+00 -3.488358753434457 1.287960750063907 -0.7417823979162546 0.5473001605340515 -0.4923509383155076 0.5557049812837168 -1.284830632699589 5 | -9.738701657211546 5.786805816637314 0.000000000000000E+00 -2.834458912079420 1.269413086358149 -0.8557261850926754 0.7383492771903861 -0.8167563817413857 1.874440873446983 6 | 5.544963906949379 -2.696065440314056 3.576680940125617 0.000000000000000E+00 -2.659310217573918 1.376964893760512 -1.079803811282631 1.145653738455132 -2.590745676559355 7 | -3.657142857142857 1.665221645005385 -1.717832157195063 2.851915968462895 0.000000000000000E+00 -2.851915968462895 1.717832157195063 -1.665221645005385 3.657142857142857 8 | 2.590745676559355 -1.145653738455132 1.079803811282631 -1.376964893760512 2.659310217573918 0.000000000000000E+00 -3.576680940125617 2.696065440314056 -5.544963906949379 9 | -1.874440873446983 0.8167563817413857 -0.7383492771903861 0.8557261850926754 -1.269413086358149 2.834458912079420 0.000000000000000E+00 -5.786805816637314 9.738701657211546 10 | 1.284830632699589 -0.5557049812837168 0.4923509383155076 -0.5473001605340515 0.7417823979162546 -1.287960750063907 3.488358753434457 0.000000000000000E+00 -24.34974517159305 11 | -0.5000000000000000 0.2156540187024990 -0.1896555919783565 0.2077345120355971 -0.2734375000000000 0.4446134492810906 -0.9853600900745069 4.087013702033668 18.00000000000000 12 | -------------------------------------------------------------------------------- /src/gll_library/gll_10.tab: -------------------------------------------------------------------------------- 1 | -1.000000000000000 -0.9195339081664589 -0.7387738651055051 -0.4779249498104445 -0.1652789576663870 0.1652789576663870 0.4779249498104445 0.7387738651055050 0.9195339081664589 1.000000000000000 2 | 2.222222222222222E-02 0.1333059908510705 0.2248893420631265 0.2920426836796837 0.3275397611838975 0.3275397611838975 0.2920426836796837 0.2248893420631262 0.1333059908510705 2.222222222222222E-02 3 | -22.50000000000000 -5.074064702978071 1.203351992852207 -0.5283693768202727 0.3120472556084112 -0.2235279447424538 0.1866457893937360 -0.1807865854892499 0.2127027580091888 -0.5000000000000000 4 | 30.43814502928193 0.000000000000000E+00 -4.259297354965221 1.529902638181603 -0.8458135734064248 0.5880821430451694 -0.4834623263339481 0.4642749589081574 -0.5437537382357056 1.275954836092664 5 | -12.17794670742982 7.185502869705824 0.000000000000000E+00 -3.364125868297816 1.444850315601661 -0.9165551803364351 0.7212373127216039 -0.6767970871960859 0.7832392931379083 -1.829563931903246 6 | 6.943788485133955 -3.351663862746773 4.368674557010182 0.000000000000000E+00 -3.020217958199348 1.468055509389994 -1.046189365502494 0.9366032131394474 -1.059154463645441 2.452884175442687 7 | -4.599354761103132 2.078207994036417 -2.104350179413156 3.387318101202446 0.000000000000000E+00 -3.025188487751974 1.646494083987060 -1.334915483878251 1.444948448751455 -3.294643033749184 8 | 3.294643033749184 -1.444948448751455 1.334915483878251 -1.646494083987060 3.025188487751974 0.000000000000000E+00 -3.387318101202446 2.104350179413156 -2.078207994036417 4.599354761103132 9 | -2.452884175442687 1.059154463645441 -0.9366032131394474 1.046189365502494 -1.468055509389994 3.020217958199348 0.000000000000000E+00 -4.368674557010186 3.351663862746773 -6.943788485133955 10 | 1.829563931903247 -0.7832392931379084 0.6767970871960860 -0.7212373127216042 0.9165551803364356 -1.444850315601661 3.364125868297818 0.000000000000000E+00 -7.185502869705821 12.17794670742982 11 | -1.275954836092664 0.5437537382357056 -0.4642749589081575 0.4834623263339481 -0.5880821430451694 0.8458135734064248 -1.529902638181603 4.259297354965214 0.000000000000000E+00 -30.43814502928193 12 | 0.5000000000000000 -0.2127027580091888 0.1807865854892499 -0.1866457893937360 0.2235279447424538 -0.3120472556084112 0.5283693768202727 -1.203351992852206 5.074064702978071 22.50000000000000 13 | -------------------------------------------------------------------------------- /src/gll_library/gll_11.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9340014304080592 -0.7844834736631444 -0.5652353269962049 -0.2957581355869394 0.0000000000000000 0.2957581355869394 0.5652353269962049 0.7844834736631444 0.9340014304080592 1.0000000000000000 2 | 0.0181818181818182 0.1096122732669948 0.1871698817803052 0.2480481042640284 0.2868791247790082 0.3002175954556907 0.2868791247790082 0.2480481042640284 0.1871698817803052 0.1096122732669948 0.0181818181818182 3 | -27.5000000000000071 -6.1709856973178985 1.4461724827922613 -0.6227252147386679 0.3574763731164950 -0.2460937499999998 0.1942876687964179 -0.1729701085118250 0.1746578629476122 -0.2105873463130667 0.5000000000000009 4 | 37.2028673819619016 0.0000000000000181 -5.1182118247757806 1.8026467998794649 -0.9684871388021600 0.6469399638321007 -0.5026433130128493 0.4433956364372600 -0.4453135272909134 0.5353310859294461 -1.2695626762851422 5 | -14.8873962950986538 8.7396700535203280 0.0000000000000011 -3.9619965770457841 1.6527366342270533 -1.0065054085767795 0.7477348246882326 -0.6435862093598285 0.6373620564181567 -0.7604009822439182 1.7979880357947646 6 | 8.4956194946334982 -4.0793161937127458 5.2506617554544404 -0.0000000000000065 -3.4506147161735581 1.6081279037255154 -1.0799872504956856 0.8845873145564306 -0.8529168135584961 1.0033862429739648 -2.3597699130885630 7 | -5.6403879976858811 2.5347411786865033 -2.5331834086094505 3.9907957880288980 0.0000000000000001 -3.3051768533783226 1.6905705704687963 -1.2490552915691857 1.1460685342801618 -1.3155267144392560 3.0655392008818652 8 | 4.0634920634920526 -1.7719070552690330 1.6144191079350483 -1.9463494545710505 3.4588513480770815 0.0000000000000009 -3.4588513480770833 1.9463494545710518 -1.6144191079350450 1.7719070552690281 -4.0634920634920597 9 | -3.0655392008818545 1.3155267144392546 -1.1460685342801626 1.2490552915691866 -1.6905705704687963 3.3051768533783226 0.0000000000000007 -3.9907957880288989 2.5331834086094496 -2.5347411786865015 5.6403879976858740 10 | 2.3597699130885701 -1.0033862429739600 0.8529168135584957 -0.8845873145564329 1.0799872504956867 -1.6081279037255163 3.4506147161735585 0.0000000000000062 -5.2506617554544404 4.0793161937127449 -8.4956194946335017 11 | -1.7979880357947771 0.7604009822439144 -0.6373620564181566 0.6435862093598297 -0.7477348246882324 1.0065054085767793 -1.6527366342270531 3.9619965770457855 -0.0000000000000034 -8.7396700535203227 14.8873962950986645 12 | 1.2695626762851475 -0.5353310859294448 0.4453135272909143 -0.4433956364372607 0.5026433130128490 -0.6469399638321008 0.9684871388021601 -1.8026467998794649 5.1182118247757815 -0.0000000000000163 -37.2028673819619087 13 | -0.4999999999999929 0.2105873463130673 -0.1746578629476110 0.1729701085118249 -0.1942876687964183 0.2460937500000002 -0.3574763731164952 0.6227252147386684 -1.4461724827922622 6.1709856973178985 27.5000000000000071 14 | -------------------------------------------------------------------------------- /src/gll_library/gll_12.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9448992722228823 -0.8192793216440067 -0.6328761530318607 -0.3995309409653490 -0.1365529328549276 0.1365529328549276 0.3995309409653490 0.6328761530318607 0.8192793216440067 0.9448992722228823 1.0000000000000000 2 | 0.0151515151515152 0.0916845174131961 0.1579747055643701 0.2125084177610211 0.2512756031992014 0.2714052409106962 0.2714052409106962 0.2512756031992014 0.2125084177610211 0.1579747055643701 0.0916845174131961 0.0151515151515152 3 | -33.0000000000000355 -7.3777289460344555 1.7136668943256410 -0.7273230777317021 0.4089424891605430 -0.2736422789550999 0.2078879182663048 -0.1754568652095257 0.1635259635519704 -0.1702295188728265 0.2090176288688633 -0.5000000000000027 4 | 44.6439521894873224 0.0000000000000383 -6.0645084594499936 2.1051020723548199 -1.1075999414156217 0.7190207287273479 -0.5374419426650602 0.4492980935903793 -0.4163079892853460 0.4318288724337405 -0.5291569320650947 1.2648029086236914 5 | -17.8672575223890036 10.4492990234832401 -0.0000000000000012 -4.6254332489213574 1.8889896823631604 -1.1174754037877039 0.7981839317491329 -0.6505527436182771 0.5937349194619556 -0.6102924689917407 0.7440518955831431 -1.7748692360717122 6 | 10.2011102456893887 -4.8792524980578760 6.2221575136088854 -0.0000000000000020 -3.9410687647002778 1.7828481722138048 -1.1500331377515818 0.8907625025193575 -0.7900439882348196 0.7986953851476899 -0.9649279354942388 2.2935424893001759 7 | -6.7819798620814549 3.0355489807328406 -3.0046393831034015 4.6600244900098087 -0.0000000000000001 -3.6588669370808846 1.7948712618376386 -1.2514675303792422 1.0532612660054217 -1.0347734625083338 1.2313709301034466 -2.9098099563036577 8 | 4.9016846104485765 -2.1284509054081915 1.9198559674048448 -2.2769655093429231 3.9519780268177453 0.0000000000000010 -3.6615837503189685 1.9386580353228584 -1.4687654451305370 1.3713037255774396 -1.5909399322805184 3.7238434556063176 9 | -3.7238434556062927 1.5909399322805258 -1.3713037255774445 1.4687654451305383 -1.9386580353228584 3.6615837503189699 -0.0000000000000016 -3.9519780268177458 2.2769655093429240 -1.9198559674048439 2.1284509054081879 -4.9016846104486014 10 | 2.9098099563036470 -1.2313709301034506 1.0347734625083360 -1.0532612660054208 1.2514675303792420 -1.7948712618376386 3.6588669370808842 -0.0000000000000002 -4.6600244900098087 3.0046393831034015 -3.0355489807328406 6.7819798620814549 11 | -2.2935424893001652 0.9649279354942362 -0.7986953851476895 0.7900439882348175 -0.8907625025193571 1.1500331377515824 -1.7828481722138052 3.9410687647002787 0.0000000000000004 -6.2221575136088862 4.8792524980578795 -10.2011102456893674 12 | 1.7748692360717069 -0.7440518955831402 0.6102924689917433 -0.5937349194619558 0.6505527436182766 -0.7981839317491323 1.1174754037877035 -1.8889896823631609 4.6254332489213583 0.0000000000000016 -10.4492990234832437 17.8672575223889929 13 | -1.2648029086236807 0.5291569320650934 -0.4318288724337422 0.4163079892853465 -0.4492980935903793 0.5374419426650600 -0.7190207287273481 1.1075999414156217 -2.1051020723548191 6.0645084594499936 -0.0000000000000379 -44.6439521894873081 14 | 0.4999999999999973 -0.2090176288688631 0.1702295188728252 -0.1635259635519703 0.1754568652095272 -0.2078879182663060 0.2736422789551007 -0.4089424891605434 0.7273230777317015 -1.7136668943256386 7.3777289460344537 33.0000000000000284 15 | -------------------------------------------------------------------------------- /src/gll_library/gll_13.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9533098466421639 -0.8463475646518723 -0.6861884690817575 -0.4829098210913362 -0.2492869301062400 0.0000000000000000 0.2492869301062400 0.4829098210913362 0.6861884690817575 0.8463475646518723 0.9533098466421639 1.0000000000000000 2 | 0.0128205128205128 0.0778016867468190 0.1349819266896083 0.1836468652035501 0.2207677935661101 0.2440157903066764 0.2519308493334467 0.2440157903066764 0.2207677935661101 0.1836468652035501 0.1349819266896083 0.0778016867468190 0.0128205128205128 3 | -38.9999999999999929 -8.6942653730764992 2.0057437109865401 -0.8419611281256951 0.4660350178380061 -0.3053301959322752 0.2255859375000000 -0.1834769604930463 0.1625062612197202 -0.1566948863875569 0.1669173300723462 -0.2078198624250458 0.5000000000000284 4 | 52.7614238618854188 -0.0000000000000014 -7.0978372191905041 2.4366553254106518 -1.2619998726206560 0.8020450171514799 -0.5829344906221523 0.4695323345991488 -0.4133384228491517 0.3970011563422655 -0.4218585500750061 0.5244884459770810 -1.2611613952205385 5 | -21.1176537432532108 12.3143826726188426 -0.0000000000000026 -5.3529654960341233 2.1514929403388026 -1.2456912330433414 0.8648651295090918 -0.6788333167741210 0.5882485573596912 -0.5594166098491031 0.5907738391208890 -0.7319028964617775 1.7574041792619788 6 | 12.0606347006751911 -5.7515991079910362 7.2828663584716384 0.0000000000000006 -4.4867527492484713 1.9856340883685184 -1.2442500548652053 0.9273644072345203 -0.7801405924556571 0.7286627836650887 -0.7611026843454750 0.9371007351254138 -2.2445689249231222 7 | -8.0250707637858625 3.5810139729466059 -3.5188440479433885 5.3936695496020670 -0.0000000000000012 -4.0713974423791388 1.9384791997533293 -1.2990656395049711 1.0353900007045651 -0.9378320565227042 0.9621016625090411 -1.1728770342145958 2.7983396009521613 8 | 5.8114203470626897 -2.5155193531810154 2.2519187432266068 -2.6383574301477108 4.5001367659056752 -0.0000000000000001 -3.9479239708828473 2.0057208766898138 -1.4358640069894453 1.2322102992762631 -1.2271720543746818 1.4726326445156968 -3.4921594903866691 9 | -4.4329004329004107 1.8876092211998683 -1.6141880026437749 1.7068898658190650 -2.2121103052236348 4.0759814675861037 -0.0000000000000016 -4.0759814675861028 2.2121103052236353 -1.7068898658190632 1.6141880026437727 -1.8876092211998705 4.4329004329004285 10 | 3.4921594903866513 -1.4726326445156930 1.2271720543746814 -1.2322102992762627 1.4358640069894455 -2.0057208766898147 3.9479239708828469 0.0000000000000006 -4.5001367659056761 2.6383574301477086 -2.2519187432266032 2.5155193531810087 -5.8114203470627004 11 | -2.7983396009521542 1.1728770342146015 -0.9621016625090451 0.9378320565227052 -1.0353900007045647 1.2990656395049704 -1.9384791997533268 4.0713974423791379 0.0000000000000009 -5.3936695496020661 3.5188440479433853 -3.5810139729466033 8.0250707637858838 12 | 2.2445689249231293 -0.9371007351254148 0.7611026843454750 -0.7286627836650880 0.7801405924556555 -0.9273644072345204 1.2442500548652062 -1.9856340883685186 4.4867527492484722 -0.0000000000000030 -7.2828663584716331 5.7515991079910345 -12.0606347006752408 13 | -1.7574041792619965 0.7319028964617793 -0.5907738391208865 0.5594166098491017 -0.5882485573596895 0.6788333167741216 -0.8648651295090932 1.2456912330433414 -2.1514929403388021 5.3529654960341260 -0.0000000000000028 -12.3143826726188355 21.1176537432532605 14 | 1.2611613952205349 -0.5244884459770828 0.4218585500750058 -0.3970011563422655 0.4133384228491512 -0.4695323345991487 0.5829344906221530 -0.8020450171514799 1.2619998726206554 -2.4366553254106527 7.0978372191905059 -0.0000000000000033 -52.7614238618854401 15 | -0.4999999999999982 0.2078198624250502 -0.1669173300723480 0.1566948863875566 -0.1625062612197194 0.1834769604930460 -0.2255859375000002 0.3053301959322756 -0.4660350178380069 0.8419611281256961 -2.0057437109865406 8.6942653730765009 38.9999999999999858 16 | -------------------------------------------------------------------------------- /src/gll_library/gll_14.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9599350452672609 -0.8678010538303472 -0.7288685990913262 -0.5506394029286471 -0.3427240133427129 -0.1163318688837039 0.1163318688837039 0.3427240133427129 0.5506394029286471 0.7288685990913262 0.8678010538303472 0.9599350452672609 1.0000000000000000 2 | 0.0109890109890110 0.0668372844976813 0.1165866558987116 0.1600218517629522 0.1948261493734161 0.2191262530097707 0.2316127944684571 0.2316127944684571 0.2191262530097707 0.1948261493734161 0.1600218517629522 0.1165866558987116 0.0668372844976813 0.0109890109890110 3 | -45.4999999999999787 -10.1205764311033324 2.3223458041907725 -0.9665177627583869 0.5285191068537476 -0.3407095695461010 0.2464954106703681 -0.1951213119926810 0.1667805269449951 -0.1531598261793612 0.1515750330346277 -0.1643706471446394 0.2068846299577670 -0.4999999999999876 4 | 61.5552980047624132 0.0000000000000141 -8.2179801814284055 2.7969381816812224 -1.4310297221351356 0.8948052266632280 -0.6367807393627878 0.4991236349675323 -0.4239663891099915 0.3877427094218838 -0.3826842557888482 0.4142585551810653 -0.5208685759157733 1.2583122252323165 5 | -24.6386623347416034 14.3349155309843059 -0.0000000000000153 -6.1437150940128413 2.4390467767088291 -1.3891661355079667 0.9441303812358730 -0.7209238423952551 0.6025643441499163 -0.5453680474504955 0.5345886155389024 -0.5761689246551056 0.7226059524855212 -1.7438715911435594 6 | 14.0744205564128286 -6.6964304499034881 8.4326002703264589 0.0000000000000072 -5.0849557030655799 2.2130564390481204 -1.3569887173248925 0.9834417553391387 -0.7974670149633368 0.7083094174084423 -0.6859947055249015 0.7337534431406056 -0.9162227896015727 2.2072338895180508 7 | -9.3702101637319153 4.1713545440669533 -4.0758531753467464 6.1909191054119406 0.0000000000000025 -4.5351304202646450 2.1117620792992944 -1.3751029765613878 1.0554757347103323 -0.9080352719777887 0.8623647010599336 -0.9113560712161497 1.1302436894620120 -2.7153980647635585 8 | 6.7939154318680366 -2.9336218244934047 2.6109572123449776 -3.0304534027397843 5.1007841560246776 -0.0000000000000019 -4.2963987320042065 2.1188507980160383 -1.4588998159869722 1.1871221785866115 -1.0920131029770994 1.1325281260796491 -1.3899751754722758 3.3256852669450616 9 | -5.1953256709002602 2.2066510872778240 -1.8756235373162105 1.9640814389985055 -2.5105003512724933 4.5412217970334181 -0.0000000000000026 -4.2980483748597411 2.2395899516811091 -1.6347468966952445 1.4234161812380495 -1.4321980886145951 1.7296247259131969 -4.1125259021188008 10 | 4.1125259021188185 -1.7296247259131943 1.4321980886145911 -1.4234161812380479 1.6347468966952450 -2.2395899516811095 4.2980483748597420 0.0000000000000027 -4.5412217970334181 2.5105003512724942 -1.9640814389985086 1.8756235373162136 -2.2066510872778231 5.1953256709002389 11 | -3.3256852669450936 1.3899751754722749 -1.1325281260796485 1.0920131029770976 -1.1871221785866080 1.4588998159869704 -2.1188507980160378 4.2963987320042065 0.0000000000000019 -5.1007841560246794 3.0304534027397838 -2.6109572123449780 2.9336218244934038 -6.7939154318680188 12 | 2.7153980647636260 -1.1302436894620111 0.9113560712161457 -0.8623647010599271 0.9080352719777846 -1.0554757347103314 1.3751029765613874 -2.1117620792992935 4.5351304202646459 -0.0000000000000051 -6.1909191054119397 4.0758531753467491 -4.1713545440669533 9.3702101637319331 13 | -2.2072338895181041 0.9162227896015687 -0.7337534431406010 0.6859947055248966 -0.7083094174084418 0.7974670149633359 -0.9834417553391372 1.3569887173248918 -2.2130564390481213 5.0849557030655825 -0.0000000000000074 -8.4326002703264606 6.6964304499034801 -14.0744205564128499 14 | 1.7438715911435487 -0.7226059524855238 0.5761689246551057 -0.5345886155389020 0.5453680474504954 -0.6025643441499153 0.7209238423952534 -0.9441303812358731 1.3891661355079681 -2.4390467767088291 6.1437150940128413 0.0000000000000126 -14.3349155309842988 24.6386623347416069 15 | -1.2583122252323129 0.5208685759157717 -0.4142585551810659 0.3826842557888488 -0.3877427094218835 0.4239663891099908 -0.4991236349675314 0.6367807393627880 -0.8948052266632291 1.4310297221351354 -2.7969381816812224 8.2179801814284055 -0.0000000000000146 -61.5552980047624132 16 | 0.5000000000000169 -0.2068846299577623 0.1643706471446396 -0.1515750330346282 0.1531598261793601 -0.1667805269449928 0.1951213119926786 -0.2464954106703667 0.3407095695461007 -0.5285191068537483 0.9665177627583882 -2.3223458041907743 10.1205764311033377 45.5000000000000000 17 | -------------------------------------------------------------------------------- /src/gll_library/gll_15.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9652459265038386 -0.8850820442229763 -0.7635196899518152 -0.6062532054698457 -0.4206380547136725 -0.2153539553637942 0.0000000000000000 0.2153539553637942 0.4206380547136725 0.6062532054698457 0.7635196899518152 0.8850820442229763 0.9652459265038386 1.0000000000000000 2 | 0.0095238095238095 0.0580298930286012 0.1016600703257181 0.1405116998024281 0.1727896472536010 0.1969872359646133 0.2119735859268209 0.2170481163488156 0.2119735859268209 0.1969872359646133 0.1727896472536010 0.1405116998024281 0.1016600703257181 0.0580298930286012 0.0095238095238095 3 | -52.5000000000000568 -11.6566498289210827 2.6634359393255580 -1.1009158403953383 0.5962514664899836 -0.3795214630744722 0.2701411144884149 -0.2094726562500013 0.1744061111098315 -0.1547757308029138 0.1461613292753936 -0.1476280195548957 0.1623677942444749 -0.2061401371756255 0.5000000000000071 4 | 71.0255849776361714 -0.0000000000000165 -9.4247956055456008 3.1857174536369905 -1.6142893556236297 0.9966046918452147 -0.6977282508920307 0.5356855072902413 -0.4431821664710135 0.3916336198395904 -0.3687677050026159 0.3717350614352480 -0.4083212367737014 0.5180027040476843 -1.2560404614662808 5 | -28.4303339144873775 16.5108935078176771 -0.0000000000000176 -6.9971286140124151 2.7509243901299030 -1.5467595736419624 1.0340363728229116 -0.7732388425498720 0.6293171107103195 -0.5501816107288392 0.5143290573702842 -0.5159447608389308 0.5649193803710655 -0.7153203888457919 1.7331637450601178 6 | 16.2426133877035035 -7.7137928598312886 9.6712350497201012 -0.0000000000000137 -5.7340464409861749 2.4631619984964965 -1.4852634222260346 1.0537995090497976 -0.8317421955299917 0.7132267788693254 -0.6583378373483216 0.6548619591350077 -0.7131243871596548 0.9001072142711465 -2.1780637164430487 7 | -10.8177384597708581 4.8067034723977997 -4.6756927618574018 7.0512552567999567 0.0000000000000017 -5.0457577203456623 2.3096870978321946 -1.4717254517469387 1.0988888577920242 -0.9120430918593148 0.8247379073443419 -0.8095693301629908 0.8741951103372945 -1.0980416874888423 2.6517922753993375 8 | 7.8498928200300107 -3.3830564447050602 2.9971639025755596 -3.4531748921915320 5.7523693258033806 0.0000000000000001 -4.6959434483540372 2.2648136419046416 -1.5157462768689502 1.1886703887035377 -1.0397662742045022 0.9998923362464759 -1.0660897088580386 1.3294324744833421 -3.2013285575532535 9 | -6.0125919781595698 2.5486857139498329 -2.1560913466197520 2.2406434061923899 -2.8334605937231583 5.0532003618548282 -0.0000000000000000 -4.5889149646249701 2.3217590740572085 -1.6310608760501497 1.3480866210654860 -1.2547522804225093 1.3122025610936963 -1.6188710359913379 3.8817963218477587 10 | 4.7738927738927757 -2.0036144174072721 1.6508943356566872 -1.6278018041926288 1.8486943064097587 -2.4954588171632062 4.6987710511280092 0.0000000000000002 -4.6987710511280101 2.4954588171632088 -1.8486943064097592 1.6278018041926270 -1.6508943356566823 2.0036144174072668 -4.7738927738927792 11 | -3.8817963218477445 1.6188710359913330 -1.3122025610936976 1.2547522804225071 -1.3480866210654823 1.6310608760501475 -2.3217590740572080 4.5889149646249709 0.0000000000000005 -5.0532003618548273 2.8334605937231561 -2.2406434061923899 2.1560913466197493 -2.5486857139498196 6.0125919781595627 12 | 3.2013285575532322 -1.3294324744833415 1.0660897088580412 -0.9998923362464717 1.0397662742044986 -1.1886703887035368 1.5157462768689522 -2.2648136419046434 4.6959434483540381 -0.0000000000000018 -5.7523693258033779 3.4531748921915306 -2.9971639025755561 3.3830564447050593 -7.8498928200300178 13 | -2.6517922753993304 1.0980416874888366 -0.8741951103372978 0.8095693301629905 -0.8247379073443427 0.9120430918593174 -1.0988888577920264 1.4717254517469387 -2.3096870978321937 5.0457577203456605 -0.0000000000000015 -7.0512552567999531 4.6756927618573965 -4.8067034723978033 10.8177384597708688 14 | 2.1780637164430345 -0.9001072142711438 0.7131243871596555 -0.6548619591350068 0.6583378373483229 -0.7132267788693279 0.8317421955299926 -1.0537995090497967 1.4852634222260335 -2.4631619984964965 5.7340464409861740 0.0000000000000112 -9.6712350497200976 7.7137928598312877 -16.2426133877035390 15 | -1.7331637450601107 0.7153203888457921 -0.5649193803710628 0.5159447608389295 -0.5143290573702851 0.5501816107288394 -0.6293171107103201 0.7732388425498722 -1.0340363728229112 1.5467595736419633 -2.7509243901299039 6.9971286140124196 0.0000000000000127 -16.5108935078176629 28.4303339144874165 16 | 1.2560404614662843 -0.5180027040476837 0.4083212367737015 -0.3717350614352483 0.3687677050026159 -0.3916336198395900 0.4431821664710137 -0.5356855072902414 0.6977282508920303 -0.9966046918452145 1.6142893556236304 -3.1857174536369914 9.4247956055456008 0.0000000000000152 -71.0255849776361714 17 | -0.4999999999999947 0.2061401371756254 -0.1623677942444762 0.1476280195548947 -0.1461613292753930 0.1547757308029137 -0.1744061111098311 0.2094726562500009 -0.2701411144884141 0.3795214630744719 -0.5962514664899836 1.1009158403953383 -2.6634359393255584 11.6566498289210845 52.5000000000000284 18 | -------------------------------------------------------------------------------- /src/gll_library/gll_16.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9695680462702179 -0.8992005330934720 -0.7920082918618151 -0.6523887028824931 -0.4860594218871376 -0.2998304689007632 -0.1013262735219494 0.1013262735219494 0.2998304689007632 0.4860594218871376 0.6523887028824931 0.7920082918618151 0.8992005330934720 0.9695680462702179 1.0000000000000000 2 | 0.0083333333333333 0.0508503610059199 0.0893936973259309 0.1242553821325140 0.1540269808071643 0.1774919133917041 0.1936900238252035 0.2019583081782299 0.2019583081782299 0.1936900238252035 0.1774919133917041 0.1540269808071643 0.1242553821325140 0.0893936973259309 0.0508503610059199 0.0083333333333333 3 | -59.9999999999999574 -13.3024771560273596 3.0289889685455438 -1.2451043509090494 0.6691401562492874 -0.4216063881690200 0.2962460325514836 -0.2260354050209288 0.1844431433534542 -0.1595765376057036 0.1458088604535745 -0.1407663204556334 0.1445146107481471 -0.1607626303673375 0.2055376406366549 -0.4999999999999654 4 | 81.1722918788398431 -0.0000000000001425 -10.7181879178263824 3.6028392047494853 -1.8115224611251668 1.1070150102570615 -0.7650480756894140 0.5779303227523526 -0.4685646741023561 0.4036411250365893 -0.3677117370273140 0.3542495846772394 -0.3631515878821577 0.4035878159912651 -0.5156935626369132 1.2541995872014233 5 | -32.4927027669293835 18.8423135579525400 -0.0000000000000259 -7.9128419979584237 3.0866620062368719 -1.7177729167547824 1.1334562867331257 -0.8338503851077808 0.6649574546252284 -0.5665906604657825 0.5123100607049242 -0.4909963805741528 0.5015319549882165 -0.5560494924084144 0.7094975601639428 -1.7245399104453440 6 | 18.5653100300472715 -8.8037164986111911 10.9986859881823644 0.0000000000000120 -6.4329895837644475 2.7347615524262894 -1.6273536316343455 1.1356606899078923 -0.8780365697792823 0.7335766015910115 -0.6546579634350799 0.6218313696730260 -0.6313065218353049 0.6971189981270708 -0.8873789375668957 2.1548061818690769 7 | -12.3678765604695116 5.4871456137546444 -5.3183752749304798 7.9743343599753471 -0.0000000000000075 -5.6006754343548302 2.5293790256753694 -1.5847718082544633 1.1586716862186774 -0.9365001554132929 0.8182685691305368 -0.7664142524093644 0.7708222114658575 -0.8459957731846165 1.0730306117920221 -2.6018173606938149 8 | 8.9798069441142019 -3.8640082083387592 3.4106521028615520 -3.9064550145002905 6.4538991410478657 -0.0000000000000007 -5.1402998998428968 2.4366817870573332 -1.5960079770852680 1.2180747959793519 -1.0286808103806273 0.9429260590720862 -0.9351425471718342 1.0171957939361385 -1.2834886221155237 3.1055872357642862 9 | -6.8855881323622476 2.9140831466360311 -2.4558686098609686 2.5367284561334742 -3.1807121140638861 5.6094094150195648 0.0000000000000011 -4.9334766192776787 2.4412298315503991 -1.6676090386447284 1.3292376635404943 -1.1776556059447914 1.1435035408626786 -1.2276364196530583 1.5374769731933082 -3.7090060044950661 10 | 5.4779673583689750 -2.2953195988987289 1.8838354166752145 -1.8458444830479768 2.0779335644079504 -2.7725664898139799 5.1440780056144710 -0.0000000000000006 -4.9345543127241278 2.5454416129303481 -1.8160098943762069 1.5192362549500593 -1.4271154867330220 1.5022723812057677 -1.8609608069995722 4.4699790224085802 11 | -4.4699790224085802 1.8609608069995696 -1.5022723812057677 1.4271154867330214 -1.5192362549500593 1.8160098943762084 -2.5454416129303468 4.9345543127241243 0.0000000000000028 -5.1440780056144719 2.7725664898139799 -2.0779335644079486 1.8458444830479748 -1.8838354166752087 2.2953195988987298 -5.4779673583689714 12 | 3.7090060044950448 -1.5374769731933184 1.2276364196530616 -1.1435035408626770 1.1776556059447900 -1.3292376635404939 1.6676090386447275 -2.4412298315503982 4.9334766192776751 -0.0000000000000011 -5.6094094150195621 3.1807121140638857 -2.5367284561334751 2.4558686098609619 -2.9140831466360160 6.8855881323622938 13 | -3.1055872357643146 1.2834886221155291 -1.0171957939361347 0.9351425471718329 -0.9429260590720854 1.0286808103806251 -1.2180747959793528 1.5960079770852684 -2.4366817870573318 5.1402998998428959 0.0000000000000010 -6.4538991410478648 3.9064550145002874 -3.4106521028615511 3.8640082083387610 -8.9798069441142054 14 | 2.6018173606937935 -1.0730306117920319 0.8459957731846157 -0.7708222114658544 0.7664142524093633 -0.8182685691305374 0.9365001554132943 -1.1586716862186783 1.5847718082544646 -2.5293790256753712 5.6006754343548293 0.0000000000000073 -7.9743343599753445 5.3183752749304771 -5.4871456137546426 12.3678765604695258 15 | -2.1548061818690414 0.8873789375669154 -0.6971189981270735 0.6313065218352998 -0.6218313696730230 0.6546579634350798 -0.7335766015910120 0.8780365697792829 -1.1356606899078932 1.6273536316343462 -2.7347615524262885 6.4329895837644449 -0.0000000000000089 -10.9986859881823573 8.8037164986111804 -18.5653100300473142 16 | 1.7245399104452943 -0.7094975601639562 0.5560494924084177 -0.5015319549882158 0.4909963805741535 -0.5123100607049247 0.5665906604657835 -0.6649574546252297 0.8338503851077810 -1.1334562867331257 1.7177729167547828 -3.0866620062368715 7.9128419979584228 0.0000000000000225 -18.8423135579525365 32.4927027669294120 17 | -1.2541995872014020 0.5156935626369126 -0.4035878159912651 0.3631515878821578 -0.3542495846772405 0.3677117370273148 -0.4036411250365904 0.4685646741023571 -0.5779303227523528 0.7650480756894147 -1.1070150102570628 1.8115224611251681 -3.6028392047494862 10.7181879178263824 0.0000000000001423 -81.1722918788398573 18 | 0.5000000000000258 -0.2055376406366478 0.1607626303673297 -0.1445146107481445 0.1407663204556335 -0.1458088604535744 0.1595765376057031 -0.1844431433534541 0.2260354050209288 -0.2962460325514820 0.4216063881690191 -0.6691401562492878 1.2451043509090467 -3.0289889685455402 13.3024771560273596 59.9999999999999218 19 | -------------------------------------------------------------------------------- /src/gll_library/gll_17.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9731321766314183 -0.9108799959155736 -0.8156962512217704 -0.6910289806276847 -0.5413853993301015 -0.3721744335654771 -0.1895119735183174 0.0000000000000000 0.1895119735183174 0.3721744335654771 0.5413853993301015 0.6910289806276847 0.8156962512217704 0.9108799959155736 0.9731321766314183 1.0000000000000000 2 | 0.0073529411764706 0.0449219405432542 0.0791982705036872 0.1105929090070282 0.1379877462019266 0.1603946619976216 0.1770042535156579 0.1872163396776193 0.1906618747534695 0.1872163396776193 0.1770042535156579 0.1603946619976216 0.1379877462019266 0.1105929090070282 0.0791982705036872 0.0449219405432542 0.0073529411764706 3 | -67.9999999999999432 -15.0580524979731543 3.4189873913829367 -1.3990483897791492 0.7471237452751879 -0.4668611263239646 0.3246382564785773 -0.2445186940084455 0.1963806152343744 -0.1666056989393819 0.1485351951430673 -0.1389070696468352 0.1365083554565998 -0.1420115632143515 0.1594554189357394 -0.2050430779964537 0.5000000000000870 4 | 91.9954237055170267 -0.0000000000001429 -12.0980906953316527 4.0481982442230908 -2.0225580130708640 1.2257592929160472 -0.8382884215074676 0.6251032473398006 -0.4987989057515327 0.4213185380789019 -0.3744692206289738 0.3494298335413247 -0.3428574673200466 0.3562844971028607 -0.3997492899763496 0.5138048170709854 -1.2526868823646033 5 | -36.8257928049161833 21.3291734034607074 -0.0000000000000111 -8.8906071670206597 3.4459511192916494 -1.9017560292469975 1.2416938715208581 -0.9016315234013415 0.7075624137968670 -0.5910695161667356 0.5213398433882986 -0.4838568619282827 0.4729331462037958 -0.4901267952467523 0.5489197284406528 -0.7047659121208260 1.7174887026926733 6 | 21.0425770523494862 -9.9662217315544659 12.4148936988942520 0.0000000000000133 -7.1810992462682464 3.0270925321392097 -1.7822014842955933 1.2274098573723751 -0.9336911556183056 0.7646025331553059 -0.6654303804846387 0.6118749972843117 -0.5941680831870191 0.6129732719147435 -0.6844158050914361 0.8771335007393963 -2.1359441768374978 7 | -14.0207733572473714 6.2127374376796665 -6.0039067197928615 8.9599207502710332 -0.0000000000000065 -6.1982232105748718 2.7690818594380180 -1.7118382276223567 1.2310964237727346 -0.9749870014906969 0.8304472411230170 -0.7526075109120335 0.7235586553053601 -0.7413487483079517 0.8239950005702401 -1.0531630782610575 2.5617613217775457 8 | 10.1839564276923724 -4.3765973842649650 3.8514921294753472 -4.3902406391818225 7.2047116081680693 -0.0000000000000012 -5.6256744913992893 2.6304897331423698 -1.6941680481957602 1.2663876877219133 -1.0419961336849755 0.9235564915837952 -0.8748184578140598 0.8874120796295875 -0.9799211186133563 1.2476460136173286 -3.0300735379715178 9 | -7.8148799060837320 3.3030767256565090 -2.7751249544430912 2.8524183528095022 -3.5520492286055823 6.2082384879303270 0.0000000000000001 -5.3231741449034580 2.5888887352997330 -1.7311155696570797 1.3434560649691545 -1.1498995385011386 1.0652590396252537 -1.0650231449905914 1.1651690020506089 -1.4755071588726201 3.5756251418458476 10 | 6.2257937030017985 -2.6051755661549421 2.1313616127677415 -2.0778111620780368 2.3225546899410516 -3.0703681361027728 5.6302894370117933 -0.0000000000000017 -5.2288151784208523 2.6383557234797759 -1.8309905783222649 1.4781568448432310 -1.3228239657254226 1.2943514087008468 -1.3972258561707538 1.7558839529986066 -4.2420180409813213 11 | -5.0921522921523206 2.1170486703261351 -1.7033853828073104 1.6096810163444126 -1.7010434521867956 2.0138653755273914 -2.7886469957442066 5.3250464482630600 -0.0000000000000011 -5.3250464482630600 2.7886469957442093 -2.0138653755273954 1.7010434521867961 -1.6096810163444135 1.7033853828073087 -2.1170486703261404 5.0921522921522850 12 | 4.2420180409813426 -1.7558839529986123 1.3972258561707565 -1.2943514087008459 1.3228239657254242 -1.4781568448432305 1.8309905783222620 -2.6383557234797745 5.2288151784208541 0.0000000000000010 -5.6302894370117933 3.0703681361027741 -2.3225546899410534 2.0778111620780342 -2.1313616127677357 2.6051755661549523 -6.2257937030018056 13 | -3.5756251418458476 1.4755071588726114 -1.1651690020506122 1.0650231449905920 -1.0652590396252526 1.1498995385011392 -1.3434560649691532 1.7311155696570792 -2.5888887352997347 5.3231741449034597 -0.0000000000000004 -6.2082384879303287 3.5520492286055823 -2.8524183528094991 2.7751249544430903 -3.3030767256565290 7.8148799060836964 14 | 3.0300735379715462 -1.2476460136173078 0.9799211186133558 -0.8874120796295855 0.8748184578140573 -0.9235564915837944 1.0419961336849755 -1.2663876877219151 1.6941680481957615 -2.6304897331423720 5.6256744913992911 0.0000000000000013 -7.2047116081680667 4.3902406391818163 -3.8514921294753450 4.3765973842649757 -10.1839564276923724 15 | -2.5617613217775528 1.0531630782610579 -0.8239950005702428 0.7413487483079521 -0.7235586553053601 0.7526075109120347 -0.8304472411230172 0.9749870014906968 -1.2310964237727344 1.7118382276223554 -2.7690818594380162 6.1982232105748709 0.0000000000000070 -8.9599207502710296 6.0039067197928588 -6.2127374376796700 14.0207733572473714 16 | 2.1359441768374658 -0.8771335007394054 0.6844158050914405 -0.6129732719147446 0.5941680831870202 -0.6118749972843133 0.6654303804846398 -0.7646025331553064 0.9336911556183057 -1.2274098573723742 1.7822014842955929 -3.0270925321392088 7.1810992462682428 -0.0000000000000124 -12.4148936988942538 9.9662217315544659 -21.0425770523494649 17 | -1.7174887026926271 0.7047659121208304 -0.5489197284406557 0.4901267952467530 -0.4729331462037956 0.4838568619282836 -0.5213398433883003 0.5910695161667372 -0.7075624137968676 0.9016315234013412 -1.2416938715208579 1.9017560292469973 -3.4459511192916494 8.8906071670206597 0.0000000000000106 -21.3291734034607074 36.8257928049161762 18 | 1.2526868823645998 -0.5138048170709867 0.3997492899763498 -0.3562844971028598 0.3428574673200456 -0.3494298335413247 0.3744692206289747 -0.4213185380789019 0.4987989057515322 -0.6251032473398006 0.8382884215074674 -1.2257592929160466 2.0225580130708658 -4.0481982442230926 12.0980906953316527 0.0000000000001478 -91.9954237055170125 19 | -0.4999999999999964 0.2050430779964642 -0.1594554189357427 0.1420115632143538 -0.1365083554566020 0.1389070696468379 -0.1485351951430706 0.1666056989393832 -0.1963806152343750 0.2445186940084466 -0.3246382564785783 0.4668611263239650 -0.7471237452751889 1.3990483897791506 -3.4189873913829363 15.0580524979731489 67.9999999999999574 20 | -------------------------------------------------------------------------------- /src/gll_library/gll_18.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9761055574121986 -0.9206491853475339 -0.8355935352180902 -0.7236793292832427 -0.5885048343186617 -0.4344150369121240 -0.2663626528782810 -0.0897490934846521 0.0897490934846521 0.2663626528782810 0.4344150369121240 0.5885048343186617 0.7236793292832427 0.8355935352180902 0.9206491853475339 0.9761055574121986 1.0000000000000000 2 | 0.0065359477124183 0.0399706288109141 0.0706371668856337 0.0990162717175028 0.1242105331329671 0.1454119615738022 0.1619395172376025 0.1732621094894562 0.1790158634397031 0.1790158634397031 0.1732621094894562 0.1619395172376025 0.1454119615738022 0.1242105331329671 0.0990162717175028 0.0706371668856337 0.0399706288109141 0.0065359477124183 3 | -76.5000000000001990 -16.9233715963301101 3.8334187142191229 -1.5627233770638354 0.8301597965105014 -0.5152161650495569 0.3552057683584182 -0.2647409079568062 0.2099169007241488 -0.1753404066307110 0.1533714034811259 -0.1400564245464621 0.1334644733956397 -0.1330817791202809 0.1399666216543866 -0.1583760846061306 0.2046320498840702 -0.5000000000000089 4 | 103.4949840588292602 0.0000000000001072 -13.5644565691972456 4.5217205780881757 -2.2472779959139242 1.3526512717955677 -0.9171552039237951 0.6767334318750137 -0.5331093693407218 0.4433296182531885 -0.3865746805883148 0.3522205076564789 -0.3350921186592377 0.3337315871589999 -0.3506962634183626 0.3965908366528735 -0.5122396816647323 1.2514285714360085 5 | -41.4296211311969955 23.9714713252068101 0.0000000000000312 -9.9302500118398438 3.8285793770079803 -2.0984068682830270 1.3582970570342039 -0.9758809857385132 0.7560004784516745 -0.6216962955636709 0.5379102092325209 -0.4873941780766701 0.4618309187650419 -0.4586156124582610 0.4809266172690115 -0.5430950333283081 0.7008659595145684 -1.7116474016094827 6 | 23.6744615059646648 -11.2013227389695356 13.9198155411163214 -0.0000000000000263 -7.9779048870260132 3.3396452152906577 -1.9491228657110256 1.3280457375893351 -0.9971471871590247 0.8037203345698262 -0.6860206015100551 0.6157015011073459 -0.5794463467994755 0.5726008005281304 -0.5983770564590385 0.6741431276368666 -0.8687538210423100 2.1204228752900782 7 | -15.7765324092490147 6.9835178048096012 -6.7322899052561462 10.0078482264894149 0.0000000000000166 -6.8372961416686779 3.0276660179918506 -1.8514431256534436 1.3139897815048798 -1.0240333736948977 0.8552120334615365 -0.7562386052422533 0.7043432457958997 -0.6909137511157295 0.7182965938051084 -0.8064435797485061 1.0370859703115618 -2.5291142864265339 8 | 11.4625447587412665 -4.9209051898474163 4.3197295750975746 -4.9044904770953428 8.0043505067055527 -0.0000000000000096 -6.1496409812894806 2.8438106244698154 -1.8070343165962703 1.3288072539519573 -1.0716413618371521 0.9263647716508639 -0.8496106927972357 0.8245672118869349 -0.8509553879717709 0.9507139481087347 -1.2190551845623248 2.9693216241617932 9 | -8.8008431491399151 3.7158202253455497 -3.1139693079354185 3.1877590464176286 -3.9473204159379240 6.8486105332479985 0.0000000000000019 -5.7528088442586007 2.7595120104346806 -1.8145267013138571 1.3795719459302209 -1.1509730499985955 1.0316555961658243 -0.9859462926406549 1.0069698860835468 -1.1173774569688630 1.4270082975402016 -3.4701424758930344 10 | 7.0180439316546597 -2.9334605298150125 2.3936860105595956 -2.3238605332433950 2.5825904893836071 -3.3884738397816809 6.1550374661386318 -0.0000000000000035 -5.5703437528874673 2.7626110267109163 -1.8771400367020796 1.4760297524762667 -1.2768883725828963 1.1929410271485692 -1.2004226629535608 1.3194110363802978 -1.6756990476881313 4.0657382940822231 11 | -5.7495036507590882 2.3876290391074826 -1.9159329907720306 1.8027861642278959 -1.8937606123567234 2.2246299750689476 -3.0504995546910814 5.7553258442798159 -0.0000000000000005 -5.5710869111508554 2.8543528631388120 -2.0058665711192498 1.6358872773366619 -1.4758669330146346 1.4530812679713483 -1.5755657262951537 1.9855337972145630 -4.8024732861963741 12 | 4.8024732861963457 -1.9855337972145852 1.5755657262951583 -1.4530812679713467 1.4758669330146301 -1.6358872773366584 2.0058665711192472 -2.8543528631388106 5.5710869111508563 0.0000000000000002 -5.7553258442798167 3.0504995546910814 -2.2246299750689524 1.8937606123567285 -1.8027861642278975 1.9159329907720308 -2.3876290391074817 5.7495036507590171 13 | -4.0657382940822373 1.6756990476881299 -1.3194110363802973 1.2004226629535586 -1.1929410271485672 1.2768883725828943 -1.4760297524762649 1.8771400367020807 -2.7626110267109176 5.5703437528874691 0.0000000000000002 -6.1550374661386336 3.3884738397816809 -2.5825904893836031 2.3238605332433919 -2.3936860105595992 2.9334605298150329 -7.0180439316546810 14 | 3.4701424758930699 -1.4270082975401976 1.1173774569688630 -1.0069698860835450 0.9859462926406564 -1.0316555961658240 1.1509730499985944 -1.3795719459302211 1.8145267013138557 -2.7595120104346780 5.7528088442586007 -0.0000000000000005 -6.8486105332479994 3.9473204159379183 -3.1877590464176269 3.1139693079354176 -3.7158202253455532 8.8008431491399435 15 | -2.9693216241617435 1.2190551845623305 -0.9507139481087400 0.8509553879717709 -0.8245672118869404 0.8496106927972379 -0.9263647716508624 1.0716413618371523 -1.3288072539519571 1.8070343165962688 -2.8438106244698154 6.1496409812894806 0.0000000000000089 -8.0043505067055509 4.9044904770953490 -4.3197295750975728 4.9209051898474181 -11.4625447587412665 16 | 2.5291142864264771 -1.0370859703115740 0.8064435797485073 -0.7182965938051054 0.6909137511157306 -0.7043432457959008 0.7562386052422537 -0.8552120334615367 1.0240333736948988 -1.3139897815048815 1.8514431256534434 -3.0276660179918506 6.8372961416686806 -0.0000000000000174 -10.0078482264894184 6.7322899052561453 -6.9835178048096056 15.7765324092489934 17 | -2.1204228752900889 0.8687538210423067 -0.6741431276368666 0.5983770564590337 -0.5726008005281282 0.5794463467994745 -0.6157015011073466 0.6860206015100561 -0.8037203345698265 0.9971471871590259 -1.3280457375893349 1.9491228657110242 -3.3396452152906564 7.9779048870260132 0.0000000000000208 -13.9198155411163178 11.2013227389695391 -23.6744615059646719 18 | 1.7116474016094791 -0.7008659595145666 0.5430950333283163 -0.4809266172690133 0.4586156124582606 -0.4618309187650408 0.4873941780766702 -0.5379102092325218 0.6216962955636716 -0.7560004784516758 0.9758809857385135 -1.3582970570342023 2.0984068682830248 -3.8285793770079808 9.9302500118398456 -0.0000000000000336 -23.9714713252068350 41.4296211311970239 19 | -1.2514285714360014 0.5122396816647350 -0.3965908366528778 0.3506962634183638 -0.3337315871590004 0.3350921186592380 -0.3522205076564786 0.3865746805883146 -0.4433296182531888 0.5331093693407217 -0.6767334318750126 0.9171552039237938 -1.3526512717955672 2.2472779959139246 -4.5217205780881757 13.5644565691972421 -0.0000000000000992 -103.4949840588292602 20 | 0.5000000000000426 -0.2046320498840562 0.1583760846061290 -0.1399666216543872 0.1330817791202812 -0.1334644733956412 0.1400564245464639 -0.1533714034811270 0.1753404066307102 -0.2099169007241466 0.2647409079568040 -0.3552057683584179 0.5152161650495571 -0.8301597965105023 1.5627233770638385 -3.8334187142191229 16.9233715963301066 76.5000000000001990 21 | -------------------------------------------------------------------------------- /src/gll_library/gll_19.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9786117662220801 -0.9289015281525862 -0.8524605777966461 -0.7514942025526130 -0.6289081372652205 -0.4882292856807135 -0.3335048478244986 -0.1691860234092816 0.0000000000000000 0.1691860234092816 0.3335048478244986 0.4882292856807135 0.6289081372652205 0.7514942025526130 0.8524605777966461 0.9289015281525862 0.9786117662220801 1.0000000000000000 2 | 0.0058479532163743 0.0357933651861765 0.0633818917626297 0.0891317570992071 0.1123153414773050 0.1322672804487508 0.1484139425959389 0.1602909240440612 0.1675565845271429 0.1700019192848272 0.1675565845271429 0.1602909240440612 0.1484139425959389 0.1322672804487508 0.1123153414773050 0.0891317570992071 0.0633818917626297 0.0357933651861765 0.0058479532163743 3 | -85.5000000000000711 -18.8984313212658854 4.2722738188112279 -1.7361115742540369 0.9182181625182751 -0.5666231334979628 0.3878726555868784 -0.2865830389547044 0.2248626897522917 -0.1854705810546882 0.1597855787868837 -0.1432362293025365 0.1333812389828229 -0.1290859989387713 0.1302787850366433 -0.1382727932870052 0.1574741558332007 -0.2042866994099458 0.4999999999999769 4 | 115.6709755874781678 0.0000000000001560 -15.1172509985711105 5.0233528562253156 -2.4855986477745611 1.4875614479502939 -1.0014493026142752 0.7325126009039625 -0.5710097233766903 0.4688823880855920 -0.4026754308752853 0.3601424916030970 -0.3347964610857889 0.3236075867651922 -0.3262939492327706 0.3460824116333479 -0.3939590608943194 0.5109278441748603 -1.2503705423266389 5 | -46.3042002466797413 26.7692060122356565 -0.0000000000000787 -11.0316452325995762 4.2343963713097859 -2.3075158867737855 1.4829603931113484 -1.0561405648769420 0.8095633881503513 -0.6573338680009644 0.5600991079222641 -0.4981142350464322 0.4611426662593339 -0.4443671975896202 0.4470452537088059 -0.4733846323289441 0.5382701877931179 -0.6976117061536953 1.7067526929736729 6 | 26.4609974478341314 -12.5090296560773080 15.5134202519407172 0.0000000000000144 -8.8230741280134239 3.6720670834688391 -2.1276570581243575 1.4369162501414241 -1.0674320460116753 0.8494054000963963 -0.7138957392081706 0.6287669989286839 -0.5780302369484626 0.5541493822287793 -0.5553983342478944 0.5865373872095683 -0.6657043974209518 0.8618059042384973 -2.1074889912212456 7 | -17.6352276870376130 7.7995142241653932 -7.5035260256199869 11.1179967255039802 0.0000000000000079 -7.5171328121992333 3.3043740407622857 -2.0026260137563967 1.4060018790032065 -1.0816007858340873 0.8892624941293636 -0.7714996201709423 0.7017095065244257 -0.6675559053397887 0.6653411274520041 -0.6998600229270401 0.7921827343707877 -1.0238717745435935 2.5021243650972167 8 | 12.8157148551185287 -5.4969882322431145 4.8153950986330258 -5.4491725795913686 8.8524924624172385 0.0000000000000099 -6.7105798213397359 3.0750800003258223 -1.9326360109292131 1.4025297618959516 -1.1132464764653831 0.9438658470562312 -0.8450497166613388 0.7950286701237929 -0.7861419729969721 0.8223312782690305 -0.9273191302956011 1.1958276404406334 -2.9196290380427143 9 | -9.8437364169777553 4.1524187105027854 -3.4724744329112331 3.5427773754851897 -4.3664131075121118 7.5297806457559693 0.0000000000000001 -6.2190488955817171 2.9498981679098630 -1.9137562080035864 1.4315838433413295 -1.1709856085260086 1.0241089886750103 -0.9482100162170131 0.9272417556722157 -0.9624823878396236 1.0798036993762230 -1.3882031627498266 3.3850536783269973 10 | 7.8551688821281616 -3.2803599511274970 2.6709481581670995 -2.5840916975611359 2.8580492213928790 -3.7266012659315426 6.7167348074699609 0.0000000000000008 -5.9523217328418463 2.9115577108894168 -1.9456858392537968 1.4992285817179973 -1.2646949602568365 1.1438439520716908 -1.1010462630506339 1.1307489782178481 -1.2597161238751367 1.6128009329753010 -3.9260689513048561 11 | -6.4428053523041839 2.6730216195971970 -2.1401645249830361 2.0066390887533285 -2.0975306630940111 2.4482690505678923 -3.3303802397024751 6.2221283301574184 0.0000000000000018 -5.8679898577667213 2.9553268640308374 -2.0338798078085736 1.6162315686712110 -1.4102639496371223 1.3266378778228849 -1.3420349341600115 1.4806799057311759 -1.8850119154629330 4.5782045183360864 12 | 5.3916906622788687 -2.2269743422780852 1.7630906251518754 -1.6200796771745432 1.6371246089202005 -1.8026586058733383 2.1921271190107485 -3.0879502499073519 5.9536277907517512 -0.0000000000000005 -5.9536277907517530 3.0879502499073506 -2.1921271190107494 1.8026586058733405 -1.6371246089202010 1.6200796771745436 -1.7630906251518674 2.2269743422780790 -5.3916906622788972 13 | -4.5782045183361220 1.8850119154629326 -1.4806799057311772 1.3420349341600084 -1.3266378778228780 1.4102639496371181 -1.6162315686712101 2.0338798078085718 -2.9553268640308370 5.8679898577667222 -0.0000000000000016 -6.2221283301574184 3.3303802397024738 -2.4482690505678906 2.0975306630940076 -2.0066390887533285 2.1401645249830334 -2.6730216195971988 6.4428053523041982 14 | 3.9260689513049201 -1.6128009329752975 1.2597161238751324 -1.1307489782178415 1.1010462630506264 -1.1438439520716899 1.2646949602568387 -1.4992285817179976 1.9456858392537959 -2.9115577108894168 5.9523217328418472 -0.0000000000000001 -6.7167348074699635 3.7266012659315439 -2.8580492213928794 2.5840916975611306 -2.6709481581670933 3.2803599511275094 -7.8551688821281616 15 | -3.3850536783270471 1.3882031627498179 -1.0798036993762177 0.9624823878396200 -0.9272417556722141 0.9482100162170153 -1.0241089886750128 1.1709856085260086 -1.4315838433413290 1.9137562080035873 -2.9498981679098644 6.2190488955817145 0.0000000000000034 -7.5297806457559728 4.3664131075121126 -3.5427773754851875 3.4724744329112314 -4.1524187105027917 9.8437364169777695 16 | 2.9196290380428138 -1.1958276404406090 0.9273191302955935 -0.8223312782690327 0.7861419729969760 -0.7950286701237945 0.8450497166613378 -0.9438658470562276 1.1132464764653842 -1.4025297618959545 1.9326360109292140 -3.0750800003258205 6.7105798213397359 -0.0000000000000106 -8.8524924624172385 5.4491725795913730 -4.8153950986330365 5.4969882322431305 -12.8157148551184790 17 | -2.5021243650973304 1.0238717745435832 -0.7921827343707779 0.6998600229270379 -0.6653411274520026 0.6675559053397871 -0.7017095065244235 0.7714996201709380 -0.8892624941293623 1.0816007858340897 -1.4060018790032089 2.0026260137563989 -3.3043740407622870 7.5171328121992360 -0.0000000000000062 -11.1179967255039784 7.5035260256199825 -7.7995142241653967 17.6352276870376414 18 | 2.1074889912213450 -0.8618059042384905 0.6657043974209380 -0.5865373872095623 0.5553983342478889 -0.5541493822287767 0.5780302369484613 -0.6287669989286816 0.7138957392081701 -0.8494054000963978 1.0674320460116773 -1.4369162501414272 2.1276570581243610 -3.6720670834688418 8.8230741280134204 -0.0000000000000122 -15.5134202519407172 12.5090296560773080 -26.4609974478341385 19 | -1.7067526929737333 0.6976117061536862 -0.5382701877931110 0.4733846323289447 -0.4470452537088039 0.4443671975896181 -0.4611426662593335 0.4981142350464305 -0.5600991079222637 0.6573338680009648 -0.8095633881503519 1.0561405648769433 -1.4829603931113504 2.3075158867737873 -4.2343963713097867 11.0316452325995726 0.0000000000000805 -26.7692060122356565 46.3042002466797413 20 | 1.2503705423266673 -0.5109278441748594 0.3939590608943169 -0.3460824116333456 0.3262939492327683 -0.3236075867651907 0.3347964610857883 -0.3601424916030959 0.4026754308752849 -0.4688823880855922 0.5710097233766904 -0.7325126009039629 1.0014493026142752 -1.4875614479502939 2.4855986477745624 -5.0233528562253174 15.1172509985711141 -0.0000000000001555 -115.6709755874781820 21 | -0.4999999999999716 0.2042866994099454 -0.1574741558331973 0.1382727932870010 -0.1302787850366432 0.1290859989387736 -0.1333812389828240 0.1432362293025361 -0.1597855787868833 0.1854705810546887 -0.2248626897522921 0.2865830389547031 -0.3878726555868778 0.5666231334979634 -0.9182181625182757 1.7361115742540350 -4.2722738188112279 18.8984313212658819 85.5000000000000284 22 | -------------------------------------------------------------------------------- /src/gll_library/gll_20.tab: -------------------------------------------------------------------------------- 1 | -1.0000000000000000 -0.9807437048939142 -0.9359344988126654 -0.8668779780899502 -0.7753682609520559 -0.6637764022903113 -0.5349928640318863 -0.3923531837139093 -0.2395517059229865 -0.0805459372388218 0.0805459372388218 0.2395517059229865 0.3923531837139093 0.5349928640318863 0.6637764022903113 0.7753682609520559 0.8668779780899502 0.9359344988126654 0.9807437048939142 1.0000000000000000 2 | 0.0052631578947368 0.0322371231884889 0.0571818021275669 0.0806317639961196 0.1019914996994508 0.1207092276286747 0.1363004823587242 0.1483615540709168 0.1565801026474755 0.1607432863878457 0.1607432863878457 0.1565801026474755 0.1483615540709168 0.1363004823587242 0.1207092276286747 0.1019914996994508 0.0806317639961196 0.0571818021275669 0.0322371231884889 0.0052631578947368 3 | -94.9999999999998437 -20.9832293303798991 4.7355459208359587 -1.9191999063500100 1.0112769099798640 -0.6210474358840152 0.4225857863978124 -0.3099640207592962 0.2410933451676501 -0.1968007466455786 0.1674609471209525 -0.1479075234780483 0.1352736163357822 -0.1280171464234224 0.1255041260074699 -0.1279536735809302 0.1368529571730698 -0.1567124936303757 0.2039937096688182 -0.5000000000000195 4 | 128.5234002749980391 -0.0000000000003895 -16.7564483026487423 5.5530557844861708 -2.7374590756886015 1.6303972715331676 -1.0910314555483334 0.7922309131539602 -0.6121799902899585 0.4974778929033714 -0.4219663236790192 0.3718303836193784 -0.3394816227121351 0.3208527119341388 -0.3142452458151960 0.3201429543653149 -0.3422252178066653 0.3917418916389593 -0.5098171902659135 1.2494723661714637 5 | -51.4495394641376578 29.7223764540194608 0.0000000000000283 -12.1947006851014734 4.6632929462159707 -2.5289335897042360 1.6154706271023880 -1.1420988973365194 0.8677859232901070 -0.6972669157521467 0.5867640172349046 -0.5140946635158625 0.4673864169290020 -0.4403408696661861 0.4302463348413737 -0.4375423344252401 0.4671165810960309 -0.5342254192299841 0.6948668217633076 -1.7026095323210271 6 | 29.4022100429361259 -13.8893498918618441 17.1956844845641577 -0.0000000000000011 -9.7163662929768773 4.0241072969255338 -2.3174832856167513 1.5535795071108500 -1.1439085808893343 0.9007010864340456 -0.7475535629124760 0.6485761509456360 -0.5854461186479398 0.5486512604901773 -0.5339562893285926 0.5414181563887495 -0.5767824453237156 0.6586786796537856 -0.8559765967442511 2.0965921155405169 7 | -19.5969132454518729 8.6607466448819590 -8.3176154550250772 12.2902776863172107 0.0000000000000042 -8.2371930075336266 3.5986803966004621 -2.1647384533763416 1.5062517842464731 -1.1464148525093369 0.9306477605390331 -0.7952101331953602 0.7100387422939733 -0.6601494902653409 0.6387152739706201 -0.6448548711370561 0.6848423871423422 -0.7804160975982113 1.0128651940502713 -2.4795355415089944 8 | 14.2435696982023359 -6.1048870342419423 5.3385099625995087 -6.0242621472372990 9.7489026899077782 -0.0000000000000074 -7.3073714860891661 3.3232464727862863 -2.0696933359131733 1.4858111483936831 -1.1642406535917449 0.9719779767928125 -0.8540677827036295 0.7850294312553303 -0.7532657055520305 0.7559338535351129 -0.7993555898817866 0.9082383002359531 -1.1766651970322137 2.8784061617690995 9 | -10.9437428395529182 4.6129461611784857 -3.8506905609442823 3.9174895107472176 -4.8092426854879218 8.2512188827206074 0.0000000000000042 -6.7196654673398770 3.1579802719376482 -2.0262783488551559 1.4959836269680999 -1.2045754176298400 1.0335849669441288 -0.9345919050804351 0.8864267649450088 -0.8822175790843507 0.9274438229471377 -1.0496114271436399 1.3565844305345198 -3.3152717734631096 10 | 8.7374813269247085 -3.6460018088869477 2.9632428676087121 -2.8585691125247674 3.1489287052979398 -4.0845428385968967 7.3142808764785388 0.0000000000000020 -6.3703727614533712 3.0811160851700636 -2.0315417813665313 1.5404254469188394 -1.2743620308292989 1.1250457027480429 -1.0497194457543857 1.0328552042838537 -1.0772143840431740 1.2126615914015504 -1.5623609101097846 3.8131867494303506 11 | -7.1725799394551117 2.9734416795776348 -2.3762456566455867 2.2213742343972456 -2.3124383863876643 2.6847391980917310 -3.6278439120802530 6.7232621492644791 0.0000000000000048 -6.2071034622764074 3.0833255989407307 -2.0872320573694636 1.6257579405244151 -1.3837995234874048 1.2608183679666809 -1.2208280557591693 1.2594803245859747 -1.4077379898634907 1.8060308698811378 -4.4002812896201462 12 | 6.0105357680845870 -2.4805635088165183 1.9600812034128485 -1.7955907884326903 1.8068024443137001 -1.9785907973763213 2.3896514179186035 -3.3382551724684064 6.3721391965237091 0.0000000000000016 -6.2076377423914089 3.1653056895316660 -2.2010870970991618 1.7642587936584002 -1.5503692011050074 1.4667436005879095 -1.4902838595876065 1.6494474282929703 -2.1040417662759237 5.1144623665502351 13 | -5.1144623665501783 2.1040417662759121 -1.6494474282929714 1.4902838595876067 -1.4667436005879073 1.5503692011050099 -1.7642587936584051 2.2010870970991618 -3.1653056895316642 6.2076377423914080 -0.0000000000000006 -6.3721391965237126 3.3382551724684069 -2.3896514179186039 1.9785907973763233 -1.8068024443137063 1.7955907884326883 -1.9600812034128452 2.4805635088165157 -6.0105357680844875 14 | 4.4002812896201249 -1.8060308698811387 1.4077379898634894 -1.2594803245859714 1.2208280557591700 -1.2608183679666811 1.3837995234874045 -1.6257579405244158 2.0872320573694649 -3.0833255989407338 6.2071034622764083 -0.0000000000000059 -6.7232621492644800 3.6278439120802544 -2.6847391980917310 2.3124383863876639 -2.2213742343972500 2.3762456566455943 -2.9734416795776304 7.1725799394550904 15 | -3.8131867494302796 1.5623609101098044 -1.2126615914015588 1.0772143840431760 -1.0328552042838550 1.0497194457543830 -1.1250457027480407 1.2743620308293016 -1.5404254469188423 2.0315417813665300 -3.0811160851700614 6.3703727614533703 0.0000000000000012 -7.3142808764785423 4.0845428385968958 -3.1489287052979371 2.8585691125247719 -2.9632428676087201 3.6460018088869472 -8.7374813269246800 16 | 3.3152717734629888 -1.3565844305345367 1.0496114271436585 -0.9274438229471434 0.8822175790843485 -0.8864267649450057 0.9345919050804372 -1.0335849669441310 1.2045754176298396 -1.4959836269680968 2.0262783488551523 -3.1579802719376446 6.7196654673398708 -0.0000000000000010 -8.2512188827206039 4.8092426854879236 -3.9174895107472141 3.8506905609442681 -4.6129461611784945 10.9437428395528400 17 | -2.8784061617690497 1.1766651970322080 -0.9082383002359614 0.7993555898817851 -0.7559338535351069 0.7532657055520302 -0.7850294312553338 0.8540677827036327 -0.9719779767928133 1.1642406535917433 -1.4858111483936829 2.0696933359131733 -3.3232464727862836 7.3073714860891688 0.0000000000000025 -9.7489026899077782 6.0242621472372946 -5.3385099625994981 6.1048870342419574 -14.2435696982023501 18 | 2.4795355415089801 -1.0128651940502633 0.7804160975982117 -0.6848423871423396 0.6448548711370532 -0.6387152739706189 0.6601494902653431 -0.7100387422939787 0.7952101331953629 -0.9306477605390313 1.1464148525093369 -1.5062517842464753 2.1647384533763412 -3.5986803966004608 8.2371930075336284 -0.0000000000000086 -12.2902776863172090 8.3176154550250843 -8.6607466448819572 19.5969132454518871 19 | -2.0965921155405240 0.8559765967442333 -0.6586786796537789 0.5767824453237178 -0.5414181563887508 0.5339562893285913 -0.5486512604901798 0.5854461186479449 -0.6485761509456393 0.7475535629124767 -0.9007010864340446 1.1439085808893368 -1.5535795071108516 2.3174832856167495 -4.0241072969255338 9.7163662929768773 0.0000000000000077 -17.1956844845641754 13.8893498918618388 -29.4022100429360904 20 | 1.7026095323210342 -0.6948668217633094 0.5342254192299806 -0.4671165810960300 0.4375423344252401 -0.4302463348413734 0.4403408696661865 -0.4673864169290025 0.5140946635158642 -0.5867640172349051 0.6972669157521459 -0.8677859232901094 1.1420988973365211 -1.6154706271023880 2.5289335897042382 -4.6632929462159689 12.1947006851014663 -0.0000000000000241 -29.7223764540194679 51.4495394641376436 21 | -1.2494723661714460 0.5098171902659189 -0.3917418916389608 0.3422252178066669 -0.3201429543653174 0.3142452458151965 -0.3208527119341378 0.3394816227121342 -0.3718303836193795 0.4219663236790195 -0.4974778929033714 0.6121799902899605 -0.7922309131539609 1.0910314555483327 -1.6303972715331685 2.7374590756886010 -5.5530557844861681 16.7564483026487423 0.0000000000003907 -128.5234002749980391 22 | 0.4999999999999574 -0.2039937096688269 0.1567124936303687 -0.1368529571730692 0.1279536735809327 -0.1255041260074700 0.1280171464234221 -0.1352736163357842 0.1479075234780500 -0.1674609471209518 0.1968007466455774 -0.2410933451676524 0.3099640207592979 -0.4225857863978102 0.6210474358840120 -1.0112769099798600 1.9191999063500051 -4.7355459208359552 20.9832293303799133 94.9999999999997584 23 | -------------------------------------------------------------------------------- /src/plot_waveform.m: -------------------------------------------------------------------------------- 1 | %% waveform for line AA 2 | clear;clc;close all; 3 | 4 | seism_x = load('seism_data_new_x.dat'); 5 | seism_z = load('seism_data_new_z.dat'); 6 | rec_xz = load('rec_xz_new.dat'); 7 | 8 | seism_x = diff(seism_x,1,2); 9 | seism_z = diff(seism_z,1,2); 10 | 11 | dt = 2e-3; 12 | nt = 12501; 13 | t = linspace(0, (nt-1)*dt, nt); 14 | rec_xz = rec_xz(1,:) - 50000; 15 | 16 | seism_x = seism_x(:,1:nt); seism_x(:,12460:end) = 0.0; 17 | seism_z = seism_z(:,1:nt); seism_z(:,12460:end) = 0.0; 18 | 19 | seism = zeros(2,199,12501); 20 | seism(1,:,:) = seism_x; 21 | seism(2,:,:) = seism_z; 22 | 23 | 24 | % The station is deployed from 0~247.95km along distance 25 | figure 26 | imagesc(t, rec_xz(1,:), seism_x); caxis([-1 1]*1e5); 27 | figure 28 | Plot_Trace(rec_xz(:,1:5:end), t(1:nt), seism(:,1:5:end,1:nt), 0.80,'./California_Observation_data_new/waveform.png'); 29 | 30 | figure 31 | subplot(211) 32 | plot(t(1:nt), squeeze(seism(1,end,1:nt)), 'k-', 'LineWidth',2.0) ; xlabel('Time (s)'); ylabel('Amplitude');title('velocity-x') 33 | subplot(212) 34 | plot(t(1:nt), squeeze(seism(2,end,1:nt)), 'k-', 'LineWidth',2.0) ; xlabel('Time (s)'); ylabel('Amplitude');title('velocity-z') 35 | -------------------------------------------------------------------------------- /src/redblue.m: -------------------------------------------------------------------------------- 1 | 2 | function c = redblue(m) 3 | %REDBLUE Shades of red and blue color map 4 | % REDBLUE(M), is an M-by-3 matrix that defines a colormap. 5 | % The colors begin with bright blue, range through shades of 6 | % blue to white, and then through shades of red to bright red. 7 | % REDBLUE, by itself, is the same length as the current figure's 8 | % colormap. If no figure exists, MATLAB creates one. 9 | % 10 | % For example, to reset the colormap of the current figure: 11 | % 12 | % colormap(redblue) 13 | % 14 | % See also HSV, GRAY, HOT, BONE, COPPER, PINK, FLAG, 15 | % COLORMAP, RGBPLOT. 16 | % Adam Auton, 9th October 2009 17 | if nargin < 1, m = size(get(gcf,'colormap'),1); end 18 | if (mod(m,2) == 0) 19 | % From [0 0 1] to [1 1 1], then [1 1 1] to [1 0 0]; 20 | m1 = m*0.5; 21 | r = (0:m1-1)'/max(m1-1,1); 22 | g = r; 23 | r = [r; ones(m1,1)]; 24 | g = [g; flipud(g)]; 25 | b = flipud(r); 26 | else 27 | % From [0 0 1] to [1 1 1] to [1 0 0]; 28 | m1 = floor(m*0.5); 29 | r = (0:m1-1)'/max(m1,1); 30 | g = r; 31 | r = [r; ones(m1+1,1)]; 32 | g = [g; 1; flipud(g)]; 33 | b = flipud(r); 34 | end 35 | c = [r g b]; 36 | --------------------------------------------------------------------------------