Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_TpetraImport_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef XPETRA_TPETRAIMPORT_DECL_HPP
11 #define XPETRA_TPETRAIMPORT_DECL_HPP
12 
13 /* this file is automatically generated - do not edit (see script/tpetra.py) */
14 
16 
17 #include "Xpetra_Import.hpp"
18 #include "Xpetra_Exceptions.hpp"
19 
21 #include "Tpetra_Import.hpp"
22 
23 namespace Xpetra {
24 
25 template <class LocalOrdinal,
26  class GlobalOrdinal,
27  class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
29  : public Import<LocalOrdinal, GlobalOrdinal, Node> {
30  public:
33 
35 
36 
38  TpetraImport(const Teuchos::RCP<const map_type> &source, const Teuchos::RCP<const map_type> &target);
39 
41  TpetraImport(const Teuchos::RCP<const map_type> &source, const Teuchos::RCP<const map_type> &target, const Teuchos::RCP<Teuchos::ParameterList> &plist);
42 
45 
47  ~TpetraImport();
48 
50  Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
51  createRemoteOnlyImport(const Teuchos::RCP<const map_type> &remoteTarget) const;
52 
54 
56 
57 
59  size_t getNumSameIDs() const;
60 
62  size_t getNumPermuteIDs() const;
63 
65  ArrayView<const LocalOrdinal> getPermuteFromLIDs() const;
66 
68  ArrayView<const LocalOrdinal> getPermuteToLIDs() const;
69 
71  size_t getNumRemoteIDs() const;
72 
74  ArrayView<const LocalOrdinal> getRemoteLIDs() const;
75 
77  void setDistributorParameters(const Teuchos::RCP<Teuchos::ParameterList> params) const;
78 
80  size_t getNumExportIDs() const;
81 
83  ArrayView<const LocalOrdinal> getExportLIDs() const;
84 
86  ArrayView<const int> getExportPIDs() const;
87 
89  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getSourceMap() const;
90 
92  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getTargetMap() const;
93 
95 
97 
98 
100  void print(std::ostream &os) const;
101 
103 
105 
106 
108  TpetraImport(const RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > &import);
109 
110  RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > getTpetra_Import() const;
111 
113 
114  private:
115  RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > import_;
116 
117 }; // TpetraImport class
118 
119 // TODO: move that elsewhere
120 template <class LocalOrdinal, class GlobalOrdinal, class Node>
121 const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> &toTpetra(const Import<LocalOrdinal, GlobalOrdinal, Node> &import) {
122  // TODO: throw exception
124  return *tpetraImport.getTpetra_Import();
125 }
126 
127 template <class LocalOrdinal, class GlobalOrdinal, class Node>
128 const RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > toTpetra(const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importObj) {
129  typedef TpetraImport<LocalOrdinal, GlobalOrdinal, Node> TpetraImportClass;
130  if (importObj != Teuchos::null) {
131  XPETRA_RCP_DYNAMIC_CAST(const TpetraImportClass, rcpFromRef(*importObj), tpetraImport, "toTpetra");
132  return tpetraImport->getTpetra_Import();
133  }
134  return Teuchos::null;
135 }
136 
137 template <class LocalOrdinal, class GlobalOrdinal, class Node>
138 RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > toXpetra(const RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > &import) {
139  if (!import.is_null())
140  return rcp(new TpetraImport<LocalOrdinal, GlobalOrdinal, Node>(import));
141 
142  return Teuchos::null;
143 }
144 
145 } // namespace Xpetra
146 
147 #endif // XPETRA_TPETRAIMPORT_HPP
size_t getNumSameIDs() const
Number of initial identical IDs.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > import_
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special &quot;constructor&quot;.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on distributor.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
void print(std::ostream &os) const
Print the Import&#39;s data to the given output stream.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)