49 #ifndef XPETRA_STRIDEDMAP_DECL_HPP
50 #define XPETRA_STRIDEDMAP_DECL_HPP
53 #include <Teuchos_Describable.hpp>
88 template<
class LocalOrdinal,
91 class StridedMap :
public virtual Map<LocalOrdinal, GlobalOrdinal, Node>
106 #undef XPETRA_STRIDEDMAP_SHORT
139 GlobalOrdinal indexBase,
140 std::vector<size_t>& stridingInfo,
141 const Teuchos::RCP<
const Teuchos::Comm<int>>& comm,
142 LocalOrdinal stridedBlockId = -1,
143 GlobalOrdinal offset = 0,
172 size_t numLocalElements,
173 GlobalOrdinal indexBase,
174 std::vector<size_t>& stridingInfo,
175 const Teuchos::RCP<
const Teuchos::Comm<int>>& comm,
176 LocalOrdinal stridedBlockId = -1,
177 GlobalOrdinal offset = 0);
194 const Teuchos::ArrayView<const GlobalOrdinal>& elementList,
195 GlobalOrdinal indexBase,
196 std::vector<size_t>& stridingInfo,
197 const Teuchos::RCP<
const Teuchos::Comm<int>>& comm,
198 LocalOrdinal stridedBlockId = -1);
202 std::vector<size_t>& stridingInfo,
204 LocalOrdinal stridedBlockId = -1,
205 GlobalOrdinal offset = 0);
254 RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
getMap()
const;
257 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
258 #ifdef HAVE_XPETRA_TPETRA
262 local_map_type getLocalMap()
const
264 return map_->getLocalMap();
266 #else // HAVE_XPETRA_TPETRA
269 "Xpetra Kokkos interface for CrsMatrix is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
271 #endif // HAVE_XPETRA_TPETRA ELSE
272 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
321 RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node>>
map_;
384 const Teuchos::ArrayView<int>& nodeIDList,
385 const Teuchos::ArrayView<LocalOrdinal>& LIDList)
const;
390 const Teuchos::ArrayView<int>& nodeIDList)
const;
423 Teuchos::RCP<const Teuchos::Comm<int>>
getComm()
const;
439 void describe(Teuchos::FancyOStream& out,
440 const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const;
453 #define XPETRA_STRIDEDMAP_SHORT
454 #endif // XPETRA_STRIDEDMAP_DECL_HPP
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
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)
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a list of the global indices owned by this node.
GlobalOrdinal indexBase_
index base for the strided map (default = 0)
GlobalOrdinal getOffset() const
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
GlobalOrdinal offset_
offset for gids in map (default = 0)
GlobalOrdinal getMinGlobalIndex() const
Returns minimum global index owned by this node.
size_t getNodeNumElements() const
Returns the number of elements belonging to the calling 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.
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.
virtual ~StridedMap()
Destructor.
void setOffset(GlobalOrdinal offset)
RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > map_