Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
I see, it is working now, thanks! On 21 May 2020, at 6:23 PM, Dave May mailto:dave.mayhe...@gmail.com>> wrote: On Thu 21. May 2020 at 12:17, Yang Bo (Asst Prof) mailto:yang...@ntu.edu.sg>> wrote: Hi Dave, Yes it is parallel so the preallocation calls are not lowered by the alloc

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
/MatXAIJSetPreallocation.html If I have the following matrix: 0 1 2 0 1 0 0 0 2 0 1 3 0 0 3 2 How should I put in the parameters of MatXAIJSetPreallocation? Thanks! Cheers, Yang Bo On 21 May 2020, at 5:42 PM, Dave May mailto:dave.mayhe...@gmail.com>> wrote: On Thu 21. May 2020 at 10:49, Yang Bo (Ass

Re: [petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
Hi Dave, Thank you very much for your reply. That is indeed the problem. I have been working with matrices in Slepc but I don’t really understand it. I tried to preallocate but it still does not work. If you look at my code below: ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr); ierr = MatS

[petsc-users] a question about MatSetValue

2020-05-21 Thread Yang Bo (Asst Prof)
Hi Everyone, I have a question about adding values to the matrix. The code I have is for (int i=0;i

[petsc-users] Random initial states of EPSSolve

2020-03-17 Thread Yang Bo (Asst Prof)
Hi everyone, I am diagonalising a large symmetric real matrix for its null space (highly degenerate eigenstates with zero eigenvalues). I am using krylovschur which is variational, which is supposed to start with a set of random initial vectors. They will eventually converge to random vectors i

[petsc-users] ST solver error

2019-08-01 Thread Yang Bo (Asst Prof) via petsc-users
Hi everyone, I am trying to use the Shift-and-invert spectral transformations for my diagonalisation code. While there is no problem running the code with STSetType(st,STSHIFT); I receive the following errors when using STSetType(st,STSINVERT): [0]PETSC ERROR: - Error Messa