New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TpetraWrappers::Vector: Don't use rcp pointers internally #16549
TpetraWrappers::Vector: Don't use rcp pointers internally #16549
Conversation
, vector(V.vector, Teuchos::Copy) | ||
, nonlocal_vector(V.nonlocal_vector, Teuchos::Copy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The places fixing the CI are here...
{ | ||
*vector = *V.vector; | ||
vector = VectorType(V.vector, Teuchos::Copy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup.
I think this looks good. However, I have seen several application codes where |
You are correct. All of Belos (iterative solvers) builds upon the And if you look a the TPetra tutorials everything is constructed as RCPs as well. I have tried using EPetra with non wrapped XPetra solvers and it was a hassle from a users perspective to |
I have never seen an example where the raw Part of the reason why I started to work on the Tpetra-Interface is because I want to use FROSch as a solver inside of deal.II. I already have a preliminary FROSch interface, and inside that interface, I need the RCP objects since FROSch expects RCPs instead of the raw vectors/matrices. As mentioned by @jpthiele, also other classes, e.g. the Belos::LinearOperator, expects RCPs instead of raw vectors/matrices. Since the goal of the Trilinos wrapper should be to make it as simple as possible for users to access Trilinos packages through deal.II, I would strongly suggest that we stick with RCPs. |
*/ | ||
Teuchos::RCP< | ||
const Tpetra::Vector<Number, int, types::signed_global_dof_index>> | ||
trilinos_rcp() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not remove this function.
I already implemented a preliminary solver for Tpetra, here and that makes use of this function.
The solver would become way more complicated without this function.
Note that we can construct a non-owning |
Yes sure, that is what is done all over the place in the Epetra Wrappers for solvers and preconditioners. Having an RCP means every meaningful task we do with a linear equation system after assembly can be done directly And looking at the PR almost all changes are from So my main question is: |
It adds an unnecessary level of indirection. My comment above meant to say that we can still return an unmanaged
These changes are possible independent of the discussion here. Let me pull that out of this pull request. |
Please update now that #16566 is merged. I have no opinion about the matter at hand. If the rest of Trilinos is using RCPs, then I can see the reason to use RCPs here as well. I think that in practice, a single pointer indirection is likely not going to be too much of a problem. I do get that from a conceptual perspective, using the object outright looks nicer. |
23ecc6c
to
d68d8b4
Compare
Alternative to #16645, addressing #16545 (comment).
@kinnewig It seems we can do without using
rcp
pointers in theTpetraWrappers::Vector
implementation and don't need them in the interface either simplifying the implementation.