46 #ifndef XPETRA_TPETRAMAP_DEF_HPP
47 #define XPETRA_TPETRAMAP_DEF_HPP
60 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
61 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
65 GlobalOrdinal indexBase,
69 : TpetraMap(numGlobalElements, indexBase, comm, lg)
74 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
77 GlobalOrdinal indexBase,
80 : map_ (
Teuchos::
rcp (new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
87 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
88 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
92 size_t numLocalElements,
93 GlobalOrdinal indexBase,
96 :
TpetraMap(numGlobalElements, numLocalElements, indexBase, comm)
101 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
104 size_t numLocalElements,
105 GlobalOrdinal indexBase,
107 : map_ (
Teuchos::
rcp (new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
114 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
115 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
120 GlobalOrdinal indexBase,
123 :
TpetraMap(numGlobalElements, elementList, indexBase, comm)
128 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
132 GlobalOrdinal indexBase,
134 : map_(
Teuchos::
rcp(new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
141 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
142 #ifdef HAVE_XPETRA_TPETRA
145 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
148 const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
149 GlobalOrdinal indexBase,
151 : map_(
Teuchos::
rcp(new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
160 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
166 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
168 {
XPETRA_MONITOR(
"TpetraMap::getGlobalNumElements");
return map_->getGlobalNumElements(); }
170 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
172 {
XPETRA_MONITOR(
"TpetraMap::getNodeNumElements");
return map_->getNodeNumElements(); }
174 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
176 {
XPETRA_MONITOR(
"TpetraMap::getIndexBase");
return map_->getIndexBase(); }
178 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
180 {
XPETRA_MONITOR(
"TpetraMap::getMinLocalIndex");
return map_->getMinLocalIndex(); }
182 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
184 {
XPETRA_MONITOR(
"TpetraMap::getMaxLocalIndex");
return map_->getMaxLocalIndex(); }
186 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
188 {
XPETRA_MONITOR(
"TpetraMap::getMinGlobalIndex");
return map_->getMinGlobalIndex(); }
190 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
192 {
XPETRA_MONITOR(
"TpetraMap::getMaxGlobalIndex");
return map_->getMaxGlobalIndex(); }
194 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
196 {
XPETRA_MONITOR(
"TpetraMap::getMinAllGlobalIndex");
return map_->getMinAllGlobalIndex(); }
198 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
200 {
XPETRA_MONITOR(
"TpetraMap::getMaxAllGlobalIndex");
return map_->getMaxAllGlobalIndex(); }
202 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
204 {
XPETRA_MONITOR(
"TpetraMap::getLocalElement");
return map_->getLocalElement(globalIndex); }
206 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
208 {
XPETRA_MONITOR(
"TpetraMap::getGlobalElement");
return map_->getGlobalElement(localIndex); }
210 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
212 {
XPETRA_MONITOR(
"TpetraMap::getRemoteIndexList");
return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList)); }
214 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
216 {
XPETRA_MONITOR(
"TpetraMap::getRemoteIndexList");
return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
218 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
220 {
XPETRA_MONITOR(
"TpetraMap::getNodeElementList");
return map_->getNodeElementList(); }
222 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
224 {
XPETRA_MONITOR(
"TpetraMap::isNodeLocalElement");
return map_->isNodeLocalElement(localIndex); }
226 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
228 {
XPETRA_MONITOR(
"TpetraMap::isNodeGlobalElement");
return map_->isNodeGlobalElement(globalIndex); }
230 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
232 {
XPETRA_MONITOR(
"TpetraMap::isContiguous");
return map_->isContiguous(); }
234 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
236 {
XPETRA_MONITOR(
"TpetraMap::isDistributed");
return map_->isDistributed(); }
238 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
242 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
246 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
249 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
251 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
256 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
258 {
XPETRA_MONITOR(
"TpetraMap::description");
return map_->description(); }
260 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
262 {
XPETRA_MONITOR(
"TpetraMap::describe"); map_->describe(out, verbLevel); }
264 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
267 return toXpetra(map_->removeEmptyProcesses());
270 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
273 return toXpetra(map_->replaceCommWithSubset(newComm));
276 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
280 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
283 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
288 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
289 #ifdef HAVE_XPETRA_TPETRA
291 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
294 return map_->getLocalMap();
300 #ifdef HAVE_XPETRA_EPETRA
302 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
303 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
308 :
public virtual Map<int,int,EpetraNode> {
320 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
327 :
TpetraMap(numGlobalElements, indexBase, comm, lg)
341 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
344 size_t numLocalElements,
345 GlobalOrdinal indexBase,
348 :
TpetraMap(numGlobalElements, numLocalElements, indexBase, comm)
354 size_t numLocalElements,
362 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
366 GlobalOrdinal indexBase,
369 :
TpetraMap(numGlobalElements, elementList, indexBase, comm)
463 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
482 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
483 template<
class Node2>
487 return Teuchos::null;
506 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
507 #ifdef HAVE_XPETRA_TPETRA
510 local_map_type getLocalMap ()
const {
511 return local_map_type();
521 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
522 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
526 :
public virtual Map<int,long long,EpetraNode> {
537 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
544 :
TpetraMap(numGlobalElements, indexBase, comm, lg)
555 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
558 size_t numLocalElements,
559 GlobalOrdinal indexBase,
562 :
TpetraMap(numGlobalElements, numLocalElements, indexBase, comm)
566 size_t numLocalElements,
573 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
577 GlobalOrdinal indexBase,
580 :
TpetraMap(numGlobalElements, elementList, indexBase, comm)
671 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
690 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
691 template<
class Node2>
695 return Teuchos::null;
714 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
715 #ifdef HAVE_XPETRA_TPETRA
718 local_map_type getLocalMap ()
const {
720 return local_map_type();
735 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
742 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
#define XPETRA_MONITOR(funcName)
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
bool operator!=(const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map1, const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map2)
Returns true if map is not identical to this map. Implemented in TpetraMap::isSameAs().
bool operator==(const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map1, const Xpetra::TpetraMap< LocalOrdinal, GlobalOrdinal, Node > &map2)
Returns true if map is identical to this map. Implemented in TpetraMap::isSameAs().
static const EVerbosityLevel verbLevel_default
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
GlobalOrdinal getIndexBase() const
The index base for this Map.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
std::string description() const
Return a simple one-line description of this object.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
TpetraMap(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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process IDs for the given global IDs.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra 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 node.
TpetraMap(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 getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
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 node.
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 FancyOStream.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
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 FancyOStream.
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
bool isContiguous() const
True if this Map is distributed contiguously, else false.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
TpetraMap(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 getIndexBase() const
The index base for this Map.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process IDs for the given global IDs.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor with a user-defined contiguous distribution.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed)
Constructor with Tpetra-defined contiguous uniform distribution.
std::string description() const
Return a simple one-line description of this object.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.
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 FancyOStream.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
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 isContiguous() const
True if this Map is distributed contiguously, else false.
TpetraMap(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 isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
GlobalOrdinal getIndexBase() const
The index base for this Map.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
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 node.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
size_t global_size_t
Global size_t object.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Map< LocalOrdinal, GlobalOrdinal, Node1 > &map, const RCP< Node2 > &node2)