[Trilinos-Users] Amesos2 with Epetra

Daniel Santos dsantosolivan at gmail.com
Tue Nov 13 04:56:20 EST 2018


Good morning,

I am trying to use the Amesos2 package with Epetra matrices/vectors. The
problem is that I have not found any tutorial for doing that.

I have started with the tutorial: SimpleSolve (
https://trilinos.org/docs/dev/packages/amesos2/doc/html/SimpleSolve_8cpp-example.html)
and that one compiles and run without a problem (with Klu solver).
Then I try to use the same in my code:
Teuchos::RCP<Amesos2::Solver<Epetra_RowMatrix, Epetra_MultiVector>> solver
= Amesos2::create<Epetra_RowMatrix, Epetra_MultiVector>("Superlu",
linearProblem->GetMatrix(), linearProblem->GetLHS(),
linearProblem->GetRHS());
where linearProblem is a Epetra_LinearProblem.
In that case, I get a lot of errors about the Adapters of Epetra like these:
/......cpp:32:139: error: conversion from
‘Amesos2::Solver<Epetra_RowMatrix, Epetra_MultiVector>*’ to non-scalar type
‘Teuchos::RCP<Amesos2::Solver<Epetra_RowMatrix, Epetra_MultiVector> >’
requested
         Teuchos::RCP<Amesos2::Solver<Epetra_RowMatrix,
Epetra_MultiVector>> solver = Amesos2::create<Epetra_RowMatrix,
Epetra_MultiVector>("Superlu", linearProblem->GetMatrix(),
linearProblem->GetLHS(), linearProblem->GetRHS());
/...../trilinos/include/Amesos2_MatrixAdapter_def.hpp:578:17: error: no
matching function for call to
‘Amesos2::ConcreteMatrixAdapter<Epetra_RowMatrix>::ConcreteMatrixAdapter(Teuchos::RCP<Epetra_RowMatrix>)’
     return( rcp(new
ConcreteMatrixAdapter<Matrix>(rcp_const_cast<Matrix,const
Matrix>(m))).getConst() );

How should I correctly use this?
Thank you very much,
Daniel Santos-Oliván.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20181113/8d98ddd4/attachment-0001.html>


More information about the Trilinos-Users mailing list