Re: [petsc-users] Solving singular systems with petsc

2020-08-17 Thread zakaryah
Hi Nidish, I may not fully understand your problem, but it sounds like you could benefit from continuation methods. Have you looked into this? If it's helpful, I have some experience with this and I can discuss with you by email. Cheers, Zak On Mon, Aug 17, 2020 at 2:31 PM Nidish wrote: >

Re: [petsc-users] TAO STCG initial perturbation

2020-06-11 Thread zakaryah .
or switch to > BNQLS to do a quasi-Gauss-Newton solution. The sub solver’s settings can be > accessed via the -tao_brgn_subsolver_ prefix. So for instance if you wanted > to change type, you could do "-tao_brgn_subsolver_tao_type bntr" for Newton > trust-region. > > Alp &g

Re: [petsc-users] Jacobian test by finite difference

2020-05-20 Thread zakaryah .
. Thanks for your help! On Tue, May 19, 2020 at 5:06 PM Zhang, Hong wrote: > > > On May 19, 2020, at 2:51 PM, zakaryah . wrote: > > I'd like to have one more pass at debugging it myself first. I think Matt > is probably right about the ordering. I need to make sure I understand t

Re: [petsc-users] Jacobian test by finite difference

2020-05-19 Thread zakaryah .
on the residual vector, how do I ensure that the output is in natural ordering? On Tue, May 19, 2020 at 1:17 PM Zhang, Hong wrote: > Can you post your code (at least some essential snippets) for the residual > evaluation and the Jacobian evaluation? > > Hong (Mr.) > > On May 19, 2020, at

Re: [petsc-users] Jacobian test by finite difference

2020-05-19 Thread zakaryah .
ke it should. This makes me think there is not a problem with my routine for calculating the function, but I can't explain why the Jacobian test by finite difference that PETSc calculates would be different, and have non-zero values outside the stencil. On Tue, May 19, 2020 at 10:13 AM zakaryah . wrote:

[petsc-users] Jacobian test by finite difference

2020-05-18 Thread zakaryah .
Hi all, I'm debugging some convergence issues and I came across something strange. I am using a nonlinear solver on a structured grid. The DMDA is 3 dimensional, with 3 dof, and a box stencil of width 1. There are some small errors in the hand-coded Jacobian, which I am trying to sort out, but at

[petsc-users] DMCreateRestriction with DMDA

2020-05-15 Thread zakaryah .
Hi everyone, I am wondering about how to use PETSc to create a restriction on a structured mesh. The documentation for DMCreateRestriction says: For DMDA objects this only works for "uniform refinement", that is the > refined mesh was obtained DMRefine() or the coarse mesh was obtained by >

Re: [petsc-users] Implementing FEM with PLEX/DS/SNES

2018-10-14 Thread zakaryah
Thanks Matt - this is very helpful. On Sun, Oct 14, 2018, 7:13 PM Matthew Knepley wrote: > On Sun, Oct 14, 2018 at 3:56 PM zakaryah wrote: > >> Hi Matt, >> >> > Can you explain more about this source term? It sounds like a bunch of >>>> > del

Re: [petsc-users] Implementing FEM with PLEX/DS/SNES

2018-10-14 Thread zakaryah
Hi Matt, > Can you explain more about this source term? It sounds like a bunch of >> > delta functions. That >> > would still work in this framework, but the convergence rate for a rhs >> > with these singularities >> > is reduced (this is a generic feature of FEM). >> > Can you elaborate on

Re: [petsc-users] Fwd: Implementing a homotopy solver

2018-10-05 Thread zakaryah
is truly in its nullspace, then I can just add u to the nullspace of A and let PETSc take care of the projection? I will try this - thanks for the excellent suggestion. On Fri, Oct 5, 2018 at 4:42 PM Matthew Knepley wrote: > On Fri, Oct 5, 2018 at 4:15 PM zakaryah wrote: > >> Tha

Re: [petsc-users] Fwd: Implementing a homotopy solver

