Range(snes->jacobian, , );
>> PetscInt row=1000, col=1000;
>> PetscScalar v;
>> if (row>=rstart && row> {
>> MatGetValues(snes->jacobian, 1, , 1, , );
>> PetscPrintf(PETSC_COMM_WORLD, "rstart: %d, rend
On Mon, May 29, 2023 at 5:47 PM YuSh Lo wrote:
> Hi,
>
> How to get the offset in global vector for the points not owned by this
> processor?
> I have a parallel DMPlex and a section assigned to it.
> GetSectionGetOffset with a global section returns -1 for the points not
> owned by this
Hi,
How to get the offset in global vector for the points not owned by this
processor?
I have a parallel DMPlex and a section assigned to it.
GetSectionGetOffset with a global section returns -1 for the points not
owned by this processor.
Thanks,
Josh
Perhaps run a very small problem with 2 ranks and use MatView() to see the
matrix before getting the values. Maybe use the debugger (-start_in_debugger)
and step through the code as it gets values. I would say there is very little
chance it is getting the "wrong values" and is more likely
/* Solve J Y = F, where J is Jacobian matrix */
ierr = SNESComputeJacobian(snes, X, snes->jacobian, snes->jacobian_pre);
CHKERRQ(ierr);
PetscInt rstart, rend;
MatGetOwnershipRange(snes->jacobian, , );
PetscInt row=1000, col=1000;
PetscScalar v;
if (row>=rstart && rowjacobian, 1, , 1, , );