[petsc-users] MetSetValues not found

Barry Smith bsmith at petsc.dev
Sat Aug 19 22:01:45 CDT 2023


   You are attempting to pass the entire aA array into each MatSetValues() call when you should pass one row with each call. Use

      PetscCallA(MatSetValues(A,1,i,4,j,aA(i+1,:),INSERT_VALUES,ierr))


> On Aug 19, 2023, at 4:47 PM, Sanjay Govindjee <s_g at berkeley.edu> wrote:
> 
> I recently got a copy of E.Bueler's petsc book and was converting the
> programs to fortran for my students and have run into a compile error that
> I can not figure out.  I comment out the MatSetValues line the code compiles fine.
> 
> When I run make on vecmatkspf.F90, I get the error:
>    42 |       PetscCallA(MatSetValues(A,1,i,4,j,aA,INSERT_VALUES,ierr))
>       |                                                         1
> Error: There is no specific subroutine for the generic 'matsetvalues' at (1)
> My petsc set works, runs with my FEA code and compiles and runs the fortran
> programs in the petsc tutorials directories just fine.  And in particular, compiles
> and runs the C versions from Bueler.
> 
> I've attached the make file and the source.  I must be doing something obviously wrong but I can not spot it.
> 
> -sanjay
> -- 
> 
> 
> <vecmatkspf.F90><makefile.txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230819/7b2d5571/attachment.html>


More information about the petsc-users mailing list