2018-10-05 Thread zakaryah
, "Matthew Knepley" wrote: On Sun, Sep 30, 2018 at 6:06 PM zakaryah wrote: > OK, thanks. > > I'm using a composite DM, DM_packer. To make a separate KSP, I did the > following in the FormJacobian() routine, after assembling the Jacobian > matrix A and the RHS

Re: [petsc-users] Fwd: Implementing a homotopy solver

2018-09-30 Thread zakaryah
OK, thanks. I'm using a composite DM, DM_packer. To make a separate KSP, I did the following in the FormJacobian() routine, after assembling the Jacobian matrix A and the RHS for the tangent vector, b: - KSPCreate(PETSC_COMM_WORLD,) - KSPSetDM(ksp,DM_packer) -

Re: [petsc-users] Fwd: Implementing a homotopy solver

2018-09-29 Thread zakaryah
to use a preconditioner even with -pc_type none, etc. This makes me think I am doing something seriously wrong. On Sat, Sep 29, 2018, 8:16 AM Matthew Knepley wrote: > On Fri, Sep 28, 2018 at 11:13 PM zakaryah wrote: > >> I'm working on a homotopy solver which follows a zero c

Re: [petsc-users] Fwd: Implementing a homotopy solver

2018-09-28 Thread zakaryah
debugging that without knowing how to properly set the options. I hope someone can help me see what I'm doing wrong. On Sun, Jul 22, 2018 at 9:09 PM zakaryah wrote: > ​Thanks Matt and Barry, > > Matt - if I do the calculation in FormJacobian(), which makes by far the > most sense and is

Re: [petsc-users] Basic question about local submatrix from DMComposite

2018-09-17 Thread zakaryah
That worked - thanks Matt On Mon, Sep 17, 2018 at 1:19 PM Matthew Knepley wrote: > On Mon, Sep 17, 2018 at 12:12 PM zakaryah wrote: > >> I'm still working on implementing a homotopy solver for systems of >> nonlinear equations. It seems that everything is working in serial,

[petsc-users] Basic question about local submatrix from DMComposite

2018-09-17 Thread zakaryah
I'm still working on implementing a homotopy solver for systems of nonlinear equations. It seems that everything is working in serial, but I'm having at least one issue in parallel. To form the (n+1) x (n+1) Jacobian, I use MatGetLocalSubMatrix, with the ISs from the DMComposite. One of the

Re: [petsc-users] Debugging SNES when "everything" looks okay

2018-08-22 Thread zakaryah
In my experience, when debugging issues with convergence of nonlinear solvers, it's very important to be sure that the Jacobian is correct. When you say there are terms which differ by orders of magnitude, can you be more precise? Are those differences significant relative to the magnitude of

Re: [petsc-users] Fwd: Implementing a homotopy solver

2018-07-22 Thread zakaryah
​Thanks Matt and Barry, Matt - if I do the calculation in FormJacobian(), which makes by far the most sense and is as per your suggestion, do I need to set the operators of the SNES's KSP back to whatever they were before I set them? The linear system I want to solve within FormJacobian()

[petsc-users] Fwd: Implementing a homotopy solver

2018-07-22 Thread zakaryah
OK, thanks, I understand now. FormJacobian() has two matrices as arguments, the Jacobian Amat and the preconditioner Pmat, which may be the same. My FormJacobian() routine sets the values of the Jacobian in Pmat. So, to calculate the effective nullspace of the submatrix, I want to solve Pmat u

Re: [petsc-users] Implementing a homotopy solver

2018-07-17 Thread zakaryah
Thanks Matt. > > >> 2) Is there a way to reuse the KSP for (1) to efficiently solve (2), >> given the method which answers question 1) ? >> > > Not really, unless you use some type of factorization for the > preconditioner. > Can you elaborate? ​I know that KSP can efficiently solve linear

Re: [petsc-users] Implementing a homotopy solver

2018-07-16 Thread zakaryah
I'm still working on this, and I have a separate question about the implementation, which is related to calculating and removing the nullspace from the Jacobian. I have a system of n nonlinear equations in n+1 variables, due to the auxiliary variable (homotopy variable). Given a guess, z, I'd

