Re: [petsc-users] petsc-users Digest, Vol 173, Issue 131

2023-05-29 Thread Barry Smith
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

Re: [petsc-users] Get global offset in global vector for the points not owned by this processor.

2023-05-29 Thread Matthew Knepley
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

[petsc-users] Get global offset in global vector for the points not owned by this processor.

2023-05-29 Thread YuSh Lo
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

Re: [petsc-users] MatGetValues() can't return the correct values

2023-05-29 Thread Barry Smith
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

[petsc-users] MatGetValues() can't return the correct values

2023-05-29 Thread Waltz Jan
/* 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, , );