[Trilinos-Users] Run time error msg: wrong type of "smoother: Aztec options" in ML parameter list

Ernesto Prudencio prudenci at slac.stanford.edu
Thu Dec 13 13:46:01 MST 2007


Thank you, Jonathan. It is working now.

Just for other potential users, I had to write

#include "Teuchos_RCP.hpp"

and

Teuchos::rcp(new ...) instead of rcp(new ...).

Ernesto.

On Thu, 13 Dec 2007, Jonathan Hu wrote:

> Hi Ernesto,
>
>     You can use AztecOO as a smoother, but will need to change the 
> declaration of the options and params variables.  This was changed in ML to 
> better handle memory management, but the user's guide wasn't updated.
>
> Regards,
> Jonathan
>
> Teuchos::ParameterList*              m_mlList;
> // modification #1  options and params should be reference-counted pointers
> Teuchos::RCP<std::vector<int> >   m_smootherAztecOptions = rcp(new 
> std::vector<int>(AZ_OPTIONS_SIZE));
> Teuchos::RCP<std::vector<double> >   m_smootherAztecParams = rcp(new 
> std::vector<double>(AZ_PARAMS_SIZE)); //end of mod #1
> ML_Epetra::MultiLevelPreconditioner* m_mlPreconditioner;
>
> std::string smootherType("Aztec");
> // modification #2  AZ_defaults is expecting int* and double*
> AZ_defaults(&(*m_smootherAztecOptions)[0],&(*m_smootherAztecParams)[0]);
> (*m_smootherAztecOptions)[AZ_precond]         = AZ_dom_decomp;
> (*m_smootherAztecOptions)[AZ_subdomain_solve] = AZ_icc;
> //end of mod #2
> int smootherAztecAsSolver = 0;
>
> m_mlList = new Teuchos::ParameterList();
> m_mlList->set("smoother: type",smootherType.c_str());
> m_mlList->set("smoother: Aztec options",m_smootherAztecOptions);
> m_mlList->set("smoother: Aztec params",m_smootherAztecParams);
> m_mlList->set("smoother: Aztec as solver",(bool) smootherAztecAsSolver);
> ... // other sets
> m_mlPreconditioner = new ML_Epetra::MultiLevelPreconditioner(*matrix, 
> *m_mlList);
>
>
> Ernesto Prudencio wrote:
>> 
>> Hi. I have the following data members in a class of mine,
>> 
>> Teuchos::ParameterList*              m_mlList;
>> int             m_smootherAztecOptions[AZ_OPTIONS_SIZE];
>> double          m_smootherAztecParams[AZ_PARAMS_SIZE];
>> ML_Epetra::MultiLevelPreconditioner* m_mlPreconditioner;
>> 
>> and the following code in the constructor of such class:
>> 
>> std::string smootherType("Aztec");
>> AZ_defaults(m_smootherAztecOptions,m_smootherAztecParams);
>> m_smootherAztecOptions[AZ_precond]         = AZ_dom_decomp;
>> m_smootherAztecOptions[AZ_subdomain_solve] = AZ_icc;
>> int smootherAztecAsSolver = 0;
>> 
>> m_mlList = new Teuchos::ParameterList();
>> m_mlList->set("smoother: type",smootherType.c_str());
>> m_mlList->set("smoother: Aztec options",m_smootherAztecOptions);
>> m_mlList->set("smoother: Aztec params",m_smootherAztecParams);
>> m_mlList->set("smoother: Aztec as solver",(bool) smootherAztecAsSolver);
>> ... // other sets
>> m_mlPreconditioner = new ML_Epetra::MultiLevelPreconditioner(*matrix, 
>> *m_mlList);
>> ...
>> 
>> But I am getting the following run time error message:
>> 
>> // BEGIN OF ERROR MESSAGE
>> 
>> Error, the parameter {name="smoother: Aztec 
>> options",type="int*",value="0x11bbe9e8"}
>> in the parameter (sub)list "ANONYMOUS"
>> exists in the list of valid parameters but has the wrong type.
>> 
>> The correct type is "RCP<vector<int>>".
>> 
>> Throw number = 1
>> 
>> ERROR: ML's Teuchos::ParameterList contains an incorrect parameter!
>> 
>> // END OF ERROR MESSAGE
>> 
>> Any idea on what is wrong?
>> 
>> Thanks in advance,
>> 
>> Ernesto.
>> 
>> 
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>> 
>
>
> -- 
> Jonathan J. Hu, mailto:jhu at sandia.gov
> Postal address: Sandia National Laboratories
>               Mailstop 9159
>               PO Box 969, Livermore, CA 94551-0969
> Tel / Fax (925) 294-2931 
>
>



More information about the Trilinos-Users mailing list