[Trilinos-Users] tpetra::crsmatrix -> xpetra::matrix
Nico Schlömer
nico.schloemer at gmail.com
Wed Oct 28 20:53:12 EDT 2015
Can anyone please assist me with converting a `const Tpetra::CrsMatrix`
into something that I can stuff into this
```
H->GetLevel(0)->Set("A", something);
```
I played around for two hours now and ended up with
```
Teuchos::RCP<const Tpetra::CrsMatrix<double,int,int>> ATpetra =
Teuchos::rcpFromRef(A);
auto tmp = Xpetra::TpetraCrsMatrix<double,int,int>(ATpetra);
auto AXpetra = Teuchos::rcpFromRef(tmp);
auto AXpetraWrap = Teuchos::rcp(new Xpetra::CrsMatrixWrap(AXpetra));
```
which isn't working at all. Yikes, this is really complex.
As a side node, I would really appreciate const-reference interfaces. I
find myself doing the `Teuchos::rcpFromRef()` dance all the time, only to
dereference the objects later again.
Cheers,
Nico
PS: I would have written to the MueLu users' list, but I couldn't find it
anywhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20151029/950d5969/attachment.html>
More information about the Trilinos-Users
mailing list