Re: [petsc-dev] [petsc-users] Convergence of AMG

2018-10-29 Thread Smith, Barry F. via petsc-dev


   Great, I just didn't understand the name. 

> On Oct 29, 2018, at 3:30 PM, Mark Adams  wrote:
> 
> 
> 
> On Mon, Oct 29, 2018 at 2:35 PM Smith, Barry F.  wrote:
> 
>Why not just stop it once it is equal to or less than the minimum values 
> set by the person.
> 
> That is what it does now. It stops when it is below the value given.
>  
> Thus you need not "backtrack" by removing levels but the user still has some 
> control over preventing a "tiny" coarse problem. For example in this case if 
> the user set a minimum of 1000 it would end up with 642 unknowns on the 
> coarse level
> 
> Yes, that is what it would do now. I thought you wanted something different.
>  
> which is likely better than 6 or 54.
> 
>  
> 
> Barry
> 
> 
> > On Oct 29, 2018, at 8:27 AM, Mark Adams  wrote:
> > 
> > 
> > 
> > On Sun, Oct 28, 2018 at 4:54 PM Smith, Barry F.  wrote:
> > 
> >Moved a question not needed in the public discussions to petsc-dev to 
> > ask Mark.
> > 
> > 
> >Mark,
> > 
> > PCGAMGSetCoarseEqLim - Set maximum number of equations on coarsest grid 
> > 
> >Is there a way to set the minimum number of equations on the coarse grid 
> > also? This particular case goes down to 6, 54 and 642 unknowns on the 
> > coarsest grids when I'm guessing it would be better to stop at 642 unknowns 
> > for the coarsest level. 
> > 
> > No, because I don't know how it is going to coarsen I did not want to 
> > bother with backtracking (I do when there is an error on the coarse grid so 
> > it would be easy to add this but I don't think it is worth the clutter). 
> > 
> 



Re: [petsc-dev] [petsc-users] Convergence of AMG

2018-10-29 Thread Mark Adams via petsc-dev
On Mon, Oct 29, 2018 at 2:35 PM Smith, Barry F.  wrote:

>
>Why not just stop it once it is equal to or less than the minimum
> values set by the person.


That is what it does now. It stops when it is below the value given.


> Thus you need not "backtrack" by removing levels but the user still has
> some control over preventing a "tiny" coarse problem. For example in this
> case if the user set a minimum of 1000 it would end up with 642 unknowns on
> the coarse level


Yes, that is what it would do now. I thought you wanted something different.


> which is likely better than 6 or 54.
>



>
> Barry
>
>
> > On Oct 29, 2018, at 8:27 AM, Mark Adams  wrote:
> >
> >
> >
> > On Sun, Oct 28, 2018 at 4:54 PM Smith, Barry F. 
> wrote:
> >
> >Moved a question not needed in the public discussions to petsc-dev to
> ask Mark.
> >
> >
> >Mark,
> >
> > PCGAMGSetCoarseEqLim - Set maximum number of equations on coarsest
> grid
> >
> >Is there a way to set the minimum number of equations on the coarse
> grid also? This particular case goes down to 6, 54 and 642 unknowns on the
> coarsest grids when I'm guessing it would be better to stop at 642 unknowns
> for the coarsest level.
> >
> > No, because I don't know how it is going to coarsen I did not want to
> bother with backtracking (I do when there is an error on the coarse grid so
> it would be easy to add this but I don't think it is worth the clutter).
> >
>
>


Re: [petsc-dev] [petsc-users] Convergence of AMG

2018-10-29 Thread Smith, Barry F.


   Why not just stop it once it is equal to or less than the minimum values set 
by the person. Thus you need not "backtrack" by removing levels but the user 
still has some control over preventing a "tiny" coarse problem. For example in 
this case if the user set a minimum of 1000 it would end up with 642 unknowns 
on the coarse level which is likely better than 6 or 54.

Barry


> On Oct 29, 2018, at 8:27 AM, Mark Adams  wrote:
> 
> 
> 
> On Sun, Oct 28, 2018 at 4:54 PM Smith, Barry F.  wrote:
> 
>Moved a question not needed in the public discussions to petsc-dev to ask 
> Mark.
> 
> 
>Mark,
> 
> PCGAMGSetCoarseEqLim - Set maximum number of equations on coarsest grid 
> 
>Is there a way to set the minimum number of equations on the coarse grid 
> also? This particular case goes down to 6, 54 and 642 unknowns on the 
> coarsest grids when I'm guessing it would be better to stop at 642 unknowns 
> for the coarsest level. 
> 
> No, because I don't know how it is going to coarsen I did not want to bother 
> with backtracking (I do when there is an error on the coarse grid so it would 
> be easy to add this but I don't think it is worth the clutter). 
> 



Re: [petsc-dev] [petsc-users] Convergence of AMG

2018-10-29 Thread Mark Adams
On Sun, Oct 28, 2018 at 4:54 PM Smith, Barry F.  wrote:

>
>Moved a question not needed in the public discussions to petsc-dev to
> ask Mark.
>
>
>Mark,
>
> PCGAMGSetCoarseEqLim - Set maximum number of equations on coarsest
> grid


>Is there a way to set the minimum number of equations on the coarse
> grid also? This particular case goes down to 6, 54 and 642 unknowns on the
> coarsest grids when I'm guessing it would be better to stop at 642 unknowns
> for the coarsest level.
>

No, because I don't know how it is going to coarsen I did not want to
bother with backtracking (I do when there is an error on the coarse grid so
it would be easy to add this but I don't think it is worth the clutter).


Re: [petsc-dev] [petsc-users] Convergence of AMG

2018-10-28 Thread Smith, Barry F.


   Moved a question not needed in the public discussions to petsc-dev to ask 
Mark.


   Mark,

PCGAMGSetCoarseEqLim - Set maximum number of equations on coarsest grid

   Is there a way to set the minimum number of equations on the coarse grid 
also? This particular case goes down to 6, 54 and 642 unknowns on the coarsest 
grids when I'm guessing it would be better to stop at 642 unknowns for the 
coarsest level. 

   Barry



> On Oct 28, 2018, at 12:16 PM, Manav Bhatia  wrote:
> 
> Hi, 
> 
>I am attempting to solve a Mindlin plate bending problem with AMG solver 
> in petsc. This test case is with a mesh of 300x300 elements and 543,606 dofs. 
> 
>The discretization includes 6 variables (u, v, w, tx, ty, tz), but only 
> three are relevant for plate bending (w, tx, ty). 
> 
>I am calling the solver with the following options: 
> 
> -pc_type gamg -pc_gamg_threshold 0. --node-major-dofs -mat_block_size 6 
> -ksp_rtol 1.e-8 -ksp_monitor -ksp_converged_reason -ksp_view 
> 
>   And the convergence behavior is shown below, along with the ksp_view 
> information. Based on notes in the manual, this seems to be subpar 
> convergence rate. At the end of the solution the norm of each variable is : 
> 
> var: 0: u  : norm: 5.505909e-18
> var: 1: v  : norm: 7.639640e-18
> var: 2: w : norm: 3.901464e-03
> var: 3: tx : norm: 4.403576e-02
> var: 4: ty : norm: 4.403576e-02
> var: 5: tz : norm: 1.148409e-16
> 
>   I tried different values of -ksp_rtol from 1e-1 to 1e-8 and this does not 
> make a lot of difference in the norms of (w, tx, ty). 
>  
>   I do provide the solver with 6 rigid-body vectors to approximate the 
> null-space of the problem. Without these the solver shows very poor 
> convergence. 
> 
>   I would appreciate advice on possible strategies to improve this behavior. 
> 
> Thanks,
> Manav 
> 
> 0 KSP Residual norm 1.696304497261e+00 
> 1 KSP Residual norm 1.120485505777e+00 
> 2 KSP Residual norm 8.324222302402e-01 
> 3 KSP Residual norm 6.477349534115e-01 
> 4 KSP Residual norm 5.080936471292e-01 
> 5 KSP Residual norm 4.051099646638e-01 
> 6 KSP Residual norm 3.260432664653e-01 
> 7 KSP Residual norm 2.560483838143e-01 
> 8 KSP Residual norm 2.029943986124e-01 
> 9 KSP Residual norm 1.560985741610e-01 
>10 KSP Residual norm 1.163720702140e-01 
>11 KSP Residual norm 8.488411085459e-02 
>12 KSP Residual norm 5.888041729034e-02 
>13 KSP Residual norm 4.027792209980e-02 
>14 KSP Residual norm 2.819048087304e-02 
>15 KSP Residual norm 1.904674196962e-02 
>16 KSP Residual norm 1.289302447822e-02 
>17 KSP Residual norm 9.162203296376e-03 
>18 KSP Residual norm 7.016781679507e-03 
>19 KSP Residual norm 5.399170865328e-03 
>20 KSP Residual norm 4.254385887482e-03 
>21 KSP Residual norm 3.530831740621e-03 
>22 KSP Residual norm 2.946780747923e-03 
>23 KSP Residual norm 2.339361361128e-03 
>24 KSP Residual norm 1.815072489282e-03 
>25 KSP Residual norm 1.408814185342e-03 
>26 KSP Residual norm 1.063795714320e-03 
>27 KSP Residual norm 7.828540233117e-04 
>28 KSP Residual norm 5.683910750067e-04 
>29 KSP Residual norm 4.131151010250e-04 
>30 KSP Residual norm 3.065608221019e-04 
>31 KSP Residual norm 2.634114273459e-04 
>32 KSP Residual norm 2.198180137626e-04 
>33 KSP Residual norm 1.748956510799e-04 
>34 KSP Residual norm 1.317539710010e-04 
>35 KSP Residual norm 9.790121566055e-05 
>36 KSP Residual norm 7.465935386094e-05 
>37 KSP Residual norm 5.689506626052e-05 
>38 KSP Residual norm 4.413136619126e-05 
>39 KSP Residual norm 3.512194236402e-05 
>40 KSP Residual norm 2.877755408287e-05 
>41 KSP Residual norm 2.340080556431e-05 
>42 KSP Residual norm 1.904544450345e-05 
>43 KSP Residual norm 1.504723478235e-05 
>44 KSP Residual norm 1.141381950576e-05 
>45 KSP Residual norm 8.206151384599e-06 
>46 KSP Residual norm 5.911426091276e-06 
>47 KSP Residual norm 4.233669089283e-06 
>48 KSP Residual norm 2.898052944223e-06 
>49 KSP Residual norm 2.023556779973e-06 
>50 KSP Residual norm 1.459108043935e-06 
>51 KSP Residual norm 1.097335545865e-06 
>52 KSP Residual norm 8.440457332262e-07 
>53 KSP Residual norm 6.705616854004e-07 
>54 KSP Residual norm 5.404888680234e-07 
>55 KSP Residual norm 4.391368084979e-07 
>56 KSP Residual norm 3.697063014621e-07 
>57 KSP Residual norm 3.021772094146e-07 
>58 KSP Residual norm 2.479354520792e-07 
>59 KSP Residual norm 2.013077841968e-07 
>60 KSP Residual norm 1.553159612793e-07 
>61 KSP Residual norm 1.400784224898e-07 
>62 KSP Residual norm 9.707453662195e-08 
>63 KSP Residual norm 7.263173080146e-08 
>64 KSP Residual norm 5.593723572132e-08 
>65 KSP Residual norm 4.448788809586e-08 
>66 KSP Residual norm 3.613992590778e-08 
>67 KSP Residual norm 2.946099051876e-08 
>68 KSP Residual norm