<div dir="ltr"><div><div><div>Hi, <br><br></div>I'm trying to solve the Helmholtz equation in 1D for x-rays which roughly like :<br></div>
</div><div><br></div><div>u_dot = a*u_xx + h(t)*u

<br></div><div><br></div><div>I've already <a href="https://github.com/s-sajid-ali/xwp_petsc/blob/master/1d/free_space/ex_modify.c">implemented</a> the case where h(t) is always zero (free-space) in PETSc as per the last box on page 156 of the manual.<br></div><div><br> For the time dependent version of the same the next step is to modify the RHSMatrix by adding h(t) via MatDiagonalSet&Insert. (With h(t)=0, the RHS matrix is just a (scaled) Laplacian matrix)<br></div><div><br></div><div>The h(t) is related to x-ray refractive index at that time. These x-ray indices need to be (preferably) stored in matrix beforehand. Each column of the matrix would be the refractive index to be used in one iteration. Using hdf5 is something I'd like to do because I can make/view the grid using numpy in python and solve the PDE using PETSc in C. <br><div>
<div><br></div><div>PS: I've seen past questions on this thread strongly discouraging users from storing dense matrices in hdf5 format.  </div>

</div><div><br></div>

</div><div>PPS : This 1D x-ray scattering problem is just a stepping stone to doing the same in 2D so if there's a better approach to adopt, I'm be open to new ideas. <br></div><div><div><br clear="all"><div><div>Thank You, <br>Sajid Ali<br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:12.8px">Applied Physics<br></div><div style="font-size:12.8px">Northwestern University</div></div></div></div></div></div></div></div>