Re: [petsc-users] Neumann Boundary Condition with DMDACreate3D

2024-01-08 Thread Gourav Kumbhojkar
You are right. Attaching the code that I’m using to test this. The output matrix is saved in separate ascii files. You can use “make noflux” to compile the code. Gourav From: Barry Smith Date: Saturday, January 6, 2024 at 7:08 PM To: Gourav Kumbhojkar Cc: petsc-users@mcs.anl.gov Subject: Re:

[petsc-users] SNES seems not use my matrix-free operation

2024-01-08 Thread Yi Hu
Dear PETSc Experts, I am implementing a matrix-free jacobian for my SNES solver in Fortran. (command line option -snes_type newtonls -ksp_type gmres) In the main program, I define my residual and jacobian and matrix-free jacobian like the following, … call DMDASNESSetFunctionLocal(DM_mech,

Re: [petsc-users] SNES seems not use my matrix-free operation

2024-01-08 Thread Barry Smith
"formJacobian" should not be __creating__ the matrices. Here "form" means computing the numerical values in the matrix (or when using a shell matrix it means keeping a copy of X so that your custom matrix-free multiply knows the base location where the matrix free Jacobian-vector products

Re: [petsc-users] Neumann Boundary Condition with DMDACreate3D

2024-01-08 Thread Barry Smith
Ok, I now understand what you are reporting and am working on a fix. From the manual pages I see DMBoundaryType - Describes the choice for the filling of ghost cells on physical domain boundaries. Values: + `DM_BOUNDARY_NONE` - no ghost nodes . `DM_BOUNDARY_GHOSTED` - ghost

[petsc-users] Question about MATMPIAIJ and column indexes ordering

2024-01-08 Thread Deuse, Mathieu via petsc-users
Hello, I have a piece of code which generates a matrix in CSR format, but the without sorting the column indexes in increasing order within each row. This seems not to be 100% compatible with the MATMPIAIJ format: the documentation of MatCreateMPIAIJWithArrays indeed mentions 'row-major

Re: [petsc-users] Question about MATMPIAIJ and column indexes ordering

2024-01-08 Thread Barry Smith
> On Jan 8, 2024, at 4:31 AM, Deuse, Mathieu via petsc-users > wrote: > > Hello, > > I have a piece of code which generates a matrix in CSR format, but the > without sorting the column indexes in increasing order within each row. This > seems not to be 100% compatible with the MATMPIAIJ

Re: [petsc-users] Question about MATMPIAIJ and column indexes ordering

2024-01-08 Thread Barry Smith
Added clarification to the man pages in https://gitlab.com/petsc/petsc/-/merge_requests/7170 > On Jan 8, 2024, at 4:31 AM, Deuse, Mathieu via petsc-users > wrote: > > Hello, > > I have a piece of code which generates a matrix in CSR format, but the > without sorting the column indexes