[Trilinos-Users] ML: reusing structures
Eric Marttila
eric.marttila at thermoanalytics.com
Thu Feb 9 08:22:34 MST 2012
Nico,
I don't know enough to answer your 2nd and 3rd questions, but regarding your
first question: Internally, the MultiLevelPreconditioner class holds a pointer
to the A matrix. You are not really passing it 'by value' - it is being
passed by reference since the MultiLevelPreconditioner constructor is defined
to take a reference.
Hope this helps.
--Eric
On Thursday, February 09, 2012 06:28:11 am Nico Schlömer wrote:
> Hi,
>
> I've started to get my hands a little dirty with ML's reusing
> strategies, specifically referring to
> http://trilinos.sandia.gov/packages/docs/dev/packages/ml/doc/html/classML__
> Epetra_1_1MultiLevelPreconditioner.html#a0a5c1d47c6938d2ec1cb9bb710723c1e
>
> If what I understand from the docs is correct, then
> MultiLevelPreconditioner
> ================= *snip* =================
> // set up matrix A (ptr)
> if ( ML is not build )
> {
> // set up ML list
> MlPrec_ = Teuchos::rcp( new ML_Epetra::MultiLevelPreconditioner(
> *A, MLList ) );
> }
> // Solve linear systems with MLPrec, A
>
> // change values of A, not its pointer
>
> MlPrec_->ComputePreconditioner();
> // ? MlPrec_->ReComputePreconditioner();
>
> // Solve more linear systems with MLPrec, A
> ================= *snap* =================
>
> is what you're supposed to do.
>
> Three questions about it:
>
> (a) Out of interest: How is the data of the matrix A handled in ML?
> Are references to it passed around?
> It seems a bit funny to pass in A by value (*A), but then after
> that the pointer to A can't change.
> (b) There is also ReComputePreconditioner(). What are possible use cases
> for it? (c) ComputePreconditioner runs about twice as long with
> checkFiltering *disabled*. Is this somethings that's supposed to happen?
>
> Cheers,
> Nico
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
--
Eric A. Marttila
ThermoAnalytics, Inc.
23440 Airpark Blvd.
Calumet, MI 49913
email: Eric.Marttila at ThermoAnalytics.com
phone: 810-636-2443
fax: 906-482-9755
web: http://www.thermoanalytics.com
More information about the Trilinos-Users
mailing list