46 #ifndef XPETRA_EPETRAMAP_HPP 47 #define XPETRA_EPETRAMAP_HPP 55 #include <Epetra_Map.h> 56 #include <Epetra_BlockMap.h> 67 template<
class GlobalOrdinal,
class Node>
68 const Epetra_Map &
toEpetra(
const Map<int,GlobalOrdinal, Node> &);
69 template<
class GlobalOrdinal,
class Node>
70 const Epetra_Map &
toEpetra(
const RCP<
const Map<int, GlobalOrdinal, Node> > &);
73 template<
class GlobalOrdinal,
class Node>
74 const RCP< const Map<int, GlobalOrdinal, Node> >
toXpetra(
const Epetra_BlockMap &);
78 template<
class GlobalOrdinal,
class Node>
80 :
public virtual Map<int, GlobalOrdinal, Node>
95 return KokkosClassic::Details::getNode<Node>();
103 GlobalOrdinal indexBase,
104 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
108 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
112 EpetraMapT(
global_size_t numGlobalElements,
size_t numLocalElements, GlobalOrdinal indexBase,
const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
const Teuchos::RCP< Node > &node=
defaultArgNode()) {
114 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
119 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
120 GlobalOrdinal indexBase,
121 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
124 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
171 Teuchos::ArrayView< const GlobalOrdinal >
getNodeElementList()
const {
return ArrayView< const GlobalOrdinal >(); }
201 Teuchos::RCP< const Teuchos::Comm< int > >
getComm()
const {
return Teuchos::null; }
206 return KokkosClassic::Details::getNode<Node>();
218 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
229 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &newComm)
const {
return Teuchos::null; }
246 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
261 RCP<const Epetra_BlockMap>
map_;
265 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 268 :
public virtual Map<int, int, EpetraNode>
285 return KokkosClassic::Details::getNode<Node>();
294 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
299 std::string errPrefix;
300 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
303 const int myImageID = comm->getRank();
308 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
309 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
310 int localChecks[2], globalChecks[2];
313 if (numGlobalElements != rootNGE) {
314 localChecks[0] = myImageID;
317 else if (indexBase != rootIB) {
318 localChecks[0] = myImageID;
323 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
324 if (globalChecks[0] != -1) {
325 if (globalChecks[1] == 1) {
326 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
327 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
329 else if (globalChecks[1] == 2) {
330 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
331 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
335 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
336 errPrefix <<
"logic error. Please contact the Tpetra team.");
349 using Teuchos::outArg;
351 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
352 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
353 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
354 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
355 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
357 std::string errPrefix;
358 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
361 const int myImageID = comm->getRank();
366 int localChecks[2], globalChecks[2];
374 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
375 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
382 if (numLocalElements < L1 && numLocalElements != L0) {
384 localChecks[0] = myImageID;
387 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
389 localChecks[0] = myImageID;
392 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
394 localChecks[0] = myImageID;
399 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
400 if (indexBase != rootIB) {
401 localChecks[0] = myImageID;
406 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
407 if (globalChecks[0] != -1) {
408 if (globalChecks[1] == 1) {
409 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
410 errPrefix <<
"numLocal is not valid on at least one node (possibly node " 411 << globalChecks[0] <<
").");
413 else if (globalChecks[1] == 2) {
414 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
415 errPrefix <<
"numGlobal is not valid on at least one node (possibly node " 416 << globalChecks[0] <<
").");
418 else if (globalChecks[1] == 3) {
419 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
420 errPrefix <<
"numGlobal doesn't match sum of numLocal (== " 421 << global_sum <<
") on at least one node (possibly node " 422 << globalChecks[0] <<
").");
424 else if (globalChecks[1] == 4) {
425 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
426 errPrefix <<
"indexBase is not the same on all nodes (examine node " 427 << globalChecks[0] <<
").");
431 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
432 errPrefix <<
"logic error. Please contact the Tpetra team.");
439 if (numGlobalElements == GSTI) {
440 numGlobalElements = global_sum;}
447 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
449 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
451 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
494 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList,
const Teuchos::ArrayView< LocalOrdinal > &LIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr())); }
497 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0)); }
535 return KokkosClassic::Details::getNode<Node>();
548 std::ostringstream oss;
549 oss << Teuchos::Describable::description();
559 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
562 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
567 using Teuchos::VERB_DEFAULT;
568 using Teuchos::VERB_NONE;
569 using Teuchos::VERB_LOW;
570 using Teuchos::VERB_MEDIUM;
571 using Teuchos::VERB_HIGH;
572 using Teuchos::VERB_EXTREME;
576 int myImageID = comm_->getRank();
577 int numImages = comm_->getSize();
579 Teuchos::EVerbosityLevel vl = verbLevel;
580 if (vl == VERB_DEFAULT) vl = VERB_LOW;
586 width = ::std::max<size_t>(width, (size_t) 12) + 2;
588 Teuchos::OSTab tab(out);
590 if (vl == VERB_NONE) {
593 else if (vl == VERB_LOW) {
597 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
598 if (myImageID == imageCtr) {
599 if (myImageID == 0) {
607 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
608 out <<
"Number of Local Elements = " << nME << endl
613 if (vl == VERB_EXTREME) {
614 out << std::setw(width) <<
"Node ID" 615 << std::setw(width) <<
"Local Index" 616 << std::setw(width) <<
"Global Index" 618 for (
size_t i=0; i < nME; i++) {
619 out << std::setw(width) << myImageID
620 << std::setw(width) << i
621 << std::setw(width) << myEntries[i]
642 const Epetra_BlockMap * NewMap =
map_->RemoveEmptyProcesses();
644 return Teuchos::null;
646 const RCP< const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
653 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &newComm)
const {
654 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented.");
655 return Teuchos::null;
665 if (gid ==
map_->IndexBase64()-1)
return (-1);
678 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
693 RCP<const Epetra_BlockMap>
map_;
695 #endif // #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 698 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 701 :
public virtual Map<int, long long, EpetraNode>
718 return KokkosClassic::Details::getNode<Node>();
727 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
732 std::string errPrefix;
733 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
736 const int myImageID = comm->getRank();
741 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
742 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
743 int localChecks[2], globalChecks[2];
746 if (numGlobalElements != rootNGE) {
747 localChecks[0] = myImageID;
750 else if (indexBase != rootIB) {
751 localChecks[0] = myImageID;
756 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
757 if (globalChecks[0] != -1) {
758 if (globalChecks[1] == 1) {
759 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
760 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
762 else if (globalChecks[1] == 2) {
763 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
764 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
768 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
769 errPrefix <<
"logic error. Please contact the Tpetra team.");
782 using Teuchos::outArg;
784 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
785 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
786 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
787 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
788 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
790 std::string errPrefix;
791 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
794 const int myImageID = comm->getRank();
799 int localChecks[2], globalChecks[2];
807 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
808 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
815 if (numLocalElements < L1 && numLocalElements != L0) {
817 localChecks[0] = myImageID;
820 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
822 localChecks[0] = myImageID;
825 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
827 localChecks[0] = myImageID;
832 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
833 if (indexBase != rootIB) {
834 localChecks[0] = myImageID;
839 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
840 if (globalChecks[0] != -1) {
841 if (globalChecks[1] == 1) {
842 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
843 errPrefix <<
"numLocal is not valid on at least one node (possibly node " 844 << globalChecks[0] <<
").");
846 else if (globalChecks[1] == 2) {
847 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
848 errPrefix <<
"numGlobal is not valid on at least one node (possibly node " 849 << globalChecks[0] <<
").");
851 else if (globalChecks[1] == 3) {
852 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
853 errPrefix <<
"numGlobal doesn't match sum of numLocal (== " 854 << global_sum <<
") on at least one node (possibly node " 855 << globalChecks[0] <<
").");
857 else if (globalChecks[1] == 4) {
858 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
859 errPrefix <<
"indexBase is not the same on all nodes (examine node " 860 << globalChecks[0] <<
").");
864 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
865 errPrefix <<
"logic error. Please contact the Tpetra team.");
872 if (numGlobalElements == GSTI) {
873 numGlobalElements = global_sum;}
880 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
882 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
884 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
927 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList,
const Teuchos::ArrayView< LocalOrdinal > &LIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr())); }
930 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList)
const {
XPETRA_MONITOR(
"EpetraMapT::getRemoteIndexList");
return toXpetra(
map_->RemoteIDList(GIDList.size(), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0)); }
968 return KokkosClassic::Details::getNode<Node>();
981 std::ostringstream oss;
982 oss << Teuchos::Describable::description();
992 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
995 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
1000 using Teuchos::VERB_DEFAULT;
1001 using Teuchos::VERB_NONE;
1002 using Teuchos::VERB_LOW;
1003 using Teuchos::VERB_MEDIUM;
1004 using Teuchos::VERB_HIGH;
1005 using Teuchos::VERB_EXTREME;
1009 int myImageID = comm_->getRank();
1010 int numImages = comm_->getSize();
1012 Teuchos::EVerbosityLevel vl = verbLevel;
1013 if (vl == VERB_DEFAULT) vl = VERB_LOW;
1019 width = ::std::max<size_t>(width, (size_t) 12) + 2;
1021 Teuchos::OSTab tab(out);
1023 if (vl == VERB_NONE) {
1026 else if (vl == VERB_LOW) {
1030 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1031 if (myImageID == imageCtr) {
1032 if (myImageID == 0) {
1040 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
1041 out <<
"Number of Local Elements = " << nME << endl
1046 if (vl == VERB_EXTREME) {
1047 out << std::setw(width) <<
"Node ID" 1048 << std::setw(width) <<
"Local Index" 1049 << std::setw(width) <<
"Global Index" 1051 for (
size_t i=0; i < nME; i++) {
1052 out << std::setw(width) << myImageID
1053 << std::setw(width) << i
1054 << std::setw(width) << myEntries[i]
1075 const Epetra_BlockMap * NewMap =
map_->RemoveEmptyProcesses();
1077 return Teuchos::null;
1079 const RCP< const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
1086 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &newComm)
const {
1087 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented.");
1088 return Teuchos::null;
1098 if (gid ==
map_->IndexBase64()-1)
return (-1);
1111 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
1128 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 1132 #endif // XPETRA_EPETRAMAP_HPP GlobalOrdinal global_ordinal_type
virtual ~EpetraMapT()
Destructor.
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
global_size_t getGlobalNumElements() const
The number of elements in this Map.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with a user-defined contiguous distribution.
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
EpetraMapT(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
GlobalOrdinal global_ordinal_type
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
LocalOrdinal local_ordinal_type
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
std::string description() const
Return a simple one-line description of this object.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with Tpetra-defined contiguous uniform distribution.
EpetraMapT(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
Exception throws to report errors in the internal logical of the program.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process ranks and corresponding local indices for the given global indices.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
const Epetra_Map & getEpetra_Map() const
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
UnderlyingLib lib() const
Get the library used by this object (Epetra or Epetra?)
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
GlobalOrdinal getIndexBase() const
The index base for this Map.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
const Epetra_Map & getEpetra_Map() const
GlobalOrdinal getIndexBase() const
The index base for this Map.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
bool isNodeLocalElement(LocalOrdinal localIndex) const
Whether the given local index is valid for this Map on this process.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
bool isContiguous() const
True if this Map is distributed contiguously, else false.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
GlobalOrdinal getIndexBase() const
The index base for this Map.
std::string description() const
Return a simple one-line description of this object.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
RCP< const Epetra_BlockMap > map_
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Whether the given global index is valid for this Map on this process.
#define IF_EPETRA_EXCEPTION_THEN_THROW_GLOBAL_INVALID_ARG(sourceCode)
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
virtual ~EpetraMapT()
Destructor.
static Teuchos::RCP< Node > defaultArgNode()
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
RCP< const Epetra_BlockMap > map_
size_t global_size_t
Global size_t object.
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
static Teuchos::RCP< Node > defaultArgNode()
RCP< const Epetra_BlockMap > map_
global_size_t getGlobalNumElements() const
The number of elements in this Map.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with Tpetra-defined contiguous uniform distribution.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process ranks and corresponding local indices for the given global indices.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
GlobalOrdinal global_ordinal_type
virtual ~EpetraMapT()
Destructor.
LocalOrdinal local_ordinal_type
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with a user-defined contiguous distribution.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
static Teuchos::RCP< Node > defaultArgNode()
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process ranks for the given global indices.
#define XPETRA_MONITOR(funcName)
Teuchos::RCP< Node > getNode() const
Get this Map's Node object.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process ranks and corresponding local indices for the given global indices.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
const Epetra_BlockMap & getEpetra_BlockMap() const
Get the underlying Epetra map.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with a user-defined contiguous distribution.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with Tpetra-defined contiguous uniform distribution.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
const Epetra_Map & getEpetra_Map() const
LocalOrdinal getMinLocalIndex() const
The minimum local index.
std::string description() const
Return a simple one-line description of this object.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
EpetraMapT(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.