Re: [petsc-users] Equivalent of DMGetRefineLevel and DMGetCoarsenLevel for FAS

2018-07-10 Thread zakaryah
Thanks - that's really helpful! On Tue, Jul 10, 2018 at 5:22 PM, Matthew Knepley wrote: > On Tue, Jul 10, 2018 at 5:21 PM zakaryah wrote: > >> Hi Matt - that sounds like it would work great for me. How do you attach >> the auxDM? >> > > http://www.mcs.an

Re: [petsc-users] Equivalent of DMGetRefineLevel and DMGetCoarsenLevel for FAS

2018-07-10 Thread zakaryah
for me. > > Thanks, > > Matt > > On Tue, Jul 10, 2018 at 5:18 PM zakaryah wrote: > >> Thanks Barry - I thought about that and decided if that was the best way, >> then I must be doing something misguided. >> > > > -- > What most experimente

Re: [petsc-users] Equivalent of DMGetRefineLevel and DMGetCoarsenLevel for FAS

2018-07-10 Thread zakaryah
Thanks Barry - I thought about that and decided if that was the best way, then I must be doing something misguided.

[petsc-users] Equivalent of DMGetRefineLevel and DMGetCoarsenLevel for FAS

2018-07-10 Thread zakaryah
I'm trying to incorporate auxiliary fields (in a DMDA) in a problem in nonlinear elasticity, in a way which is compatible with multi-grid techniques. The advice I got previously was to use DMCoarsenHookAdd and DMRefineHookAdd. I finally managed to make sense of the example that Jed pointed out

Re: [petsc-users] Implementing a homotopy solver

2018-07-06 Thread zakaryah
2018, at 17:30, zakaryah wrote: > > > > ​Thanks for your help, Barry. > > > > I agree about the preconditioning. I still don't understand why I don't > need a particular solver for my shell matrix. My reasoning is that KSP is > easy with M but difficult with A, si

Re: [petsc-users] Implementing a homotopy solver

2018-07-06 Thread zakaryah
ditioner constructed from M will be a good > preconditioner for A. > >Barry > > > > On Jul 6, 2018, at 10:48 AM, zakaryah wrote: > > > > I'm still hoping to get some advice on this. I've done some more > reading and it seems clear that I'll need to impl

Re: [petsc-users] Implementing a homotopy solver

2018-07-06 Thread zakaryah
of problem, or for shell matrices in general? I've only seen examples which provide MATOP_MULT. I suppose I also need a shell preconditioner, which preconditions only M. Thanks in advance for any help you can provide. On Tue, Jul 3, 2018 at 11:28 AM, zakaryah wrote: > I'm hoping to implem

[petsc-users] Implementing a homotopy solver

2018-07-03 Thread zakaryah
I'm hoping to implement a homotopy solver for sparse systems in PETSc. I have a question about the details of implementing the linear algebra steps so that I can take advantage of all the SNES tools. My question doesn't have much to do with homotopy maps, per se. The idea, which as far as I

[petsc-users] Reusing pseudo time-stepper

2018-06-25 Thread zakaryah
I'm interested in using a time-stepper to solve problems arising from multiple data sets (external forces). Currently, I do the following: TSCreate TSSetProblemType TSSetSolution TSSetDM TSSetRHSFunction TSSetRHSJacobian TSSetType TSSetMaxSteps TSSetMaxTime TSSetExactFinalTime

Re: [petsc-users] f2cblashlapack download failure

2018-06-20 Thread zakaryah
Thanks Satish! On Wed, Jun 20, 2018 at 2:42 PM, Satish Balay wrote: > The notice regarding the server says: "ETA is COB 6/20/18" > > This would translate to 5PM CST [but this is just an estimate as the > downtime is unscheduled].. > > Satish > > O

Re: [petsc-users] f2cblashlapack download failure

2018-06-20 Thread zakaryah
Is there an expected time for the ftp site to be back up? On Wed, Jun 20, 2018 at 1:11 PM, Najeeb Ahmad wrote: > Thank you Barry for the useful suggestion. I will try it out. > > On Wed, Jun 20, 2018 at 8:44 PM Smith, Barry F. > wrote: > >> >>Also try running with -ksp_converged_reason to

