Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef XPETRA_EPETRAIMPORT_HPP
00047 #define XPETRA_EPETRAIMPORT_HPP
00048
00049
00050
00051 #include "Xpetra_EpetraConfigDefs.hpp"
00052
00053 #include "Xpetra_Import.hpp"
00054
00055 #include "Xpetra_EpetraMap.hpp"
00056
00057 #include "Epetra_Import.h"
00058
00059 namespace Xpetra {
00060
00061
00062
00063
00064
00065 template<class GlobalOrdinal>
00066 RCP< const Import<int, GlobalOrdinal > > toXpetra(const Epetra_Import *import);
00067
00068
00069 template<class EpetraGlobalOrdinal>
00070 class EpetraImportT
00071 : public Import<int, EpetraGlobalOrdinal>
00072 {
00073
00074 typedef int LocalOrdinal;
00075 typedef EpetraGlobalOrdinal GlobalOrdinal;
00076 typedef typename Import<int, GlobalOrdinal>::node_type Node;
00078 typedef Map<LocalOrdinal,GlobalOrdinal,Node> map_type;
00079
00080 public:
00081
00083
00084
00086 EpetraImportT(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target);
00087
00089
00090
00091
00093
00094
00095
00097 ~EpetraImportT() { }
00098
00100
00102
00103
00105 size_t getNumSameIDs() const { XPETRA_MONITOR("EpetraImportT::getNumSameIDs"); return import_->NumSameIDs(); }
00106
00108 size_t getNumPermuteIDs() const { XPETRA_MONITOR("EpetraImportT::getNumPermuteIDs"); return import_->NumPermuteIDs(); }
00109
00111 ArrayView< const LocalOrdinal > getPermuteFromLIDs() const;
00112
00114 ArrayView< const LocalOrdinal > getPermuteToLIDs() const;
00115
00117 size_t getNumRemoteIDs() const;
00118
00120 ArrayView< const LocalOrdinal > getRemoteLIDs() const;
00121
00123 ArrayView< const LocalOrdinal > getRemotePIDs() const;
00124
00126 size_t getNumExportIDs() const;
00127
00129 ArrayView< const LocalOrdinal > getExportLIDs() const;
00130
00132 ArrayView< const int > getExportPIDs() const;
00133
00135 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const { XPETRA_MONITOR("EpetraImportT::getSourceMap"); return toXpetra<GlobalOrdinal>(import_->SourceMap()); }
00136
00138 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const { XPETRA_MONITOR("EpetraImportT::getTargetMap"); return toXpetra<GlobalOrdinal>(import_->TargetMap()); }
00139
00141
00143
00144
00146 void print(std::ostream &os) const;
00147
00149
00151
00152
00154 EpetraImportT(const RCP<const Epetra_Import> &import) : import_(import) { }
00155
00157 RCP< const Epetra_Import> getEpetra_Import() const { return import_; }
00158
00160
00161 private:
00162
00163 RCP<const Epetra_Import> import_;
00164
00165 };
00166
00167 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
00168 typedef EpetraImportT<int> EpetraImport;
00169 #endif
00170
00171 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
00172 typedef EpetraImportT<long long> EpetraImport64;
00173 #endif
00174
00175 }
00176
00177 #endif // XPETRA_EPETRAIMPORT_HPP