[petsc-users] Suggestions for code with dof >> 1 ?
Barry Smith
bsmith at mcs.anl.gov
Tue Oct 22 06:58:53 CDT 2013
Add -snes_monitor -snes_converged_reason -ksp_monitor -ksp_converged_reason -pc_type lu (send the output)
Does it now get stuck at the same time step or does it get past it? The most common cause of this problem is an incorrect Jacobian http://www.mcs.anl.gov/petsc/documentation/faq.html#newton
Barry
On Oct 22, 2013, at 4:16 AM, Christophe Ortiz <christophe.ortiz at ciemat.es> wrote:
> Hi Jed,
>
> I added a third specie to my problem (step by step :-)).
>
> Now my system is the following:
>
> u_t - alpha u_xx +(k.u.v - q.w) = 0
> v_t - beta v_xx +(k.u.v - q.w) = 0
> w_t -(k.u.v - q.w) = 0
>
>
> So I have 2 PDEs and 1 ODE. I put everything under IFunction and IJacobian.
> For the PDEs I defined Dirichlet boundary conditions.
>
> For this simple system, I have lot of problems, it does not converge.
>
> I followed your suggestions and I removed any options from the code, and put TSSetFromOptions(); at the end.
> The default options are thus SNESNEWTONLS, KSPGMRES, LineSearch bt, ARKIMEX 3.
>
> I obtain the following output:
>
> TSAdapt 'basic': step 101 accepted t=1.07438 + 3.223e-01 wlte= 0 family='arkimex' scheme=0:'3' dt=4.190e-01
> TSAdapt 'basic': step 102 accepted t=1.39669 + 4.190e-01 wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01
> TSAdapt 'basic': step 103 accepted t=1.8157 + 5.447e-01 wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01
> TSAdapt 'basic': step 104 accepted t=2.36041 + 7.081e-01 wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 9.206e-01, 1 failures exceeds current TS allowed
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
> [0]PETSC ERROR: !
> [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase -ts_max_snes_failures or make negative to attempt recovery!
>
>
>
> ThenI increase the max number of failures. When I do so, I get the following error message:
>
> TSAdapt 'basic': step 101 accepted t=1.07438 + 3.223e-01 wlte= 0 family='arkimex' scheme=0:'3' dt=4.190e-01
> TSAdapt 'basic': step 102 accepted t=1.39669 + 4.190e-01 wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01
> TSAdapt 'basic': step 103 accepted t=1.8157 + 5.447e-01 wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01
> TSAdapt 'basic': step 104 accepted t=2.36041 + 7.081e-01 wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 9.206e-01 retrying with dt=2.301e-01
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 2.301e-01 retrying with dt=5.753e-02
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 5.753e-02 retrying with dt=1.438e-02
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 1.438e-02 retrying with dt=3.596e-03
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 3.596e-03 retrying with dt=8.990e-04
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 8.990e-04 retrying with dt=2.247e-04
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 2.247e-04 retrying with dt=5.619e-05
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 5.619e-05 retrying with dt=1.405e-05
>
> ...
> ...
> TSAdapt 'basic': step 105 stage rejected t=3.06853 +5.679e-179 retrying with dt=1.420e-179
> TSAdapt 'basic': step 105 stage rejected t=3.06853 +1.420e-179 retrying with dt=3.550e-180
> TSAdapt 'basic': step 105 stage rejected t=3.06853 +3.550e-180 retrying with dt=8.874e-181
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
> [0]PETSC ERROR: Floating point exception!
> [0]PETSC ERROR: Vec entry at local location 15 is not-a-number or infinite at end of function: Parameter number 3!
>
> It seems it is not able to recover, it decreases the timestep so much that at the end you are left with something that it not a number, or 0.
>
> Any idea how to solve that ?
> Some time ago you told me it could be due to a problem associated with DAE formulation for boundary conditions and methods with explicit stages:
>
> Is your problem similar to ex25? (If I remember
> correctly, that example uses a DAE formulation for boundary conditions
> and thus has trouble with some methods with explicit stages. There may
> be more going on.)
>
> How can I reformulate my problem so I do not use DAE formulation for boundary conditions ? For instance, if I want u=u* at i=0, or Neumann (or Robin) boundary conditions ?
> If due to method with explicit stages, which method do you recommend ? I tried the FullyImplicit option for ARKIMEX, and it's even worse, it gets slower.
>
> Thanks a lot in advance for your help.
> Christophe
>
More information about the petsc-users
mailing list