# Part 1 of final project: Diffusion equation

@views function init()
    nx   = 32             # number of global grid points
    ny   = 32             # number of global grid points
    nz   = 32             # number of global grid points
    xc   = zeros(nx, 1) # global coord vector
    H    = zeros(nx, ny, nz) # global solution as obtained by implicitGlobalGrid's `gather!()`
    inds = Int.(ceil.(LinRange(1, length(xc), 12)))
    xc[inds]          .= [0.15625, 1.09375, 2.03125, 2.96875, 3.90625, 4.843750000000001, 5.468749999999999, 6.40625, 7.34375, 8.28125, 9.21875, 9.84375]
    H[inds, inds, 15] .= [6.711882385110737e-21 2.4514117276084958e-17 1.5437604567532982e-14 1.6762365118986786e-12 3.138212957188894e-11 1.0130275516790658e-10 8.332937341028532e-11 1.4367785881450301e-11 4.2714301545963265e-13 2.1895179117406884e-15 1.9351535299019154e-18 6.711882385110737e-21; 2.4514117276084958e-17 0.0004814874277834956 0.0014445717212427402 0.0032493045299438012 0.005557594231157323 0.006946731379668997 0.006690697700021068 0.004803038520579223 0.0025518750281671872 0.0010411002857436305 0.00029141318932587976 2.4514117276084958e-17; 1.5437604567532982e-14 0.0014445717212427402 0.004624363091812729 0.011159479624478753 0.020196376510907457 0.025913346399889084 0.02484567081606447 0.017173580755691007 0.008566902048912462 0.003255743161934395 0.0008608124023284637 1.5437604567532982e-14; 1.6762365118986786e-12 0.0032493045299438012 0.011159479624478753 0.029095533074715414 0.056125785858625855 0.07421776052483857 0.0707876802440615 0.04685098387699614 0.02177896579933202 0.007659758643077384 0.0019037581454307546 1.6762365118986786e-12; 3.138212957188894e-11 0.005557594231157323 0.020196376510907457 0.056125785858625855 0.11433141121531959 0.15522789812463358 0.1473718066389615 0.0939249428097469 0.04113536620718002 0.013581240422684215 0.0032124500970325837 3.138212957188894e-11; 1.0130275516790658e-10 0.006946731379668997 0.025913346399889084 0.07421776052483857 0.15522789812463358 0.21350368660148342 0.20223719296375614 0.12653170317321735 0.053851078219800314 0.017260273812497083 0.003990509147237947 1.0130275516790658e-10; 8.332937341028532e-11 0.006690697700021068 0.02484567081606447 0.0707876802440615 0.1473718066389615 0.20223719296375614 0.19164191533936806 0.12029222684071515 0.051452364828806635 0.01657647018690786 0.0038475611129833603 8.332937341028532e-11; 1.4367785881450301e-11 0.004803038520579223 0.017173580755691007 0.04685098387699614 0.0939249428097469 0.12653170317321735 0.12029222684071515 0.07752458731237559 0.03454914825401289 0.011616853176862237 0.0027870615866269714 1.4367785881450301e-11; 4.2714301545963265e-13 0.0025518750281671872 0.008566902048912462 0.02177896579933202 0.04113536620718002 0.053851078219800314 0.051452364828806635 0.03454914825401289 0.016437844426928104 0.005928856172534874 0.001503341539029276 4.2714301545963265e-13; 2.1895179117406884e-15 0.0010411002857436305 0.003255743161934395 0.007659758643077384 0.013581240422684215 0.017260273812497083 0.01657647018690786 0.011616853176862237 0.005928856172534874 0.0023115783364469583 0.0006238849765532687 2.1895179117406884e-15; 1.9351535299019154e-18 0.00029141318932587976 0.0008608124023284637 0.0019037581454307546 0.0032124500970325837 0.003990509147237947 0.0038475611129833603 0.0027870615866269714 0.001503341539029276 0.0006238849765532687 0.00017702766887648104 1.9351535299019154e-18; 6.711882385110737e-21 2.4514117276084958e-17 1.5437604567532982e-14 1.6762365118986786e-12 3.138212957188894e-11 1.0130275516790658e-10 8.332937341028532e-11 1.4367785881450301e-11 4.2714301545963265e-13 2.1895179117406884e-15 1.9351535299019154e-18 6.711882385110737e-21]
    return xc, H
end

xc, H = init();
