49 #ifndef XPETRA_STRIDEDMAP_DECL_HPP
50 #define XPETRA_STRIDEDMAP_DECL_HPP
52 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
53 #include <Teuchos_Describable.hpp>
98 template <
class LocalOrdinal,
100 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
101 class StridedMap :
public virtual Map<LocalOrdinal, GlobalOrdinal, Node> {
109 #undef XPETRA_STRIDEDMAP_SHORT
138 GlobalOrdinal indexBase,
139 std::vector<size_t>& stridingInfo,
140 const Teuchos::RCP<
const Teuchos::Comm<int>>& comm,
141 LocalOrdinal stridedBlockId = -1,
142 GlobalOrdinal offset = 0,
169 size_t numLocalElements,
170 GlobalOrdinal indexBase,
171 std::vector<size_t>& stridingInfo,
172 const Teuchos::RCP<
const Teuchos::Comm<int>>& comm,
173 LocalOrdinal stridedBlockId = -1,
174 GlobalOrdinal offset = 0);
189 const Teuchos::ArrayView<const GlobalOrdinal>& elementList,
190 GlobalOrdinal indexBase,
191 std::vector<size_t>& stridingInfo,
192 const Teuchos::RCP<
const Teuchos::Comm<int>>& comm,
193 LocalOrdinal stridedBlockId = -1);
196 std::vector<size_t>& stridingInfo,
198 LocalOrdinal stridedBlockId = -1,
199 GlobalOrdinal offset = 0);
236 RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
getMap()
const;
238 #ifdef HAVE_XPETRA_TPETRA
243 return map_->getLocalMap();
245 #else // HAVE_XPETRA_TPETRA
248 "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
250 #endif // HAVE_XPETRA_TPETRA ELSE
292 RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
map_;
349 const Teuchos::ArrayView<int>& nodeIDList,
350 const Teuchos::ArrayView<LocalOrdinal>& LIDList)
const;
354 const Teuchos::ArrayView<int>& nodeIDList)
const;
383 Teuchos::RCP<const Teuchos::Comm<int>>
getComm()
const;
393 void describe(Teuchos::FancyOStream& out,
394 const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const;
403 #define XPETRA_STRIDEDMAP_SHORT
404 #endif // XPETRA_STRIDEDMAP_DECL_HPP
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a list of the global indices owned by this node.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Returns the node IDs and corresponding local indices for a given list of global indices.
LocalOrdinal getStridedBlockId() const
GlobalOrdinal getMaxGlobalIndex() const
Returns maximum global index owned by this node.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
Return the global index for a given local index.
size_t GID2StridingBlockId(GlobalOrdinal gid) const
LocalOrdinal local_ordinal_type
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
GlobalOrdinal global_ordinal_type
bool isContiguous() const
Returns true if this Map is distributed contiguously; returns false otherwise.
void setStridingData(std::vector< size_t > stridingInfo)
size_t getLocalNumElements() const
Returns the number of elements belonging to the calling node.
GlobalOrdinal indexBase_
Index base for the strided map (default = 0)
GlobalOrdinal getOffset() const
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
LocalOrdinal getMaxLocalIndex() const
Returns maximum local index.
LocalOrdinal stridedBlockId_
Member variable denoting which dofs are stored in map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get the Comm object for this Map.
bool isCompatible(const Map &map) const
Returns true if map is compatible with this Map.
std::string description() const
Return a simple one-line description of this object.
GlobalOrdinal getMaxAllGlobalIndex() const
Return the maximum global index over all nodes.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
Returns true if the global index is found in this Map on this node; returns false if it isn't...
bool isNodeLocalElement(LocalOrdinal localIndex) const
Returns true if the local index is valid for this Map on this node; returns false if it isn't...
bool isStrided() const
returns true, if this is a strided map (i.e. more than 1 strided blocks)
bool isSameAs(const Map &map) const
Returns true if map is identical to this Map.
std::vector< size_t > stridingInfo_
Vector with size of strided blocks (dofs)
RCP< const Map > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
RCP< const Map > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int >> &newComm) const
bool isDistributed() const
Returns true if this Map is distributed across more than one node; returns false otherwise.
size_t getFixedBlockSize() const
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process on the Map's device.
GlobalOrdinal offset_
Offset for gids in map (default = 0)
GlobalOrdinal getMinGlobalIndex() const
Returns minimum global index owned by this node.
size_t global_size_t
Global size_t object.
GlobalOrdinal getIndexBase() const
Returns the index base for this Map.
RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
global_size_t getGlobalNumElements() const
Returns the number of elements in this Map.
Kokkos::View< const global_ordinal_type *, typename Node::device_type > global_indices_array_device_type
virtual bool CheckConsistency()
std::vector< size_t > getStridingData() const
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
Return the local index for a given global index.
StridedMap(UnderlyingLib xlib, global_size_t numGlobalElements, GlobalOrdinal indexBase, std::vector< size_t > &stridingInfo, const Teuchos::RCP< const Teuchos::Comm< int >> &comm, LocalOrdinal stridedBlockId=-1, GlobalOrdinal offset=0, LocalGlobal lg=GloballyDistributed)
Map constructor with contiguous uniform distribution.
LocalOrdinal getMinLocalIndex() const
Returns minimum local index.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
GlobalOrdinal getMinAllGlobalIndex() const
Return the minimum global index over all nodes.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to a FancyOStream object.
Map< LocalOrdinal, GlobalOrdinal, Node >::global_indices_array_device_type global_indices_array_device_type
virtual ~StridedMap()
Destructor.
void setOffset(GlobalOrdinal offset)
RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > map_