Skip to content

Commit

Permalink
tpetra: Have BlockMultiVector::getMultiVectorView() return a referenc…
Browse files Browse the repository at this point in the history
…e. (#13475)

So that BlockCrsMatrix::apply actually caches the import & export dual views
for its X_col_map_ member.
  • Loading branch information
vbrunini authored Sep 26, 2024
1 parent dfbd551 commit 71f1963
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/tpetra/core/src/Tpetra_BlockMultiVector_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ class BlockMultiVector :
///
/// This is how you can give a BlockMultiVector to Trilinos' solvers
/// and preconditioners.
mv_type getMultiVectorView () const;
const mv_type & getMultiVectorView () const;
mv_type & getMultiVectorView ();

//@}
//! \name Coarse-grained operations
Expand Down
11 changes: 10 additions & 1 deletion packages/tpetra/core/src/Tpetra_BlockMultiVector_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef TPETRA_BLOCKMULTIVECTOR_DEF_HPP
#define TPETRA_BLOCKMULTIVECTOR_DEF_HPP

#include "Tpetra_BlockMultiVector_decl.hpp"
#include "Tpetra_Details_Behavior.hpp"
#include "Tpetra_BlockView.hpp"
#include "Teuchos_OrdinalTraits.hpp"
Expand All @@ -18,13 +19,21 @@
namespace Tpetra {

template<class Scalar, class LO, class GO, class Node>
typename BlockMultiVector<Scalar, LO, GO, Node>::mv_type
const typename BlockMultiVector<Scalar, LO, GO, Node>::mv_type &
BlockMultiVector<Scalar, LO, GO, Node>::
getMultiVectorView () const
{
return mv_;
}

template<class Scalar, class LO, class GO, class Node>
typename BlockMultiVector<Scalar, LO, GO, Node>::mv_type &
BlockMultiVector<Scalar, LO, GO, Node>::
getMultiVectorView ()
{
return mv_;
}

template<class Scalar, class LO, class GO, class Node>
Teuchos::RCP<const BlockMultiVector<Scalar, LO, GO, Node> >
BlockMultiVector<Scalar, LO, GO, Node>::
Expand Down

0 comments on commit 71f1963

Please sign in to comment.