46#ifndef XPETRA_TPETRAMAP_DEF_HPP
47#define XPETRA_TPETRAMAP_DEF_HPP
62 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
65 GlobalOrdinal indexBase,
68 : map_ (
Teuchos::rcp (new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
77 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 size_t numLocalElements,
81 GlobalOrdinal indexBase,
83 : map_ (
Teuchos::rcp (new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
92 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
96 GlobalOrdinal indexBase,
98 : map_(
Teuchos::rcp(new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
105#ifdef HAVE_XPETRA_TPETRA
108 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
111 const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
112 GlobalOrdinal indexBase,
114 : map_(
Teuchos::rcp(new Tpetra::
Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
122template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
128template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
130{
XPETRA_MONITOR(
"TpetraMap::getGlobalNumElements");
return map_->getGlobalNumElements(); }
132template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
134{
XPETRA_MONITOR(
"TpetraMap::getLocalNumElements");
return map_->getLocalNumElements(); }
136template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
138{
XPETRA_MONITOR(
"TpetraMap::getIndexBase");
return map_->getIndexBase(); }
140template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
142{
XPETRA_MONITOR(
"TpetraMap::getMinLocalIndex");
return map_->getMinLocalIndex(); }
144template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
146{
XPETRA_MONITOR(
"TpetraMap::getMaxLocalIndex");
return map_->getMaxLocalIndex(); }
148template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
150{
XPETRA_MONITOR(
"TpetraMap::getMinGlobalIndex");
return map_->getMinGlobalIndex(); }
152template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
154{
XPETRA_MONITOR(
"TpetraMap::getMaxGlobalIndex");
return map_->getMaxGlobalIndex(); }
156template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
158{
XPETRA_MONITOR(
"TpetraMap::getMinAllGlobalIndex");
return map_->getMinAllGlobalIndex(); }
160template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
162{
XPETRA_MONITOR(
"TpetraMap::getMaxAllGlobalIndex");
return map_->getMaxAllGlobalIndex(); }
164template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
166{
XPETRA_MONITOR(
"TpetraMap::getLocalElement");
return map_->getLocalElement(globalIndex); }
168template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
170{
XPETRA_MONITOR(
"TpetraMap::getGlobalElement");
return map_->getGlobalElement(localIndex); }
172template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
174{
XPETRA_MONITOR(
"TpetraMap::getRemoteIndexList");
return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList)); }
176template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
178{
XPETRA_MONITOR(
"TpetraMap::getRemoteIndexList");
return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
180template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
182{
XPETRA_MONITOR(
"TpetraMap::getLocalElementList");
return map_->getLocalElementList(); }
184template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
186{
XPETRA_MONITOR(
"TpetraMap::isNodeLocalElement");
return map_->isNodeLocalElement(localIndex); }
188template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
190{
XPETRA_MONITOR(
"TpetraMap::isNodeGlobalElement");
return map_->isNodeGlobalElement(globalIndex); }
192template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
194{
XPETRA_MONITOR(
"TpetraMap::isContiguous");
return map_->isContiguous(); }
196template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
198{
XPETRA_MONITOR(
"TpetraMap::isDistributed");
return map_->isDistributed(); }
200template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
204template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
208template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
212template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
214{
XPETRA_MONITOR(
"TpetraMap::description");
return map_->description(); }
216template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
218{
XPETRA_MONITOR(
"TpetraMap::describe"); map_->describe(out, verbLevel); }
220template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
223 return toXpetra(map_->removeEmptyProcesses());
226template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
229 return toXpetra(map_->replaceCommWithSubset(newComm));
232template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
236template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
239template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
244#ifdef HAVE_XPETRA_TPETRA
246template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
249 return map_->getLocalMap();
254#ifdef HAVE_XPETRA_EPETRA
256#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
257 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
262 :
public virtual Map<int,int,EpetraNode> {
288 size_t numLocalElements,
418#ifdef HAVE_XPETRA_TPETRA
431#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
432 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
436 :
public virtual Map<int,long long,EpetraNode> {
456 size_t numLocalElements,
582#ifdef HAVE_XPETRA_TPETRA
601template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
608template <
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
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() 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?)
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
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.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
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 > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
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.
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.
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.
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 getLocalNumElements() const
The number of elements belonging to the calling node.
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 getLocalNumElements() 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.
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.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
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.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
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.
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 isDistributed() const
Whether this Map is globally distributed or locally replicated.
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.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
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.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
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.
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)