[Trilinos-Users] [EXTERNAL] Amesos2 with Epetra
Gates, Jason Matthew
jmgate at sandia.gov
Tue Nov 13 10:48:47 EST 2018
A Teuchos expert might want to chime in to confirm this, but I suspect you could either:
* Remove the Teuchos::RCP<…> that’s wrapping the type on the left hand side for your solver variable, or
* Use something along the lines of Teuchos::rcpFromRef(…) to wrap the right hand side.
It looks like the problem is the left hand side is currently a pointer type, while the right hand side isn’t.
Hope this helps,
Jason M. Gates
On Nov 13, 2018, at 2:56 AM, Daniel Santos <dsantosolivan at gmail.com<mailto:dsantosolivan at gmail.com>> wrote:
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.
_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org<mailto:Trilinos-Users at trilinos.org>
https://trilinos.org/mailman/listinfo/trilinos-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20181113/a3a348b3/attachment.html>
More information about the Trilinos-Users
mailing list