Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Matthew Knepley
On Wed, Jun 10, 2020 at 10:09 AM Eda Oktay wrote: > Dear Matt, > > I have one last question I believe. Up to creating a dense matrix I > did what you've suggested. Thank you so much for that. > > I created a new dense matrix. Now, how should I wrap each vector in a > MatDense again? I mean, what

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Eda Oktay
Dear Matt, I have one last question I believe. Up to creating a dense matrix I did what you've suggested. Thank you so much for that. I created a new dense matrix. Now, how should I wrap each vector in a MatDense again? I mean, what is wrapping vectors in a matrix? To put each of them again as

Re: [petsc-users] TAO STCG initial perturbation

2020-06-10 Thread Dener, Alp via petsc-users
Hello, STCG is being used to compute a search direction by inverting the Hessian of the objective onto the gradient. The Hessian has to be positive definitive for this search direction to be a valid descent direction. To enforce this, STCG terminates the KSP solution when it encounters

[petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Eda Oktay
Hi all, I am trying to get all the rows of a parallel matrix as individual vectors. For instance, if I have 72*4 matrix, I want to get 72 different vectors having size 4. As far as I understood, MatGetRow is only for local rows, so MatGetOwnershipRange is used, however, when I tried this one, I

[petsc-users] L infinity norm convergence tests

2020-06-10 Thread Mark Lohry
Hi all, is there a built-in way to use L-infinity norms for the SNES and KSP convergence tests, or do I need to write a manual KSPSetConvergenceTest function? Thanks, Mark

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Eda Oktay
Dear Matt, Matthew Knepley , 10 Haz 2020 Çar, 16:03 tarihinde şunu yazdı: > > On Wed, Jun 10, 2020 at 8:56 AM Eda Oktay wrote: >> >> Hi all, >> >> I am trying to get all the rows of a parallel matrix as individual >> vectors. For instance, if I have 72*4 matrix, I want to get 72 >> different

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Matthew Knepley
On Wed, Jun 10, 2020 at 9:08 AM Eda Oktay wrote: > Dear Matt, > > Matthew Knepley , 10 Haz 2020 Çar, 16:03 tarihinde > şunu yazdı: > > > > On Wed, Jun 10, 2020 at 8:56 AM Eda Oktay wrote: > >> > >> Hi all, > >> > >> I am trying to get all the rows of a parallel matrix as individual > >>

Re: [petsc-users] L infinity norm convergence tests

2020-06-10 Thread Matthew Knepley
On Wed, Jun 10, 2020 at 9:02 AM Mark Lohry wrote: > Hi all, is there a built-in way to use L-infinity norms for the SNES and > KSP convergence tests, or do I need to write a manual KSPSetConvergenceTest > function? > You need to write a custom test. Thanks, Matt > Thanks, > Mark >

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Matthew Knepley
On Wed, Jun 10, 2020 at 8:56 AM Eda Oktay wrote: > Hi all, > > I am trying to get all the rows of a parallel matrix as individual > vectors. For instance, if I have 72*4 matrix, I want to get 72 > different vectors having size 4. > > As far as I understood, MatGetRow is only for local rows, so >

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Eda Oktay
Der Matt, When I looked at the results, I found that there are some problems I couldn't understand. First of all, I am working on a 72*4 matrix and as I said before, I want to have 72 different vectors having size 4 each, whose elements consist of the elements in the same row. And of course, all

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Matthew Knepley
On Wed, Jun 10, 2020 at 12:07 PM Eda Oktay wrote: > Der Matt, > > When I looked at the results, I found that there are some problems I > couldn't understand. > > First of all, I am working on a 72*4 matrix and as I said before, I > want to have 72 different vectors having size 4 each, whose

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Eda Oktay
Matthew Knepley , 10 Haz 2020 Çar, 19:13 tarihinde şunu yazdı: > > On Wed, Jun 10, 2020 at 12:07 PM Eda Oktay wrote: >> >> Der Matt, >> >> When I looked at the results, I found that there are some problems I >> couldn't understand. >> >> First of all, I am working on a 72*4 matrix and as I said

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Matthew Knepley
On Wed, Jun 10, 2020 at 12:26 PM Eda Oktay wrote: > Matthew Knepley , 10 Haz 2020 Çar, 19:13 tarihinde > şunu yazdı: > > > > On Wed, Jun 10, 2020 at 12:07 PM Eda Oktay > wrote: > >> > >> Der Matt, > >> > >> When I looked at the results, I found that there are some problems I > >> couldn't

Re: [petsc-users] MatGetRow for global rows of a parallel matrix

2020-06-10 Thread Barry Smith
You can use MatCreateSubMatrices() with each process getting a single sequential dense sub matrix that consists of the entire matrix. Use VecDuplicateVecs() to create an array of 72 vectors (create a single seq vector of size 4 as the input to this routine) Then use

Re: [petsc-users] TAO STCG initial perturbation

2020-06-10 Thread Dener, Alp via petsc-users
Hi Zak, You got it right with the TaoBRGNGetSubsolver -> TaoGetKSP workflow. This will get you the KSP object correctly. BRGN is not a stand-alone solver. It’s a wrapper that combines the user-provided residual and Jacobian callbacks to assemble the gradient and Hessian under the Gauss-Newton