hypre icon indicating copy to clipboard operation
hypre copied to clipboard

How to zero specified rows of a hypre CSRMatrix?

Open jczhang07 opened this issue 1 year ago • 4 comments

The matrix location might be HOST or DEVICE. I could not find a routine for me to do that. Thanks.

jczhang07 avatar Aug 07 '23 16:08 jczhang07

We don't have it for specified rows. For the whole matrix you can do

hypre_CSRMatrixSetConstantValues(A, value);

liruipeng avatar Aug 07 '23 17:08 liruipeng

Junchao, can you provide more details on why you need this feature? Would you be interested in using it to impose boundary conditions, for example?

Thanks!

victorapm avatar Aug 17 '23 14:08 victorapm

Yes, to impose boundary conditions and to implement PETSc MatZerosRows (https://petsc.org/release/manualpages/Mat/MatZeroRows) with a Hypre CSRMatrix underneath.

jczhang07 avatar Aug 17 '23 15:08 jczhang07

Sounds good, Junchao! I'll bring this up in our next hypre meeting and the team will come up with a plan to implement this functionality.

victorapm avatar Aug 17 '23 15:08 victorapm