44 #include <Teuchos_ArrayRCP.hpp> 54 const Teuchos::RCP<
const Tpetra::Map<int, SupportId>> &domain_map )
56 , d_domain_map( domain_map )
59 Teuchos::ArrayView<const SupportId> domain_elements =
60 d_domain_map->getNodeElementList();
61 d_lda = domain_elements.size();
62 Teuchos::Array<SupportId> global_ids;
63 SupportId max_id = d_domain_map->getMaxAllGlobalIndex() + 1;
64 if ( d_domain_map->getComm()->getRank() == 0 )
66 global_ids.resize( d_offset + domain_elements.size() );
67 global_ids( d_offset, domain_elements.size() )
68 .assign( domain_elements );
69 for (
int i = 0; i < d_offset; ++i )
71 global_ids[i] = max_id + i;
73 domain_elements = global_ids();
79 d_range_map = Tpetra::createNonContigMap<int, SupportId>(
80 domain_elements, d_domain_map->getComm() );
81 DTK_ENSURE( Teuchos::nonnull( d_range_map ) );
87 const Tpetra::MultiVector<double, int, SupportId> &X,
88 Tpetra::MultiVector<double, int, SupportId> &Y, Teuchos::ETransp mode,
89 double alpha,
double beta )
const 91 DTK_REQUIRE( d_domain_map->isSameAs( *( X.getMap() ) ) );
92 DTK_REQUIRE( d_range_map->isSameAs( *( Y.getMap() ) ) );
93 DTK_REQUIRE( X.getNumVectors() == Y.getNumVectors() );
97 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const double>> X_view = X.get2dView();
98 Teuchos::ArrayRCP<Teuchos::ArrayRCP<double>> Y_view = Y.get2dViewNonConst();
99 for (
unsigned n = 0; n < X.getNumVectors(); ++n )
101 for (
int i = 0; i < d_lda; ++i )
103 Y_view[n][i + d_offset] += alpha * X_view[n][i];
SplineProlongationOperator(const int offset, const Teuchos::RCP< const Tpetra::Map< int, SupportId >> &domain_map)
Constructor.
unsigned long int SupportId
Support id type.
void apply(const Tpetra::MultiVector< double, int, SupportId > &X, Tpetra::MultiVector< double, int, SupportId > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, double alpha=Teuchos::ScalarTraits< double >::one(), double beta=Teuchos::ScalarTraits< double >::zero()) const override
Computes the operator-multivector application.
Assertions and Design-by-Contract for error handling.
Spline transformation operator.