Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_TpetraMap_def.hpp
Go to the documentation of this file.
1// @HEADER
2//
3// ***********************************************************************
4//
5// Xpetra: A linear algebra interface package
6// Copyright 2012 Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact
39// Jonathan Hu (jhu@sandia.gov)
40// Andrey Prokopenko (aprokop@sandia.gov)
41// Ray Tuminaro (rstumin@sandia.gov)
42//
43// ***********************************************************************
44//
45// @HEADER
46#ifndef XPETRA_TPETRAMAP_DEF_HPP
47#define XPETRA_TPETRAMAP_DEF_HPP
48
50
51
52
53namespace Xpetra {
54
55
57
58
59
60
61
62 template<class LocalOrdinal, class GlobalOrdinal, class Node>
64 TpetraMap (global_size_t numGlobalElements,
65 GlobalOrdinal indexBase,
66 const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
67 LocalGlobal lg)
68 : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
69 indexBase, comm,
70 toTpetra(lg))))
71 {}
72
73
75
76
77 template<class LocalOrdinal, class GlobalOrdinal, class Node>
79 TpetraMap (global_size_t numGlobalElements,
80 size_t numLocalElements,
81 GlobalOrdinal indexBase,
82 const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
83 : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
84 numLocalElements,
85 indexBase, comm)))
86 {}
87
88
90
91
92 template<class LocalOrdinal, class GlobalOrdinal, class Node>
94 TpetraMap (global_size_t numGlobalElements,
96 GlobalOrdinal indexBase,
97 const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
98 : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
99 elementList,
100 indexBase,
101 comm)))
102 {}
103
104
105#ifdef HAVE_XPETRA_TPETRA
106
108 template<class LocalOrdinal, class GlobalOrdinal, class Node>
110 TpetraMap (global_size_t numGlobalElements,
111 const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
112 GlobalOrdinal indexBase,
113 const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
114 : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
115 indexList,
116 indexBase,
117 comm)))
118 {}
119#endif
120
122template<class LocalOrdinal, class GlobalOrdinal, class Node>
125
127
128template<class LocalOrdinal, class GlobalOrdinal, class Node>
130{ XPETRA_MONITOR("TpetraMap::getGlobalNumElements"); return map_->getGlobalNumElements(); }
131
132template<class LocalOrdinal, class GlobalOrdinal, class Node>
134{ XPETRA_MONITOR("TpetraMap::getLocalNumElements"); return map_->getLocalNumElements(); }
135
136template<class LocalOrdinal, class GlobalOrdinal, class Node>
138{ XPETRA_MONITOR("TpetraMap::getIndexBase"); return map_->getIndexBase(); }
139
140template<class LocalOrdinal, class GlobalOrdinal, class Node>
142{ XPETRA_MONITOR("TpetraMap::getMinLocalIndex"); return map_->getMinLocalIndex(); }
143
144template<class LocalOrdinal, class GlobalOrdinal, class Node>
146{ XPETRA_MONITOR("TpetraMap::getMaxLocalIndex"); return map_->getMaxLocalIndex(); }
147
148template<class LocalOrdinal, class GlobalOrdinal, class Node>
150{ XPETRA_MONITOR("TpetraMap::getMinGlobalIndex"); return map_->getMinGlobalIndex(); }
151
152template<class LocalOrdinal, class GlobalOrdinal, class Node>
154{ XPETRA_MONITOR("TpetraMap::getMaxGlobalIndex"); return map_->getMaxGlobalIndex(); }
155
156template<class LocalOrdinal, class GlobalOrdinal, class Node>
158{ XPETRA_MONITOR("TpetraMap::getMinAllGlobalIndex"); return map_->getMinAllGlobalIndex(); }
159
160template<class LocalOrdinal, class GlobalOrdinal, class Node>
162{ XPETRA_MONITOR("TpetraMap::getMaxAllGlobalIndex"); return map_->getMaxAllGlobalIndex(); }
163
164template<class LocalOrdinal, class GlobalOrdinal, class Node>
165LocalOrdinal TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::getLocalElement(GlobalOrdinal globalIndex) const
166{ XPETRA_MONITOR("TpetraMap::getLocalElement"); return map_->getLocalElement(globalIndex); }
167
168template<class LocalOrdinal, class GlobalOrdinal, class Node>
169GlobalOrdinal TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::getGlobalElement(LocalOrdinal localIndex) const
170{ XPETRA_MONITOR("TpetraMap::getGlobalElement"); return map_->getGlobalElement(localIndex); }
171
172template<class LocalOrdinal, class GlobalOrdinal, class Node>
174{ XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList)); }
175
176template<class LocalOrdinal, class GlobalOrdinal, class Node>
178{ XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
179
180template<class LocalOrdinal, class GlobalOrdinal, class Node>
182{ XPETRA_MONITOR("TpetraMap::getLocalElementList"); return map_->getLocalElementList(); }
183
184template<class LocalOrdinal, class GlobalOrdinal, class Node>
186{ XPETRA_MONITOR("TpetraMap::isNodeLocalElement"); return map_->isNodeLocalElement(localIndex); }
187
188template<class LocalOrdinal, class GlobalOrdinal, class Node>
190{ XPETRA_MONITOR("TpetraMap::isNodeGlobalElement"); return map_->isNodeGlobalElement(globalIndex); }
191
192template<class LocalOrdinal, class GlobalOrdinal, class Node>
194{ XPETRA_MONITOR("TpetraMap::isContiguous"); return map_->isContiguous(); }
195
196template<class LocalOrdinal, class GlobalOrdinal, class Node>
198{ XPETRA_MONITOR("TpetraMap::isDistributed"); return map_->isDistributed(); }
199
200template<class LocalOrdinal, class GlobalOrdinal, class Node>
202{ XPETRA_MONITOR("TpetraMap::isCompatible"); return map_->isCompatible(toTpetra(map)); }
203
204template<class LocalOrdinal, class GlobalOrdinal, class Node>
206{ XPETRA_MONITOR("TpetraMap::isSameAs"); return map_->isSameAs(toTpetra(map)); }
207
208template<class LocalOrdinal, class GlobalOrdinal, class Node>
211
212template<class LocalOrdinal, class GlobalOrdinal, class Node>
214{ XPETRA_MONITOR("TpetraMap::description"); return map_->description(); }
215
216template<class LocalOrdinal, class GlobalOrdinal, class Node>
218{ XPETRA_MONITOR("TpetraMap::describe"); map_->describe(out, verbLevel); }
219
220template<class LocalOrdinal, class GlobalOrdinal, class Node>
225
226template<class LocalOrdinal, class GlobalOrdinal, class Node>
231
232template<class LocalOrdinal, class GlobalOrdinal, class Node>
233TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map)
234: map_(map) { }
235
236template<class LocalOrdinal, class GlobalOrdinal, class Node>
238
239template<class LocalOrdinal, class GlobalOrdinal, class Node>
242
243
244#ifdef HAVE_XPETRA_TPETRA
245
246template<class LocalOrdinal, class GlobalOrdinal, class Node>
251#endif
252
253
254#ifdef HAVE_XPETRA_EPETRA
255
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))))
258
259 // specialization for Tpetra Map on EpetraNode and GO=int
260 template <>
261 class TpetraMap<int, int, EpetraNode>
262 : public virtual Map<int,int,EpetraNode> {
263
264 public:
265 typedef int GlobalOrdinal;
266 typedef int LocalOrdinal;
268
270
271
272
274
275
282
283
285
286
287 TpetraMap (global_size_t numGlobalElements,
288 size_t numLocalElements,
289 GlobalOrdinal indexBase,
290 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
292 }
293
294
296
297
298 TpetraMap (global_size_t numGlobalElements,
300 GlobalOrdinal indexBase,
301 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
303 }
304
305
308
310
312
313
316
318 size_t getLocalNumElements() const { return 0; }
319
321 GlobalOrdinal getIndexBase() const { return 0; }
322
324 LocalOrdinal getMinLocalIndex() const { return 0; }
325
327 LocalOrdinal getMaxLocalIndex() const { return 0; }
328
330 GlobalOrdinal getMinGlobalIndex() const { return 0; }
331
333 GlobalOrdinal getMaxGlobalIndex() const { return 0; }
334
337
340
342 LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
343
345 GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
346
349
352
355
357
359
360
362 bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
363
365 bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
366
368 bool isContiguous() const { return false; }
369
371 bool isDistributed() const { return false; }
372
374 bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
375
377 bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
378
380
382
383
385 Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
386
387
389
391
392
394 std::string description() const { return std::string(""); }
395
398
401
403
405
406
408 TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
410 }
411
413 UnderlyingLib lib() const { return UseTpetra; }
414
417
418#ifdef HAVE_XPETRA_TPETRA
422 return local_map_type();
423 }
424#endif
425
427
428 }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
429#endif
430
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))))
433 // specialization for Tpetra Map on EpetraNode and GO=int
434 template <>
435 class TpetraMap<int, long long, EpetraNode>
436 : public virtual Map<int,long long,EpetraNode> {
437
438 public:
439 typedef long long GlobalOrdinal;
440 typedef int LocalOrdinal;
442
444
445
447 TpetraMap (global_size_t numGlobalElements,
448 GlobalOrdinal indexBase,
449 const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
452 }
453
455 TpetraMap (global_size_t numGlobalElements,
456 size_t numLocalElements,
457 GlobalOrdinal indexBase,
458 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
460 }
461
463 TpetraMap (global_size_t numGlobalElements,
465 GlobalOrdinal indexBase,
466 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
468 }
469
472
474
476
477
480
482 size_t getLocalNumElements() const { return 0; }
483
485 GlobalOrdinal getIndexBase() const { return 0; }
486
488 LocalOrdinal getMinLocalIndex() const { return 0; }
489
491 LocalOrdinal getMaxLocalIndex() const { return 0; }
492
494 GlobalOrdinal getMinGlobalIndex() const { return 0; }
495
497 GlobalOrdinal getMaxGlobalIndex() const { return 0; }
498
501
504
506 LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
507
509 GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
510
513
516
519
521
523
524
526 bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
527
529 bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
530
532 bool isContiguous() const { return false; }
533
535 bool isDistributed() const { return false; }
536
538 bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
539
541 bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
542
544
546
547
549 Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
550
551
553
555
556
558 std::string description() const { return std::string(""); }
559
562
565
567
569
570
572 TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
574 }
575
577 UnderlyingLib lib() const { return UseTpetra; }
578
581
582#ifdef HAVE_XPETRA_TPETRA
586 // We will never be here, this is a stub class
587 return local_map_type();
588 }
589#endif
590
592 }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
593#endif
594
595#endif // HAVE_XPETRA_EPETRA
596
597} // Xpetra namespace
598
599// TODO: remove?
601template <class LocalOrdinal, class GlobalOrdinal, class Node>
603 XPETRA_MONITOR("TpetraMap==TpetraMap");
604 return map1.isSameAs(map2);
605}
606
608template <class LocalOrdinal, class GlobalOrdinal, class Node>
610 XPETRA_MONITOR("TpetraMap!=TpetraMap");
611 return !map1.isSameAs(map2);
612}
613
614#endif // XPETRA_TPETRAMAP_DEF_HPP
615
#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.
Xpetra namespace
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)