Re: [petsc-users] Simple KSP with known solution gives infinite solution

2018-05-23 Thread zakaryah
to be working now - sorry for the bother. On Wed, May 23, 2018 at 2:18 PM, Smith, Barry F. <bsm...@mcs.anl.gov> wrote: > > Please email the code to petsc-ma...@mcs.anl.gov > > > > On May 23, 2018, at 1:09 PM, zakaryah <zakar...@gmail.com> wrote: > &g

Re: [petsc-users] Simple KSP with known solution gives infinite solution

2018-05-23 Thread zakaryah
://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.8.2, Nov, 09, 2017 [0]PETSC ERROR: ./KSPtest on a arch-linux2-c-debug named login01.hpc.rockefeller.internal by zakaryah Wed May 23 14:06:24 2018 [0]PETSC ERROR: Configure options --prefix=/ru-auth

Re: [petsc-users] Simple KSP with known solution gives infinite solution

2018-05-23 Thread zakaryah
Additional weird behavior: If I run with -ksp_monitor -ksp_monitor_true_residual -ksp_converged_reason -pc_type jacobi I get: 0 KSP Residual norm 1.389113910577e-03 0 KSP preconditioned resid norm 1.389113910577e-03 true resid norm -nan ||r(i)||/||b|| -nan 1 KSP

[petsc-users] Simple KSP with known solution gives infinite solution

2018-05-23 Thread zakaryah
I'm looking for some help with a terribly simple problem. I am trying to solve a linear system which is very small, as a test. The vectors are derived from a minimal 3D DMDA (3x3x3), with 3 dof, so that the RHS and solution vectors have dimension 81 and the matrix is 81x81. I have checked that

Re: [petsc-users] Leaking Memory From the Future????

2018-03-07 Thread zakaryah .
Your description is really vague and I doubt this has anything to do with PETSc. Did you recompile before executing the second test? Have you stepped through with gdb or other debugger, and have you run with valgrind? If so, one thing to be extra careful about - do you have anything in global

Re: [petsc-users] Matrix-free vs finite differenced Jacobian approximation

2017-12-12 Thread zakaryah .
When you say "Jacobians are bad" and "debugging the Jacobians", do you mean that the hand-coded Jacobian is wrong? In that case, why would you be surprised that the finite difference Jacobians, which are "correct" to approximation error, perform better? Otherwise, what does "Jacobians are bad"

Re: [petsc-users] Auxiliary fields for multigrid

2017-11-18 Thread zakaryah .
Ok, thanks for the suggestions. ​I'd like to check that I understand the approach. I create one DMDA for the variables to be solved by the SNES. That DMDA will be coarsened and refined by the options I pass to e.g. FAS. In my user context struct, I can have a second DMDA for the auxiliary

[petsc-users] Auxiliary fields for multigrid

2017-11-16 Thread zakaryah .
I have equations which depend on some external data. I'm not sure about the approach for making this compatible with multigrid - i.e. making sure those external fields are properly refined/coarsened. Are there PETSc examples that do this?

Re: [petsc-users] Newton LS - better results on single processor

2017-11-10 Thread zakaryah .
, 2017, at 3:33 PM, zakaryah . <zakar...@gmail.com> wrote: > > > > Hi Stefano - when I referred to the iterations, I was trying to point > out that my method solves a series of nonlinear systems, with the solution > to the first problem being used to initialize the

Re: [petsc-users] Newton LS - better results on single processor

