Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_TpetraExport_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_TPETRAEXPORT_DECL_HPP
11 #define XPETRA_TPETRAEXPORT_DECL_HPP
12 
13 /* this file is automatically generated - do not edit (see script/tpetra.py) */
14 
16 
17 #include "Xpetra_Export.hpp"
18 #include "Xpetra_Exceptions.hpp"
19 
21 #include "Tpetra_Export.hpp"
22 
23 // Note: 'export' is a reserved keyword in C++. Do not use 'export' as a variable name.
24 
25 namespace Xpetra {
26 
27 // TODO: move that elsewhere
28 template <class LocalOrdinal, class GlobalOrdinal, class Node>
29 const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>& toTpetra(const Export<LocalOrdinal, GlobalOrdinal, Node>&);
30 
31 template <class LocalOrdinal, class GlobalOrdinal, class Node>
32 RCP<const Export<LocalOrdinal, GlobalOrdinal, Node>>
33 toXpetra(const RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp);
34 
35 template <class LocalOrdinal,
36  class GlobalOrdinal,
37  class Node>
39  : public Export<LocalOrdinal, GlobalOrdinal, Node> {
40  public:
43 
45 
46 
48  TpetraExport(const Teuchos::RCP<const map_type>& source, const Teuchos::RCP<const map_type>& target);
49 
51  TpetraExport(const Teuchos::RCP<const map_type>& source,
52  const Teuchos::RCP<const map_type>& target,
53  const Teuchos::RCP<Teuchos::ParameterList>& plist);
54 
57 
59  ~TpetraExport();
60 
62 
64 
65 
67  size_t getNumSameIDs() const;
68 
70  size_t getNumPermuteIDs() const;
71 
73  ArrayView<const LocalOrdinal> getPermuteFromLIDs() const;
74 
76  ArrayView<const LocalOrdinal> getPermuteToLIDs() const;
77 
79  size_t getNumRemoteIDs() const;
80 
82  ArrayView<const LocalOrdinal> getRemoteLIDs() const;
83 
85  size_t getNumExportIDs() const;
86 
88  ArrayView<const LocalOrdinal> getExportLIDs() const;
89 
91  ArrayView<const int> getExportPIDs() const;
92 
94  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>> getSourceMap() const;
95 
97  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>> getTargetMap() const;
98 
100  void setDistributorParameters(const Teuchos::RCP<Teuchos::ParameterList> params) const;
101 
103 
105 
106 
108  void print(std::ostream& os) const;
109 
111 
113 
114 
116  TpetraExport(const RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp);
117 
118  RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>> getTpetra_Export() const;
119 
121 
122  private:
123  RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>> export_;
124 
125 }; // TpetraExport class
126 
127 // --------------
128 // Free functions
129 // --------------
130 
131 // TODO: move that elsewhere
132 template <class LocalOrdinal, class GlobalOrdinal, class Node>
133 const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>&
135  // TODO: throw exception
137  dynamic_cast<const TpetraExport<LocalOrdinal, GlobalOrdinal, Node>&>(exp);
138  return *tpetraExport.getTpetra_Export();
139 }
140 
141 template <class LocalOrdinal, class GlobalOrdinal, class Node>
142 const RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>> toTpetra(const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node>>& exportObj) {
143  typedef TpetraExport<LocalOrdinal, GlobalOrdinal, Node> TpetraExportClass;
144  if (exportObj != Teuchos::null) {
145  XPETRA_RCP_DYNAMIC_CAST(const TpetraExportClass, rcpFromRef(*exportObj), tpetraExport, "toTpetra");
146  return tpetraExport->getTpetra_Export();
147  }
148  return Teuchos::null;
149 }
150 
151 template <class LocalOrdinal, class GlobalOrdinal, class Node>
152 RCP<const Export<LocalOrdinal, GlobalOrdinal, Node>>
153 toXpetra(const RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp) {
154  if (!exp.is_null())
156 
157  return Teuchos::null;
158 }
159 
160 } // namespace Xpetra
161 
162 #endif // XPETRA_TPETRAEXPORT_DECL_HPP
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Export() const
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
size_t getNumSameIDs() const
Number of initial identical IDs.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The source Map used to construct this Export.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The target Map used to construct this Export.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > > export_
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set distributor parameters.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
TpetraExport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct a Export object from the source and target Map.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
void print(std::ostream &os) const
Print the Export&#39;s data to the given output stream.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)