Re: [petsc-users] Problems in use of VecNest in Petsc?

2023-07-15 Thread Barry Smith
It is in the loop below that it errors due to an unassembled vector. T static PetscErrorCode VecCopy_Nest(Vec x, Vec y) { Vec_Nest *bx = (Vec_Nest *)x->data; Vec_Nest *by = (Vec_Nest *)y->data; PetscInt i; PetscFunctionBegin; VecNestCheckCompatible2(x, 1, y, 2); for (i = 0; i < bx->

[petsc-users] Problems in use of VecNest in Petsc?

2023-07-15 Thread Rochan Upadhyay
Dear Petsc developers, Is the use of VecNest format supported for field-split type preconditioner or for use with MatNest formats ? A quick change to example snes/tutorials/ex70.c seems to suggest that it is not possible. For example the changes : Vec subx[2], subb[2]; (declared in Stokes struct)

Re: [petsc-users] Using PETSc GPU backend

2023-07-15 Thread Barry Smith
Cho, We currently have a crappy API for turning on GPU support, and our documentation is misleading in places. People constantly say "to use GPU's with PETSc you only need to use -mat_type aijcusparse (for example)" This is incorrect. This does not work with code that uses the

Re: [petsc-users] Using PETSc GPU backend

2023-07-15 Thread Matthew Knepley
On Sat, Jul 15, 2023 at 1:44 AM Ng, Cho-Kuen wrote: > Matt, > > After inserting 2 lines in the code: > > ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr); > > ierr = MatSetFromOptions(A);CHKERRQ(ierr); > ierr = MatCreateAIJ(PETSC_COMM_WORLD,mlocal,mlocal,m,n, > d_nz