2017-11-09 Thread zakaryah .
The SNES residual with -n 2 typically looks discontinuous across that boundary. On Thu, Nov 9, 2017 at 11:16 AM, zakaryah . <zakar...@gmail.com> wrote: > Thanks Stefano, I will try what you suggest. > > ​Matt - my DM is a composite between the redundant field (loading > coeff

Re: [petsc-users] Newton LS - better results on single processor

2017-11-09 Thread zakaryah .
indexing of the DA vector is not so simple, but I don't know for a fact that I'm doing this incorrectly nor how to do this properly. ​Thanks for all the help!​ On Nov 9, 2017 8:44 AM, "Matthew Knepley" <knep...@gmail.com> wrote: On Thu, Nov 9, 2017 at 12:14 AM, zakaryah . <zakar.

[petsc-users] Newton LS - better results on single processor

2017-11-08 Thread zakaryah .
Well the saga of my problem continues. As I described previously in an epic thread, I'm using the SNES to solve problems involving an elastic material on a rectangular grid, subjected to external forces. In any case, I'm occasionally getting poor convergence using Newton's method with line

Re: [petsc-users] SNES update solution vector

2017-11-03 Thread zakaryah .
Hi Bikash, I agree with Barry. If your function changes, quasi Newton methods build up the approximation to the Jacobian from sequential evaluations of the function. If your Jacobian doesn't change too much when the boundary conditions change, just keep the last approximation and update it with

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-11-03 Thread zakaryah .
Hi - I think I managed to get this to work. The second call to FormCoupleLocations is actually pretty simple - it just has to set the matrix values! One thing that was hard to figure out was why line 168 calls MatGetOwnershipRange

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-11-02 Thread zakaryah .
ion and we'll look at why it is failing. > > Barry > > > > On Nov 2, 2017, at 4:03 PM, zakaryah . <zakar...@gmail.com> wrote: > > > > I ran MatView with the smallest possible grid size. The elements which > are nonzero after the first assembly but not a

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-11-02 Thread zakaryah .
ations go from 0 to nrows-1? What is the general idea behind setting the structure from within FormCoupleLocations? I'm currently not doing that at all. Thanks for all the help! On Thu, Nov 2, 2017 at 12:31 PM, Smith, Barry F. <bsm...@mcs.anl.gov> wrote: > > > > On Nov 1, 201

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-11-01 Thread zakaryah .
31, 2017 at 10:40 PM, zakaryah . <zakar...@gmail.com> wrote: > Thanks Barry, that looks like exactly what I need. I'm looking at pack.c > and packm.c and I want to check my understanding of what my coupling > function should do. The relevant line in *DMCreateMatrix_Com

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-31 Thread zakaryah .
Thanks Barry, that looks like exactly what I need. I'm looking at pack.c and packm.c and I want to check my understanding of what my coupling function should do. The relevant line in *DMCreateMatrix_Composite_AIJ *seems to be:

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-31 Thread zakaryah .
First I set up the composite DM, which contains one redundant field coupled to everything else, and a DMDA, which of course only has local couplings given by the stencil. I then create the matrix with DMCreateMatrix, with the composite, packer, as the first argument. I immediately call

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-31 Thread zakaryah .
OK Barry, I'll have a look - thanks. Should I use DMShellSetCreateMatrix to set the routine I write for matrix allocation?

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-30 Thread zakaryah .
to false, as you suggested several messages ago, and this was great for testing, but now the first assembly of the Jacobian is terribly slow due to allocating on the fly. Thanks! On Sun, Oct 29, 2017 at 7:07 PM, Matthew Knepley <knep...@gmail.com> wrote: > On Sun, Oct 29, 2017 at 5:15 PM,

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-29 Thread zakaryah .
Good point, Jed - I feel silly for missing this. Can I use -snes_type test -snes_test_display with the Jacobian generated from a DMComposite? When I try, it looks like the finite difference Jacobian is missing all the elements in the row corresponding to the redundant variable, except the

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-25 Thread zakaryah .
a lexicographic ordering so simple for you > to write), but you can use MatSetValuesLocal on the J_hr/J_rh blocks. > > "zakaryah ." <zakar...@gmail.com> writes: > > > Well I made a little progress by considering SNES ex28.c. In the > Jacobian > > routine

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-24 Thread zakaryah .
, zakaryah . <zakar...@gmail.com> wrote: > I see - I use a local variable to add up the terms on each process, then > call MPI_Reduce within the function on process 0, which owns the redundant > variable. > > I have one more question - for the calculation of the Jacobian, my lif

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-24 Thread zakaryah .
I see - I use a local variable to add up the terms on each process, then call MPI_Reduce within the function on process 0, which owns the redundant variable. I have one more question - for the calculation of the Jacobian, my life is made much much easier by using MatSetValuesStencil. However,

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-23 Thread zakaryah .
, but since the matrix always has the same non-zero structure, this is not an issue for the many repeated uses of the matrix that will occur? Thanks so much for all the help. On Mon, Oct 23, 2017 at 3:37 PM, Barry Smith <bsm...@mcs.anl.gov> wrote: > > > On Oct 23, 2017, at 2:13 PM, za

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-23 Thread zakaryah .
asz Kaczmarczyk <lukasz.kaczmarc...@glasgow.ac.uk> writes: > > > On 22 Oct 2017, at 03:16, zakaryah . <zakar...@gmail.com<mailto:zak > ar...@gmail.com>> wrote: > > > > OK, it turns out Lukasz was exactly correct. With whatever method I > try, the solver

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-21 Thread zakaryah .
, e.g. Crisfield 1983, but I'm interested in whether there is a straightforward way to implement Riks' method in PETSc. I'm sure I'm missing something so hopefully someone can give me some hints. Thanks for all the help! On Thu, Oct 12, 2017 at 2:02 PM, zakaryah . <zakar...@gmail.com>

