[Trilinos-Users] Using Belos in place of AztecOO

Eric Marttila eric.marttila at thermoanalytics.com
Tue Jul 5 09:02:55 EDT 2016


Hi Alicia,
Thanks a lot for the help.  I now have my code working using 
setOperator and setProblem, as you suggested.  I have one more 
question regarding the preconditioner:   In the past when using 
AztecOO, I did not necessarily recompute the preconditioner each time 
through my outer loop, and if I didn't recompute it, then AztecOO 
would automatically use the preconditioner that I had set previously.  
To get the same behavior with Belos, do I simply call setProblem  (and 
not call setLeftPrec) for outer loop iterations where I don't have an 
updated preconditioner ?

Thanks,
--Eric

On Saturday, July 02, 2016 12:12:20 am Alicia Klinvex wrote:
> Hello Eric,
> 
> I don't believe you have to recreate the LinearProblem object when
> A changes.  You should be able to call setOperator, then
> setProblem.  (You will also want to call set[Left/Right]Prec
> before setProblem.)  Calling setProblem is necessary, for it
> computes the initial residual.
> 
> Best wishes,
> Alicia
> 
> On Fri, Jul 1, 2016 at 9:53 AM, Eric Marttila <
> 
> eric.marttila at thermoanalytics.com> wrote:
> > I have been using AztecOO in my code and am interested in using
> > Belos instead (with the goal of switching over to using TPetra
> > and MuLue as well at some point in the future).
> > 
> > I have been using AztecOO with ML to perform linear solves within
> > a non-linear outer iteration loop.  Because my 'A' matrix
> > sometimes changes significantly in the outer iteration loop, I
> > end up having to recompute the ML preconditioner periodically.
> > 
> > I've attached some psuedocode for my approch using AzteccOO, as
> > well as psuedocode for my current approach using Belos.  (see
> > attached aztec.cpp and belos.cpp)  Both of these approaches can
> > be summarized
> > 
> > as:
> >    1. Create A, x, b
> >    2. Do initial fill of A and B
> >    3. Start outer non-linear loop
> >    
> >           3.1. Update values in A and b
> >           3.2. Create or Recompute preconditioner if needed.
> >           3.2. Solve linear system
> >           3.3. Repeat previous steps until convergence
> > 
> > The question I have is related to my use of Belos, where it
> > appears that I have to recreate the Belos linear problem each
> > time that my A matrix changes in the outer iteration loop.  Is
> > that the right thing to do? That was not necessary when using
> > AztecOO, and I am concerned that I'm adding a lot of overhead by
> > recreating these objects, and especially by calling the
> > 'setProblem()' methods.
> > 
> > I would appreaciate any advice regarding my usage of Belos in
> > this manner.
> > 
> > Thank you,
> > --Eric
> > 
> > _______________________________________________
> > Trilinos-Users mailing list
> > Trilinos-Users at trilinos.org
> > https://trilinos.org/mailman/listinfo/trilinos-users




More information about the Trilinos-Users mailing list