Skip to content

Commit

Permalink
tpetra: Have BlockMultiVector::getMultiVectorView() return a reference.
Browse files Browse the repository at this point in the history
So that BlockCrsMatrix::apply actually caches the import & export dual views
for its X_col_map_ member.
  • Loading branch information
vbrunini committed Sep 25, 2024
1 parent 3c3e710 commit a67c809
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 a67c809

Please sign in to comment.