Hi Barry, When using -snes_grid_sequence <n>, how does SNES refines the mesh? Does it detect where should the mesh be refine locally like an adaptive refinement?
Thank you. S. On Tue, Jun 17, 2014 at 4:09 PM, Barry Smith <[email protected]> wrote: > > On Jun 17, 2014, at 3:03 PM, Sang pham van <[email protected]> wrote: > > > Hi Barry, > > > > I want to try the original version of Newton method, no line search nor > trust region… > > This will often fail, original version Newton just doesn’t work without > a good initial solution. > > > Using grid sequencing confuses me at the point that I don't know > explicitly the final mesh size, or even if I can estimate the mesh size > from the input -snes_grid_sequence n it's not so convenient for me when > some of my routines need such info from very first moment. > > To do grid sequencing your code needs to be able to compute the > function on several grids, and compute the Jacobian on several grids. If > your code is hardwired to work on only one grid (with global variables or > whatever) you cannot use grid sequencing and you out of luck. You should > organize your code so that it doesn’t depend on any hardwired grid sizes. > > Barry > > > > > I wish PETSc could allow us to pass in the finest mesh for grid > sequencing. > > > > > > S, > > > > > > On Tue, Jun 17, 2014 at 3:46 PM, Barry Smith <[email protected]> wrote: > > > > On Jun 17, 2014, at 2:30 PM, Sang pham van <[email protected]> wrote: > > > > > Thanks Barry, > > > > > > To refine the grid, I just put more points in the direction. For both > fine and coarse meshes, I used simple initial guess (say constant values in > whole domain for all variables). > > > > > > By using grid sequencing, is the finest mesh is the one I first input > the solver? > > > > No, you pass in the coarse one. > > > > > > Can you let me know what options should I use to have pure Newton > method? > > > > Not sure what you mean by pure Newton method, maybe without grid > sequencing? It simply may not be possible to get convergence from a “poor” > initial guess. One should always use grid sequencing if possible. > > > > Barry > > > > > > > > S. > > > > > > > > > On Tue, Jun 17, 2014 at 3:20 PM, Barry Smith <[email protected]> > wrote: > > > > > > On Jun 17, 2014, at 2:12 PM, Sang pham van <[email protected]> > wrote: > > > > > > > Hi, > > > > > > > > I am using DM structure and SNES to solve a 3D problem. In the > problem I have 3 variables. > > > > > > > > I got SNES converged with a grid. Obtain result are physically > right. However when I refine the grid, SNES does not always converge, > > > > > > With the refined grid how are you starting the solution? Do you use > the interpolated solution from the coarser grid (called grid sequencing) or > just some “not good” initial guess? > > > > > > > the reason of divergence is line search fail or linear solver > failed. (I also tried other type of SNES, line search seems to be the one > best fits my problem) > > > > > > > > Can you please give me a suggestion to figure out the problem with > my solver? What options should I use to have pure Newton method in SNES? Is > there any advance option I can use with line search to improve SNES > convergence. > > > > > > > > > > You should use grid sequencing, not only does it get convergence > when you may not otherwise get it but it will also solve the problem > faster. With PETSc DM you can use -snes_grid_sequence n or > SNESSetGridSequence() in the code to do n levels of grid sequencing. > > > > > > Barry > > > > > > > Thank you very much. > > > > > > > > Minh. > > > > > > > > > > > > > > > >
