Re: [petsc-users] log_summary time ratio and flops ratio

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 8:12 AM, Xiangdong wrote: > On Mon, Feb 8, 2016 at 6:45 PM, Jed Brown wrote: > >> Xiangdong writes: >> >> > iii) since the time ratios of VecDot (2.5) and MatMult (1.5) are still >> > high, I rerun the program

[petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Francesco Magaletti
Hi everyone, I’m trying to solve a system of time dependent PDE’s, strongly non linear and quite stiff. The system is 1D, but I need a large number of grid points (1-10 million points). I’m facing some convergence problem of the Newton solver: if I use a small timestep (10^-5) the SNES

Re: [petsc-users] log_summary time ratio and flops ratio

2016-02-10 Thread Jed Brown
Xiangdong writes: >> VecAXPY 1021815 1.0 2.2148e+01 2.1 1.89e+10 1.1 0.0e+00 0.0e+00 >> 0.0e+00 2 4 0 0 0 2 4 0 0 0 207057 >> VecMAXPY 613089 1.0 1.3276e+01 2.2 2.27e+10 1.1 0.0e+00 0.0e+00 >> 0.0e+00 1 4 0 0 0 1 4 0 0 0 414499 >>

Re: [petsc-users] multiplication of two vetors

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 8:06 AM, wen zhao wrote: > Hello > > I have another question about the multiplication of two vector with the > form > > (x) * (x^T), which x is of length n, > > That means, the result is a matrix. Is there some functions in Petsc. > You do not want

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Barry Smith
Francesco, Unfortunately the -snes_grid_sequence option only works with a single SNES nonlinear solve and not directly within an outer time-integration scheme. We do not currently have library code to do grid sequence within a time-step. I believe that providing this requires a

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Jed Brown
Hong Zhang writes: > There is one particular integration method that may make the life easier — > backward Euler. It has only one stage at each time step. > > To Francesco: which TS method are you using? Is it backward Euler or > the default theta method? Default is forward

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Barry Smith
> On Feb 10, 2016, at 4:19 PM, Jed Brown wrote: > > Barry Smith writes: >> We do not currently have library code to do grid sequence within a >> time-step. I believe that providing this requires a great deal of >> "replumbing" of the TS solvers to

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Hong Zhang
There is one particular integration method that may make the life easier — backward Euler. It has only one stage at each time step. To Francesco: which TS method are you using? Is it backward Euler or the default theta method? The default one is not stiffly accurate, thus not good for stiff

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Jed Brown
Francesco Magaletti writes: > First of all thank you everybody for the fast replies. > > Barry, > I think the solution 1 is a good suggestion but I confess I’m a bit scared of > going deep into the modification of the ODE integrator. > I’m now using TSCN, the

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Francesco Magaletti
First of all thank you everybody for the fast replies. Barry, I think the solution 1 is a good suggestion but I confess I’m a bit scared of going deep into the modification of the ODE integrator. I’m now using TSCN, the classical Crank-Nicolson 2nd order full implicit time integration. Maybe

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Michele Rosso
Hong, here if the output of grep -info: using diagonal shift on blocks to prevent zero pivot [INBLOCKS] Replace tiny pivots FALSE tolerance for zero pivot 2.22045e-14 It seems it is not replacing small pivots: could this be the problem? I will also try Barry's

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Michele Rosso
I tried setting -mat_superlu_dist_replacetinypivot true: it does help to advance the run past the previous "critical" point but eventually it stops later with the same error. I forgot to mention my system is singular: I remove the constant null space but I am not sure if the coarse solver needs

Re: [petsc-users] Create DM matrix

2016-02-10 Thread Dave May
I think he wants the source location so that he can copy and implementation and "tweak" it slightly The location is here ${PETSC_DIR}/src/dm/impls/da/fdda.c /Users/dmay/software/petsc-3.6.0/src dmay@nikkan:~/software/petsc-3.6.0/src $ grep -r DMCreateMatrix_DA_3d_MPIAIJ *

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Dave May
On 11 February 2016 at 07:05, Michele Rosso wrote: > I tried setting -mat_superlu_dist_replacetinypivot true: it does help to > advance the run past the previous "critical" point but eventually it stops > later with the same error. > I forgot to mention my system is singular: I

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Barry Smith
You can try the option -mat_superlu_dist_replacetinypivot true if you are luck it get you past the zero pivot but still give an adequate preconditioner. Barry > On Feb 10, 2016, at 9:49 PM, Michele Rosso wrote: > > Hong, > > here if the output of grep -info: > >

Re: [petsc-users] Create DM matrix

2016-02-10 Thread Sang pham van
That is because my matrix has some rows which need more entries than usual. Where can i find source code of DMCreateMatrix()? Pham. On Feb 11, 2016 8:35 AM, "Matthew Knepley" wrote: > On Wed, Feb 10, 2016 at 6:14 PM, Sang pham van > wrote: > >> Hi, >> >>

Re: [petsc-users] Create DM matrix

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 8:44 PM, Sang pham van wrote: > That is because my matrix has some rows which need more entries than usual. > If its only a few, you could just turn off the allocation error. > Where can i find source code of DMCreateMatrix()? > >

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Hong
Michele : Superlu_dist LU is used for coarse grid PC, which likely produces a zero-pivot. Run your code with '-info |grep pivot' to verify. Hong Hi Matt, > > the ksp_view output was an attachment to my previous email. > Here it is: > > KSP Object: 1 MPI processes > type: cg > maximum

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Barry Smith
> On Feb 10, 2016, at 7:38 PM, Matthew Knepley wrote: > > On Wed, Feb 10, 2016 at 4:19 PM, Jed Brown wrote: > Barry Smith writes: > > We do not currently have library code to do grid sequence within a > > time-step. I believe

Re: [petsc-users] Create DM matrix

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 8:59 PM, Sang pham van wrote: > The irregular rows is quite many. The matrix really needs to be > preallocated. > Could you show me how to use DMCreateMatrix_DA_3d_MPIAIJ() directly? > > Just put the declaration right into your source. Matt >

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Barry Smith
> On Feb 10, 2016, at 9:00 PM, Hong wrote: > > Michele : > Superlu_dist LU is used for coarse grid PC, which likely produces a > zero-pivot. > Run your code with '-info |grep pivot' to verify. Michele You can also run with -ksp_error_if_not_converged in or not in

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Jed Brown
Barry Smith writes: >> On Feb 10, 2016, at 4:19 PM, Jed Brown wrote: >> >> Barry Smith writes: >>> We do not currently have library code to do grid sequence within a >>> time-step. I believe that providing this requires a great

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Hong Zhang
The error messages provided by Francesco indicate a theta method is used in his code. So presumably he may happen to be using the default option of the theta method which is not good for stiff problems. I mentioned the one-stage method just in response to the two ways Barry proposed. It might

[petsc-users] Create DM matrix

2016-02-10 Thread Sang pham van
Hi, I am trying to create a DM matrix with DMCreateMatrix_DA_3d_MPIAIJ() instead of using DMCreateMatrix(). Which header file should I include to use that routine? also, what is the source file containing the DMCreateMatrix() routine? Many thanks in advance. Pham

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Emil Constantinescu
Francesco, It could be a problem of ODE stability, error control, nonlinear solver (cold start), etc. In addition to what's been recommended, I would suggest trying a different integrator with better properties: try -ts_type arkimex -ts_arkimex_type 2e -ts_arkimex_fully_implicit In case

[petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Michele Rosso
Hi, I encountered the following error while solving a symmetric positive defined system: Linear solve did not converge due to DIVERGED_PCSETUP_FAILED iterations 0 PCSETUP_FAILED due to SUBPC_ERROR This error appears only if I use the optimized version of both petsc and my code

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Francesco Magaletti
Dear Jed and Emil, your suggestion to use L-stable time integrators gave great results, since the SNES now converges with higher timestep values. The arkimex 2e performs very well, in particular with the extrapolation of the initial guess. Thank you for your time Francesco > Il giorno

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 4:19 PM, Jed Brown wrote: > Barry Smith writes: > > We do not currently have library code to do grid sequence within a > time-step. I believe that providing this requires a great deal of > "replumbing" of the TS solvers to make

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Michele Rosso
Hi Matt, the ksp_view output was an attachment to my previous email. Here it is: KSP Object: 1 MPI processes type: cg maximum iterations=1 tolerances: relative=1e-08, absolute=1e-50, divergence=1. left preconditioning using nonzero initial guess using UNPRECONDITIONED norm

Re: [petsc-users] DIVERGED_PCSETUP_FAILED

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 7:33 PM, Michele Rosso wrote: > Hi, > > I encountered the following error while solving a symmetric positive > defined system: > > Linear solve did not converge due to DIVERGED_PCSETUP_FAILED iterations 0 >PCSETUP_FAILED due to SUBPC_ERROR

Re: [petsc-users] Create DM matrix

2016-02-10 Thread Matthew Knepley
On Wed, Feb 10, 2016 at 6:14 PM, Sang pham van wrote: > Hi, > > I am trying to create a DM matrix with DMCreateMatrix_DA_3d_MPIAIJ() > instead of using DMCreateMatrix(). > Why, that should be called automatically by DMCreateMatrix()? Matt > Which header file should I

Re: [petsc-users] TS and snes_grid_sequence

2016-02-10 Thread Jed Brown
Francesco Magaletti writes: > Dear Jed and Emil, > your suggestion to use L-stable time integrators gave great results, since > the SNES now converges with higher timestep values. > The arkimex 2e performs very well, in particular with the extrapolation of >