Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_EpetraImport.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_EPETRAIMPORT_HPP
11 #define XPETRA_EPETRAIMPORT_HPP
12 
13 /* this file is automatically generated - do not edit (see script/epetra.py) */
14 
16 
17 #include "Xpetra_Import.hpp"
18 
19 #include "Xpetra_EpetraMap.hpp" //TMP
20 
21 #include "Epetra_Import.h"
22 
23 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
24 #ifdef __GNUC__
25 #if defined(Xpetra_SHOW_DEPRECATED_WARNINGS)
26 #warning "The header file Trilinos/packages/xpetra/src/Import/Xpetra_EpetraImport.hpp is deprecated."
27 #endif
28 #endif
29 #else
30 #error "The header file Trilinos/packages/xpetra/src/Import/Xpetra_EpetraImport.hpp is deprecated."
31 #endif
32 
33 namespace Xpetra {
34 
35 template <class GlobalOrdinal, class Node>
36 XPETRA_DEPRECATED RCP<const Import<int, GlobalOrdinal, Node> > toXpetra(const Epetra_Import *import);
37 //
38 
39 template <class EpetraGlobalOrdinal, class Node>
40 class XPETRA_DEPRECATED EpetraImportT
41  : public Import<int, EpetraGlobalOrdinal, Node> {
42  typedef int LocalOrdinal;
43  typedef EpetraGlobalOrdinal GlobalOrdinal;
46 
47  public:
49 
50 
52  EpetraImportT(const Teuchos::RCP<const map_type> &source, const Teuchos::RCP<const map_type> &target)
53  : import_(rcp(new Epetra_Import(toEpetra<GlobalOrdinal, Node>(target), toEpetra<GlobalOrdinal, Node>(source)))) {} // Warning: Epetra(Target, Source) vs. Tpetra(Source, Target)
54 
56  // Definition not in cpp, so comment out
57  // EpetraImportT(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist);
58 
60  // Definition commented out in cpp
61  // EpetraImportT(const Import< LocalOrdinal, GlobalOrdinal, Node > &import);
62 
65 
67  Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
68  createRemoteOnlyImport(const Teuchos::RCP<const map_type> &remoteTarget) const { TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO EpetraImportT<EpetraGlobalOrdinal>::createRemoteOnlyImport not implemented"); }
69 
71 
73 
74 
76  size_t getNumSameIDs() const {
77  XPETRA_MONITOR("EpetraImportT::getNumSameIDs");
78  return import_->NumSameIDs();
79  }
80 
82  size_t getNumPermuteIDs() const {
83  XPETRA_MONITOR("EpetraImportT::getNumPermuteIDs");
84  return import_->NumPermuteIDs();
85  }
86 
88  ArrayView<const LocalOrdinal> getPermuteFromLIDs() const {
89  XPETRA_MONITOR("EpetraImportT::getPermuteFromLIDs");
90  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO EpetraImportT<EpetraGlobalOrdinal>::getExportImageIDs not implemented");
91  }
92 
94  ArrayView<const LocalOrdinal> getPermuteToLIDs() const {
95  XPETRA_MONITOR("EpetraImportT::getPermuteToLIDs");
96  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO EpetraImportT<EpetraGlobalOrdinal>::getPermuteToLIDs not implemented");
97  }
98 
100  size_t getNumRemoteIDs() const {
101  XPETRA_MONITOR("EpetraImportT::getNumRemoteIDs");
102  return import_->NumRemoteIDs();
103  }
104 
106  ArrayView<const LocalOrdinal> getRemoteLIDs() const {
107  XPETRA_MONITOR("EpetraImportT::getRemoteLIDs");
108  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO EpetraImportT<EpetraGlobalOrdinal>::getRemoteLIDs not implemented");
109  }
110 
112  ArrayView<const LocalOrdinal> getRemotePIDs() const {
113  XPETRA_MONITOR("EpetraImportT::getRemotePIDs");
114  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO EpetraImportT<EpetraGlobalOrdinal>::getRemotePIDs not implemented");
115  }
116 
118  size_t getNumExportIDs() const {
119  XPETRA_MONITOR("EpetraImportT::getNumExportIDs");
120  return import_->NumExportIDs();
121  }
122 
124  ArrayView<const LocalOrdinal> getExportLIDs() const {
125  XPETRA_MONITOR("EpetraImportT::getExportLIDs");
126  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO EpetraImportT<EpetraGlobalOrdinal>::getExportLIDs not implemented");
127  }
128 
130  ArrayView<const int> getExportPIDs() const {
131  XPETRA_MONITOR("EpetraImportT::getExportImageIDs");
132  return ArrayView<const int>(import_->ExportPIDs(), import_->NumExportIDs());
133  }
134 
136  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getSourceMap() const {
137  XPETRA_MONITOR("EpetraImportT::getSourceMap");
138  return toXpetra<GlobalOrdinal, Node>(import_->SourceMap());
139  }
140 
142  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getTargetMap() const {
143  XPETRA_MONITOR("EpetraImportT::getTargetMap");
144  return toXpetra<GlobalOrdinal, Node>(import_->TargetMap());
145  }
146 
147  void setDistributorParameters(const Teuchos::RCP<Teuchos::ParameterList> params) const { XPETRA_MONITOR("EpetraImportT::setDistributorParameters"); }
148 
150 
152 
153 
155  void print(std::ostream &os) const {
156  XPETRA_MONITOR("EpetraImportT::print");
157  import_->Print(os);
158  }
159 
161 
163 
164 
166  EpetraImportT(const RCP<const Epetra_Import> &import)
167  : import_(import) {}
168 
170  RCP<const Epetra_Import> getEpetra_Import() const { return import_; }
171 
173 
174  private:
175  RCP<const Epetra_Import> import_;
176 
177 }; // EpetraImportT class
178 
179 } // namespace Xpetra
180 
181 #endif // XPETRA_EPETRAIMPORT_HPP
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
EpetraImportT(const RCP< const Epetra_Import > &import)
EpetraImportT constructor to wrap a Epetra_Import object.
void print(std::ostream &os) const
Print the Import&#39;s data to the given output stream.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
EpetraGlobalOrdinal GlobalOrdinal
RCP< const Epetra_Import > getEpetra_Import() const
Get the underlying Epetra import.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
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.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
EpetraImportT(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 Epetra_Import > import_
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
Exception throws when you call an unimplemented method of Xpetra.
#define XPETRA_MONITOR(funcName)
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special &quot;constructor&quot;.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
ArrayView< const LocalOrdinal > getRemotePIDs() const
List of entries in the target Map to receive from other processes.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)