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:
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,
"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
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
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
> 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
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