46 #ifndef XPETRA_EPETRAMAP_HPP 47 #define XPETRA_EPETRAMAP_HPP 52 #include "Xpetra_Map.hpp" 54 #include <Epetra_Map.h> 55 #include <Epetra_BlockMap.h> 66 template<
class GlobalOrdinal,
class Node>
67 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> > &);
75 template<
class GlobalOrdinal,
class Node>
76 const RCP< const Map<int, GlobalOrdinal, Node> >
toXpetra(
const Epetra_BlockMap &);
79 template<
class GlobalOrdinal,
class Node>
81 :
public virtual Map<int, GlobalOrdinal, Node>
95 GlobalOrdinal indexBase,
96 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
100 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
104 EpetraMapT(
global_size_t numGlobalElements,
size_t numLocalElements, GlobalOrdinal indexBase,
const Teuchos::RCP<
const Teuchos::Comm< int > > &comm) {
106 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
111 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
112 GlobalOrdinal indexBase,
113 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm) {
115 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
162 Teuchos::ArrayView< const GlobalOrdinal >
getNodeElementList()
const {
return ArrayView< const GlobalOrdinal >(); }
192 Teuchos::RCP< const Teuchos::Comm< int > >
getComm()
const {
return Teuchos::null; }
204 void describe(Teuchos::FancyOStream &,
const Teuchos::EVerbosityLevel =Teuchos::Describable::verbLevel_default)
const { }
215 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &)
const {
return Teuchos::null; }
232 "Xpetra::EpetraMap only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
239 const RCP< const Epetra_Map > &
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(
map_); }
243 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 244 #ifdef HAVE_XPETRA_TPETRA 247 local_map_type getLocalMap ()
const {
248 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
252 #warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too." 261 RCP<const Epetra_BlockMap>
map_;
265 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 268 :
public virtual Map<int, int, EpetraNode>
285 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
290 std::string errPrefix;
291 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
294 const int myImageID = comm->getRank();
299 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
300 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
301 int localChecks[2], globalChecks[2];
304 if (numGlobalElements != rootNGE) {
305 localChecks[0] = myImageID;
308 else if (indexBase != rootIB) {
309 localChecks[0] = myImageID;
314 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
315 if (globalChecks[0] != -1) {
316 if (globalChecks[1] == 1) {
317 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
318 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
320 else if (globalChecks[1] == 2) {
321 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
322 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
326 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
327 errPrefix <<
"logic error. Please contact the Tpetra team.");
341 using Teuchos::outArg;
343 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
344 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
345 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
346 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
347 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
349 std::string errPrefix;
350 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
353 const int myImageID = comm->getRank();
358 int localChecks[2], globalChecks[2];
366 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
367 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
374 if (numLocalElements < L1 && numLocalElements != L0) {
376 localChecks[0] = myImageID;
379 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
381 localChecks[0] = myImageID;
384 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
386 localChecks[0] = myImageID;
391 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
392 if (indexBase != rootIB) {
393 localChecks[0] = myImageID;
398 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
399 if (globalChecks[0] != -1) {
400 if (globalChecks[1] == 1) {
401 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
402 errPrefix <<
"numLocal is not valid on at least one node (possibly node " 403 << globalChecks[0] <<
").");
405 else if (globalChecks[1] == 2) {
406 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
407 errPrefix <<
"numGlobal is not valid on at least one node (possibly node " 408 << globalChecks[0] <<
").");
410 else if (globalChecks[1] == 3) {
411 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
412 errPrefix <<
"numGlobal doesn't match sum of numLocal (== " 413 << global_sum <<
") on at least one node (possibly node " 414 << globalChecks[0] <<
").");
416 else if (globalChecks[1] == 4) {
417 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
418 errPrefix <<
"indexBase is not the same on all nodes (examine node " 419 << globalChecks[0] <<
").");
423 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
424 errPrefix <<
"logic error. Please contact the Tpetra team.");
431 if (numGlobalElements == GSTI) {
432 numGlobalElements = global_sum;}
439 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
441 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm)
443 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
488 const Teuchos::ArrayView< int > &nodeIDList,
489 const Teuchos::ArrayView< LocalOrdinal > &LIDList)
const 492 return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), LIDList.getRawPtr()));
498 const Teuchos::ArrayView< int > &nodeIDList)
const 501 return toXpetra(
map_->RemoteIDList(static_cast<int>(GIDList.size()), GIDList.getRawPtr(), nodeIDList.getRawPtr(), 0));
536 Teuchos::RCP< const Teuchos::Comm< int > >
getComm()
const 553 std::ostringstream oss;
554 oss << Teuchos::Describable::description();
564 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
567 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
572 using Teuchos::VERB_DEFAULT;
573 using Teuchos::VERB_NONE;
574 using Teuchos::VERB_LOW;
575 using Teuchos::VERB_MEDIUM;
576 using Teuchos::VERB_HIGH;
577 using Teuchos::VERB_EXTREME;
581 int myImageID = comm_->getRank();
582 int numImages = comm_->getSize();
584 Teuchos::EVerbosityLevel vl = verbLevel;
585 if (vl == VERB_DEFAULT) vl = VERB_LOW;
591 width = ::std::max<size_t>(width, (size_t) 12) + 2;
593 Teuchos::OSTab tab(out);
595 if (vl == VERB_NONE) {
598 else if (vl == VERB_LOW) {
602 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
603 if (myImageID == imageCtr) {
604 if (myImageID == 0) {
612 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
613 out <<
"Number of Local Elements = " << nME << endl
618 if (vl == VERB_EXTREME) {
619 out << std::setw(width) <<
"Node ID" 620 << std::setw(width) <<
"Local Index" 621 << std::setw(width) <<
"Global Index" 623 for (
size_t i=0; i < nME; i++) {
624 out << std::setw(width) << myImageID
625 << std::setw(width) << i
626 << std::setw(width) << myEntries[i]
647 const Epetra_BlockMap * NewMap =
map_->RemoveEmptyProcesses();
649 return Teuchos::null;
651 const RCP< const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
658 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &)
const {
659 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
660 TEUCHOS_UNREACHABLE_RETURN(Teuchos::null);
670 if (gid ==
map_->IndexBase64()-1)
return (-1);
683 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
690 const RCP< const Epetra_Map >
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(
map_); }
696 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 697 #ifdef HAVE_XPETRA_TPETRA 700 local_map_type getLocalMap ()
const {
701 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
705 mutable local_map_type localMap_;
708 #warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too." 715 RCP<const Epetra_BlockMap>
map_;
717 #endif // #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 720 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 723 :
public virtual Map<int, long long, EpetraNode>
740 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
745 std::string errPrefix;
746 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,indexBase,comm,lOrG): ";
749 const int myImageID = comm->getRank();
754 Teuchos::broadcast<int,global_size_t>(*comm,0,&rootNGE);
755 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
756 int localChecks[2], globalChecks[2];
759 if (numGlobalElements != rootNGE) {
760 localChecks[0] = myImageID;
763 else if (indexBase != rootIB) {
764 localChecks[0] = myImageID;
769 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
770 if (globalChecks[0] != -1) {
771 if (globalChecks[1] == 1) {
772 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
773 errPrefix <<
"numGlobal must be the same on all nodes (examine node " << globalChecks[0] <<
").");
775 else if (globalChecks[1] == 2) {
776 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
777 errPrefix <<
"indexBase must be the same on all nodes (examine node " << globalChecks[0] <<
").");
781 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
782 errPrefix <<
"logic error. Please contact the Tpetra team.");
795 using Teuchos::outArg;
797 const size_t L0 = Teuchos::OrdinalTraits<size_t>::zero();
798 const size_t L1 = Teuchos::OrdinalTraits<size_t>::one();
799 const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
800 const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
801 const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();
803 std::string errPrefix;
804 errPrefix = Teuchos::typeName(*
this) +
"::constructor(numGlobal,numLocal,indexBase,platform): ";
807 const int myImageID = comm->getRank();
812 int localChecks[2], globalChecks[2];
820 Teuchos::reduceAll<int,global_size_t>(*comm,Teuchos::REDUCE_SUM,
821 Teuchos::as<global_size_t>(numLocalElements),outArg(global_sum));
828 if (numLocalElements < L1 && numLocalElements != L0) {
830 localChecks[0] = myImageID;
833 else if (numGlobalElements < GST1 && numGlobalElements != GST0 && numGlobalElements != GSTI) {
835 localChecks[0] = myImageID;
838 else if (numGlobalElements != GSTI && numGlobalElements != global_sum) {
840 localChecks[0] = myImageID;
845 Teuchos::broadcast<int,GlobalOrdinal>(*comm,0,&rootIB);
846 if (indexBase != rootIB) {
847 localChecks[0] = myImageID;
852 Teuchos::reduceAll<int,int>(*comm,Teuchos::REDUCE_MAX,2,localChecks,globalChecks);
853 if (globalChecks[0] != -1) {
854 if (globalChecks[1] == 1) {
855 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
856 errPrefix <<
"numLocal is not valid on at least one node (possibly node " 857 << globalChecks[0] <<
").");
859 else if (globalChecks[1] == 2) {
860 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
861 errPrefix <<
"numGlobal is not valid on at least one node (possibly node " 862 << globalChecks[0] <<
").");
864 else if (globalChecks[1] == 3) {
865 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
866 errPrefix <<
"numGlobal doesn't match sum of numLocal (== " 867 << global_sum <<
") on at least one node (possibly node " 868 << globalChecks[0] <<
").");
870 else if (globalChecks[1] == 4) {
871 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
872 errPrefix <<
"indexBase is not the same on all nodes (examine node " 873 << globalChecks[0] <<
").");
877 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::logic_error,
878 errPrefix <<
"logic error. Please contact the Tpetra team.");
885 if (numGlobalElements == GSTI) {
886 numGlobalElements = global_sum;}
893 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
895 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm)
897 if (numGlobalElements == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
940 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())); }
943 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)); }
989 std::ostringstream oss;
990 oss << Teuchos::Describable::description();
1000 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
1003 const Teuchos::RCP<const Teuchos::Comm<int> > comm_ =
getComm();
1008 using Teuchos::VERB_DEFAULT;
1009 using Teuchos::VERB_NONE;
1010 using Teuchos::VERB_LOW;
1011 using Teuchos::VERB_MEDIUM;
1012 using Teuchos::VERB_HIGH;
1013 using Teuchos::VERB_EXTREME;
1017 int myImageID = comm_->getRank();
1018 int numImages = comm_->getSize();
1020 Teuchos::EVerbosityLevel vl = verbLevel;
1021 if (vl == VERB_DEFAULT) vl = VERB_LOW;
1027 width = ::std::max<size_t>(width, (size_t) 12) + 2;
1029 Teuchos::OSTab tab(out);
1031 if (vl == VERB_NONE) {
1034 else if (vl == VERB_LOW) {
1038 for (
int imageCtr = 0; imageCtr < numImages; ++imageCtr) {
1039 if (myImageID == imageCtr) {
1040 if (myImageID == 0) {
1048 if (vl == VERB_HIGH || vl == VERB_EXTREME) {
1049 out <<
"Number of Local Elements = " << nME << endl
1054 if (vl == VERB_EXTREME) {
1055 out << std::setw(width) <<
"Node ID" 1056 << std::setw(width) <<
"Local Index" 1057 << std::setw(width) <<
"Global Index" 1059 for (
size_t i=0; i < nME; i++) {
1060 out << std::setw(width) << myImageID
1061 << std::setw(width) << i
1062 << std::setw(width) << myEntries[i]
1083 const Epetra_BlockMap * NewMap =
map_->RemoveEmptyProcesses();
1085 return Teuchos::null;
1087 const RCP< const Map<int, GlobalOrdinal, Node> > NewMapX = toXpetra<GlobalOrdinal, Node>(*NewMap);
1094 RCP<const Map<int,GlobalOrdinal,Node> >
replaceCommWithSubset(
const Teuchos::RCP<
const Teuchos::Comm< int > > &)
const {
1095 throw std::runtime_error(
"Xpetra::EpetraMapT::replaceCommWithSubset has not yet been implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
1106 if (gid ==
map_->IndexBase64()-1)
return (-1);
1119 TEUCHOS_TEST_FOR_EXCEPTION(!map->GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraMapT: GlobalOrdinal mismatch.");
1126 const RCP< const Epetra_Map > &
getEpetra_MapRCP()
const {
return Teuchos::rcp_static_cast<
const Epetra_Map>(
map_); }
1130 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 1131 #ifdef HAVE_XPETRA_TPETRA 1134 local_map_type getLocalMap ()
const {
1135 throw std::runtime_error(
"Xpetra::EpetraMap::getLocalMap is not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
1139 mutable local_map_type localMap_;
1142 #warning "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too." 1153 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 1157 #endif // XPETRA_EPETRAMAP_HPP GlobalOrdinal global_ordinal_type
virtual ~EpetraMapT()
Destructor.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
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?)
const Epetra_BlockMap & getEpetra_BlockMap() const
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.
LocalOrdinal getLocalElement(GlobalOrdinal) 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.
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.
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.
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)
bool isNodeLocalElement(LocalOrdinal) const
Whether the given local index is valid for this Map on this process.
RCP< const Map< int, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
const Epetra_Map & getEpetra_Map() const
GlobalOrdinal getGlobalElement(LocalOrdinal) const
Return the global index for a given local index. Note that this returns -1 if not found on this proce...
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &) const
True if and only if map is identical to this Map.
const RCP< const Epetra_Map > & getEpetra_MapRCP() const
Get the underlying Epetra map.
const RCP< const Epetra_Map > getEpetra_MapRCP() const
Get the underlying Epetra map.
EpetraMapT(const Teuchos::RCP< const Epetra_BlockMap > &map)
EpetraMapT constructor to wrap a Epetra_Map object.
const Epetra_BlockMap & getEpetra_BlockMap() const
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.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &, const Teuchos::ArrayView< int > &, const Teuchos::ArrayView< LocalOrdinal > &) const
Return the process ranks and corresponding local indices for the given global indices.
RCP< const Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
EpetraMapT(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
bool isNodeGlobalElement(GlobalOrdinal) const
Whether the given global index is valid for this Map on this process.
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.
EpetraMapT(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
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.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
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.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &, const Teuchos::ArrayView< int > &) const
Return the process ranks for the given global indices.
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.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
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.
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.
const RCP< const Epetra_Map > & getEpetra_MapRCP() const
Get the underlying Epetra map.
EpetraMapT(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
void describe(Teuchos::FancyOStream &, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
RCP< const Epetra_BlockMap > map_
global_size_t getGlobalNumElements() const
The number of elements in this Map.
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 Map< int, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &) const
Replace this Map's communicator with a subset communicator.
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.
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.
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.
#define XPETRA_MONITOR(funcName)
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::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this process.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
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)
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
const Epetra_BlockMap & getEpetra_BlockMap() const
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, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
EpetraMapT(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
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.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &) const
True if and only if map is compatible with this Map.