MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_MatrixFreeTentativeP_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef MUELU_MATRIXFREETENTATIVEP_DECL_HPP
11 #define MUELU_MATRIXFREETENTATIVEP_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
14 
16 
17 #include <Tpetra_KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
18 
19 #include <Teuchos_BLAS_types.hpp>
20 #include "Teuchos_ScalarTraits.hpp"
21 
22 #include "MueLu_Aggregates_fwd.hpp"
23 #include "Xpetra_Map_fwd.hpp"
25 #include "Xpetra_Operator_fwd.hpp"
26 
27 namespace MueLu {
28 
33 // template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
34 // class MatrixFreeTentativeP;
35 
36 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
37 class MatrixFreeTentativeP : public Xpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
38  public:
41  typedef typename Node::execution_space execution_space;
42  typedef Kokkos::RangePolicy<local_ordinal_type, execution_space> range_type;
43  typedef Kokkos::MDRangePolicy<local_ordinal_type, execution_space, Kokkos::Rank<2>> md_range_type;
44  typedef Node node_type;
46 
47  private:
48 #undef MUELU_MATRIXFREETENTATIVEP_SHORT
49 #include "MueLu_UseShortNames.hpp"
50 
51  public:
53 
54 
57  : fine_map_(fine_map)
58  , coarse_map_(coarse_map)
59  , aggregates_(aggregates) {}
60 
62  ~MatrixFreeTentativeP() = default;
64 
65  // compute the apply operator, Y = alpha*R*X + beta*Y
67 
68  // compute the residual
69  void residual(const MultiVector &X, const MultiVector &B, MultiVector &R) const override;
70 
71  // get the range map
72  const Teuchos::RCP<const Map> getRangeMap() const override {
73  return fine_map_;
74  }
75 
76  // get the domain map
77  const Teuchos::RCP<const Map> getDomainMap() const override {
78  return coarse_map_;
79  }
80 
81  // get the aggregates
83  return aggregates_;
84  }
85 
86  private:
87  // the fine map
89 
90  // the coarse map
92 
93  // the aggregates required for the grid transfer
95 };
96 
97 } // namespace MueLu
98 
99 #define MUELU_MATRIXFREETENTATIVEP_SHORT
100 #endif // MUELU_MATRIXFREETENTATIVEP_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
Matrix-free tentative restrictor operator.
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > MultiVector
const Teuchos::RCP< const Map > getRangeMap() const override
MueLu::DefaultNode Node
Teuchos::ScalarTraits< Scalar >::coordinateType real_type
void residual(const MultiVector &X, const MultiVector &B, MultiVector &R) const override
const Teuchos::RCP< const Map > fine_map_
~MatrixFreeTentativeP()=default
Destructor.
const Teuchos::RCP< const Aggregates > aggregates_
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
const Teuchos::RCP< const Map > getDomainMap() const override
Kokkos::MDRangePolicy< local_ordinal_type, execution_space, Kokkos::Rank< 2 > > md_range_type
MatrixFreeTentativeP(Teuchos::RCP< const Map > coarse_map, Teuchos::RCP< const Map > fine_map, Teuchos::RCP< const Aggregates > aggregates)
Constructor.
const Teuchos::RCP< const Map > coarse_map_
Teuchos::RCP< const Aggregates > getAggregates() const
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
void apply(const MultiVector &X, MultiVector &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const override