[Dune] Setting and optimising AMG parameters in ISTL
Markus Blatt
markus at dr-blatt.de
Thu Jul 26 20:29:11 CEST 2012
> >> As far as I can see the coarsen criterion is only used in the
> >> apply() method of the class ISTLBackend_AMG in backend.hh, where the
> >> AMG object is instantiated, so I guess I could always derive a class
> >> from ISTLBackend_AMG and overload the apply() method with the
> >> UnSymmetricCriterion (and then also derive ISTLBackend_AMG_SSOR
> >> etc. from this). Or even hack the ISTL_Backend_AMG class in my Dune
> >> installation...
> >
> > Yes, but you should probably use new names for ISTLBackend_AMG_SSOR,
> > etc.
On second thought deriving and implementing new classes seems like
overkill to me.
We could simply add a flag to the amg backend, to select the criterion
and just instiate both in apply and the select the right one using a
simple if statement:
typedef
Dune::Amg::CoarsenCriterion<Dune::Amg::SymmetricCriterion<BCRSMat,Dune::Amg::FirstDiagonal> >
SCriterion;
typedef
Dune::Amg::CoarsenCriterion<Dune::Amg::UnSymmetricCriterion<BCRSMat,Dune::Amg::FirstDiagonal> >
UCriterion;
SCriterion criterion(params);
UCriterion ucriterion(params);
....
if (reuse==false || firstapply==true){
if(useUnSymmetric)
amg.reset(new AMG(oop, ucriterion, smootherArgs, oocc));
else
amg.reset(new AMG(oop, criterion, smootherArgs, oocc));
Markus
--
Do you need more support with DUNE or HPC in general?
Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858 Fax: +49 (0)322 1108991658
More information about the Dune
mailing list