[petsc-users] Question Regarding Duplicate Indices in VecSetValues().

Venkata Narayana Sarma Dhavala dhavala at udel.edu
Tue Jan 14 07:20:19 CST 2025


Dear PETSc Development Team,

I hope this message finds you well. I am currently working with the
VecSetValues() function in PETSc, and I have a question regarding its
behavior when there are duplicate indices in the input array.

PetscErrorCode VecSetValues(Vec x, PetscInt ni, const PetscInt ix[], const
PetscScalar y[], InsertMode iora)

Specifically, what is the expected behavior if the ix[] array passed to
VecSetValues() contains duplicate indices? Does the function overwrite the
value at those indices, or does it handle duplicates differently depending
on the insert mode (INSERT_VALUES or ADD_VALUES)?

I would greatly appreciate any clarification on this matter, as it will
help me better understand how to manage values when working with
potentially repeated indices in the input.

Thank you for your time and assistance.

Best regards,

Narayana Dhavala.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250114/773a75fa/attachment.html>


More information about the petsc-users mailing list