46 #ifndef XPETRA_TPETRAMAP_DECL_HPP
47 #define XPETRA_TPETRAMAP_DECL_HPP
53 #include <Tpetra_Map.hpp>
62 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
63 const RCP<Map<LocalOrdinal,GlobalOrdinal,Node> >
toXpetraNonConst(
const RCP<
const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map);
65 template <
class LocalOrdinal,
69 :
public virtual Map<LocalOrdinal,GlobalOrdinal,Node> {
81 GlobalOrdinal indexBase,
82 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm,
90 size_t numLocalElements,
91 GlobalOrdinal indexBase,
92 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm);
99 const Teuchos::ArrayView< const GlobalOrdinal > &elementList,
100 GlobalOrdinal indexBase,
101 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm);
104 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
105 #ifdef HAVE_XPETRA_TPETRA
108 const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
109 GlobalOrdinal indexBase,
110 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm);
155 LookupStatus getRemoteIndexList(
const Teuchos::ArrayView< const GlobalOrdinal > &GIDList,
const Teuchos::ArrayView< int > &nodeIDList,
const Teuchos::ArrayView< LocalOrdinal > &LIDList)
const;
192 Teuchos::RCP< const Teuchos::Comm< int > >
getComm()
const;
204 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
207 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
replaceCommWithSubset (
const Teuchos::RCP<
const Teuchos::Comm<int> >& newComm)
const;
215 TpetraMap(
const Teuchos::RCP<
const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map);
221 RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > >
getTpetra_Map()
const;
223 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
224 #ifdef HAVE_XPETRA_TPETRA
227 local_map_type getLocalMap ()
const;
235 RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > >
map_;
240 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
247 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
250 if (map != Teuchos::null) {
252 return tpetraMap->getTpetra_Map();
254 return Teuchos::null;
259 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
261 TEUCHOS_TEST_FOR_EXCEPTION(map.is_null(), std::invalid_argument,
"map must be nonzero");
264 return tpetraMap->getTpetra_Map();
267 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
268 const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
toXpetra(
const RCP<
const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map) {
272 return Teuchos::null;
275 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
276 const RCP<Map<LocalOrdinal,GlobalOrdinal,Node> >
toXpetraNonConst(
const RCP<
const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map) {
280 return Teuchos::null;
284 namespace useTpetra {
287 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
288 Teuchos::RCP< const TpetraMap<LocalOrdinal,GlobalOrdinal,Node> >
297 template <
class LocalOrdinal,
class GlobalOrdinal>
298 Teuchos::RCP< const TpetraMap<LocalOrdinal,GlobalOrdinal, typename Tpetra::Map<>::node_type> >
302 return rcp(
new TpetraMap<LocalOrdinal,GlobalOrdinal,
typename Tpetra::Map<>::node_type>(
Tpetra::createContigMap<LocalOrdinal,GlobalOrdinal,
typename Tpetra::Map<>::node_type>(numElements, localNumElements, comm)));
306 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
307 Teuchos::RCP< const TpetraMap<LocalOrdinal,GlobalOrdinal,Node> >
309 const Teuchos::RCP<
const Teuchos::Comm< int > > &comm)
316 #define XPETRA_TPETRAMAP_SHORT
318 #endif // XPETRA_TPETRAMAP_DECL_HPP
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
std::string description() const
Return a simple one-line description of this object.
const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > toTpetraNonZero(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
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.
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.
virtual RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
LocalOrdinal getMinLocalIndex() const
The minimum local index.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member function to create a locally replicated Map with a specified node.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map's Comm object.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
size_t global_size_t
Global size_t object.
GlobalOrdinal getIndexBase() const
The index base for this Map.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > map_
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
#define XPETRA_MONITOR(funcName)
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal, typename Tpetra::Map<>::node_type > > createContigMap(global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member function to create a (potentially) non-uniform, contiguous Map with the default node...
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member function to create a (potentially) non-uniform, contiguous Map with a user-specified node...
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
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.
const RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > toXpetraNonConst(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
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.