Re: [petsc-users] DMDA and boundary conditions

2017-10-15 Thread zakaryah .
? In other words - would there be changes in other source files as well or would they be limited to da3.c? Thanks again. On Sun, Oct 15, 2017 at 9:06 PM, Barry Smith <bsm...@mcs.anl.gov> wrote: > > > On Oct 15, 2017, at 6:20 PM, zakaryah . <zakar...@gmail.com> wrote: > > > &

[petsc-users] DMDA and boundary conditions

2017-10-15 Thread zakaryah .
For finite difference methods, using a DMDA with DMDA_BOUNDARY_GHOSTED is great for Dirichlet boundary conditions, because I can just set the Dirichlet values on the ghost points, correct? It seems to me that the analogous method for Neumann conditions would be to use a reflecting boundary

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-12 Thread zakaryah .
il.com> wrote: > On Wed, Oct 11, 2017 at 11:33 AM, zakaryah . <zakar...@gmail.com> wrote: > >> Many thanks for the suggestions, Matt. >> >> I tried putting the solvers in a loop, like this: >> >> do { >> NewtonLS >> check convergence >&

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-11 Thread zakaryah .
and NGMRES, I simply used the defaults, as I have no knowledge of how to tune the options for my problem. On Tue, Oct 10, 2017 at 4:08 PM, Matthew Knepley <knep...@gmail.com> wrote: > On Tue, Oct 10, 2017 at 12:08 PM, zakaryah . <zakar...@gmail.com> wrote: > >> Thanks for cle

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-10 Thread zakaryah .
Oct 2017, at 17:08, zakaryah . <zakar...@gmail.com> wrote: > > Thanks for clearing that up. > > I'd appreciate any further help. Here's a summary: > > My ultimate goal is to find a vector field which minimizes an action. The > action is a (nonlinear) function of the fiel

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-10 Thread zakaryah .
eated from the DMDA. If you create the matrix yourself it has a different > MatView in parallel that is in in thePETSc ordering.\ > > >Barry > > > > > On Oct 8, 2017, at 8:05 AM, zakaryah . <zakar...@gmail.com> wrote: > > > > I'm more

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-08 Thread zakaryah .
at 1:49 PM, zakaryah . <zakar...@gmail.com> wrote: > OK - I ran with -snes_monitor -snes_converged_reason > -snes_linesearch_monitor -ksp_monitor -ksp_monitor_true_residual > -ksp_converged_reason -pc_type svd -pc_svd_monitor -snes_type newtonls > -snes_compare_explicit > &

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-07 Thread zakaryah .
ways send the whole error message. > > "zakaryah ." <zakar...@gmail.com> writes: > > > I tried -snes_compare_explicit, and got the following error: > > > > [0]PETSC ERROR: Invalid argument > > > > [0]PETSC ERROR: Matrix not generated from a DMDA

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-03 Thread zakaryah .
: > > >> On Oct 3, 2017, at 5:54 AM, zakaryah . <zakar...@gmail.com> wrote: > >> > >> I'm still working on this. I've made some progress, and it looks like > the issue is with the KSP, at least for now. The Jacobian may be > ill-conditioned. Is it possibl

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-10-02 Thread zakaryah .
econd line doesn't seem to activate the printing of the Jacobian. I also tried it with "true" in the last argument and that didn't work either. On Tue, Sep 5, 2017 at 9:39 AM, Jed Brown <j...@jedbrown.org> wrote: > "zakaryah ." <zakar...@gmail.com> writ

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-09-04 Thread zakaryah .
them. I'm grateful for any advice. On Mon, Sep 4, 2017 at 5:44 PM, zakaryah . <zakar...@gmail.com> wrote: > Yes, it looks like it IS the other way around, and I think the row is > > r.c + r.i*3 + r.j*3*M + r.k*3*M*N, where r.i is in [0,M-1], r.j is in > [0,N-1], an

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-09-04 Thread zakaryah .
OK that is super helpful. Just to be sure - for MxNxP, the row r in the Jacobian is at r.i*P*N*3 + r.j*P*3 + r.k*3 + r.c? On Mon, Sep 4, 2017 at 4:58 PM, Barry Smith <bsm...@mcs.anl.gov> wrote: > > > On Sep 4, 2017, at 3:48 PM, zakaryah . <zakar...@gmail.com> wro

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-09-04 Thread zakaryah .
One piece of information that would be useful is what ordering PETSc uses for the Jacobian in the snes_test_display. Is it a natural ordering, or the PETSc ordering? For debugging the Jacobian manually, the natural ordering is much easier to work with. For -n 1, are the orderings the same? If

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-09-01 Thread zakaryah .
? On Wed, Aug 30, 2017 at 12:37 PM, Matthew Knepley <knep...@gmail.com> wrote: > On Wed, Aug 30, 2017 at 12:21 AM, zakaryah . <zakar...@gmail.com> wrote: > >> ​OK, this is very helpful (and not totally clear from the "Why is >> Newton's method not conver

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-08-29 Thread zakaryah .
​OK, this is very helpful (and not totally clear from the "Why is Newton's method not converging" FAQ at this address: https://scicomp.stackexchange.com/questions/30/why-is-newtons-method-not-converging. Here's the output, using the intermediate grid and the options -snes_type newtonls

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-08-29 Thread zakaryah .
I figured out the cause of my problems with the debugger and the Jacobian evaluation - I had a silly memory corruption issue which is now fixed. I am still having trouble with convergence. I am using a test problem of intermediate size, which has nearly identical Jacobians when comparing finite

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-08-28 Thread zakaryah .
! On Mon, Aug 28, 2017 at 7:46 AM, Barry Smith <bsm...@mcs.anl.gov> wrote: > > > On Aug 28, 2017, at 12:13 AM, zakaryah . <zakar...@gmail.com> wrote: > > > > Any clues on what I should test with the debugger? Just running with > "-snes_type test -sne

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-08-27 Thread zakaryah .
Any clues on what I should test with the debugger? Just running with "-snes_type test -snes_test_display -start_in_debugger noxterm" the debugger reports a PETSc error: MatSetValues_SeqAIJ(), Inserting a new nonzero at (7,0) in the matrix (7,0) is certainly within the allocated space,

Re: [petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-08-26 Thread zakaryah .
ptions you suggested (-snes_fd_color -snes_type newtonls -snes_monitor -snes_linesearch_monitor -ksp_monitor -pc_type lu). The output is 1800 lines long - how shall I share it? On Sat, Aug 26, 2017 at 7:38 PM, Barry Smith <bsm...@mcs.anl.gov> wrote: > > > On Aug 26, 2017, at 5

[petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods

2017-08-26 Thread zakaryah .
I'm using PETSc's SNES methods to solve PDEs which result from Euler-Lagrange equations for the strain energy of a 3D displacement field. There is an additional term in the Lagrangian which describes external forces which arise from various data sets, and that term contains nonlinearities (field