[petsc-users] ILU and Block Gauss Seidel smoothing
Gianluca Meneghello
gianmail at gmail.com
Mon Jul 18 13:53:18 CDT 2011
I will!
Thanks for the suggestions
Gianluca
On Monday, 18 July 2011, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> richardson, you may also need to set that KSP with KSPSetInitialGuessNonzero()
>
> Barry
>
>
>
> On Jul 18, 2011, at 1:36 PM, Gianluca Meneghello wrote:
>
>> Barry,
>> I'm actually using ilu as a smoother inside a multigrid cycle. Does in this case make sense to use ksppreonly? Or should I use Richardson?
>>
>> Thanks
>>
>>
>>
>> Il giorno 18/lug/2011, alle ore 20:14, Barry Smith <bsmith at mcs.anl.gov> ha scritto:
>>
>>>
>>> On Jul 18, 2011, at 9:43 AM, Gianluca Meneghello wrote:
>>>
>>>> Barry,
>>>>
>>>> thanks again for your input. That would be really good.
>>>>
>>>> When executing my program with the options you suggested I obtain
>>>> various errors (unknown pc etc) so I tried to figure out how to avoid
>>>> them. Is it something like this what you intended?
>>>>
>>>> ./main
>>>> -mg_pc_type composite
>>>> -mg_pc_composite_pcs ilu,ilu
>>>> -mg_ksp_type preonly
>>>
>>> I don't think you want this one. It says not to use a Krylov method on the outside; the preconditioner will just apply the two ILU triangular and that is it. In other words it won't even solve the linear system. You likely want -mg_ksp_type gmres
>>>
>>> Barry
>>>
>>>> -mg_sub_0_pc_factor_mat_ordering_type FESOrder
>>>> -mg_sub_1_pc_factor_mat_ordering_type FWSOrder
>>>> -mg_pc_composite_type multiplicative
>>>> -mg_ksp_view
>>>>
>>>> provided that
>>>>
>>>> KSPSetOptionsPrefix(ksp,"mg_");
>>>>
>>>> has been applied to the KSP I want to modify.
>>>>
>>>> Thanks again
>>>>
>>>> Gianluca
>>>>
>>>>
>>>> On 13 July 2011 15:33, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>>>>
>>>>> On Jul 13, 2011, at 4:02 AM, Gianluca Meneghello wrote:
>>>>>
>>>>>> Thanks Barry.
>>>>>>
>>>>>> What I'm doing at the moment in order to pass the ordering to the PC is
>>>>>>
>>>>>> PCFactorSetMatOrderingType(PC,"FESOrder");
>>>>>>
>>>>>> where the FESOrder(...) function computes the ordering and has been
>>>>>> registered in the main function with
>>>>>>
>>>>>> MatOrderingRegister("FESOrder",0,"FESOrder",FESOrder);
>>>>>>
>>>>>> The same is done for al the different orderings I'm using inside the
>>>>>> PCSHELL suggested by Jed.
>>>>>>
>>>>>> My understanding is that the FESOrder(...) function is evaluated every
>>>>>> time the PCApply(...) function is called.
>>>>>
>>>>> Definitely not. Looking at PCSetUp_ILU()
>>>>>
>>>>> } else {
>>>>> if (!pc->setupcalled) {
>>>>> /* first time in so compute reordering and symbolic factorization */
>>>>> ierr = MatGetOrdering(pc->pmat,((PC_Factor*)ilu)->ordering,&ilu->row,&ilu->col);CHKERRQ(ierr);
>>>>>
>>>>> it will actually call the ordering routine a TOTAL of ONE TIME if you use SAME_NONZERO_PATTERN to KSPSetOperators() or PCSetOperators(). (it is smart enough to reuse the ordering).
>>>>>
>>>>> BTW: I don't think you even need to use a PCSHELL preconditioner. You can get the same effect with a PCCOMPOSITE. Just create a single KSP in the usual way and use the options
>>>>>
>>>>> -pc_type composite -pc_composite_type ilu,ilu -sub_0_ksp_type preonly -sub_1_ksp_type preonly -sub_0_pc_factor_mat_ordering_type FESOrder -sub_1_pc_factor_mat_ordering_type anotherorder somethingelse
>>>>>
>>>>>
>>>>> Barry
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> If there was a way to store the IS containing the ordering — or any
>>>>>> other array — into the shell context (this I know how to do that) and
>>>>>> the pass the IS directly to the preconditioner instead of using
>>>>>> PCFactorSetMatOrderingType would be the best s
--
"[Je pense que] l'homme est un monde qui vaut des fois les mondes et que les
plus ardentes ambitions sont celles qui ont eu l'orgueil de l'Anonymat" --
Non omnibus, sed mihi et tibi
Amedeo Modigliani
More information about the petsc-users
mailing list