<div dir="ltr">Hi Everyone,<div><br></div><div>I'm trying to use TS with ViennaCL vecs/mats and residual evaluation on device and have encountered some problems. I have attached a small test code that illustrates the issue.</div>
<div><br></div><div>The code simply advects a blob diagonally using TS. I have written the residual evaluation function using 1) the usual Petsc vectors (VecGetArray) and 2) using ViennaCL vectors (VecViennaCLGetArrayRead/Write).</div>
<div><br></div><div>Run the code using the following: </div><div>./petsc_opencl -ts_monitor -snes_monitor -ts_max_steps 1000 -ts_type theta -ts_dt 10 -snes_rtol 1e-4 -ts_final_time 1000 -ts_monitor_draw_solution<br></div>
<div><br></div><div>Case 1) No ViennaCL anywhere. I simply use the usual Petsc vectors and set the residual evaluation function as ComputeResidual (line no. 55). This case works and the blob is indeed advected as can be seen. (I haven't bothered with the boundaries. The simulation just stops before the blob hits the boundaries).</div>
<div><br></div><div>Case 2) We again use the ComputeResidual but now enable ViennaCL vecs and mats (line nos. 48, 49). This case does NOT work. The SNES monitor shows convergence but the solution makes no sense.</div><div>
<br></div><div>Case 3) We now use ComputeResidualViennaCL (line no. 56). This does NOT work either with or without enabling the ViennaCL vecs (line nos. 48, 49).</div><div><br></div><div>Cheers,</div><div>Mani</div></div>