Xpetra Version of the Day
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_KOKKOS_REFACTOR
106#ifdef HAVE_XPETRA_TPETRA
107
109 template<class LocalOrdinal, class GlobalOrdinal, class Node>
111 TpetraMap (global_size_t numGlobalElements,
112 const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
113 GlobalOrdinal indexBase,
114 const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
115 : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
116 indexList,
117 indexBase,
118 comm)))
119 {}
120#endif
121#endif
122
124template<class LocalOrdinal, class GlobalOrdinal, class Node>
126{ }
127
129
130template<class LocalOrdinal, class GlobalOrdinal, class Node>
132{ XPETRA_MONITOR("TpetraMap::getGlobalNumElements"); return map_->getGlobalNumElements(); }
133
134template<class LocalOrdinal, class GlobalOrdinal, class Node>
136{ XPETRA_MONITOR("TpetraMap::getNodeNumElements"); return map_->getNodeNumElements(); }
137
138template<class LocalOrdinal, class GlobalOrdinal, class Node>
140{ XPETRA_MONITOR("TpetraMap::getIndexBase"); return map_->getIndexBase(); }
141
142template<class LocalOrdinal, class GlobalOrdinal, class Node>
144{ XPETRA_MONITOR("TpetraMap::getMinLocalIndex"); return map_->getMinLocalIndex(); }
145
146template<class LocalOrdinal, class GlobalOrdinal, class Node>
148{ XPETRA_MONITOR("TpetraMap::getMaxLocalIndex"); return map_->getMaxLocalIndex(); }
149
150template<class LocalOrdinal, class GlobalOrdinal, class Node>
152{ XPETRA_MONITOR("TpetraMap::getMinGlobalIndex"); return map_->getMinGlobalIndex(); }
153
154template<class LocalOrdinal, class GlobalOrdinal, class Node>
156{ XPETRA_MONITOR("TpetraMap::getMaxGlobalIndex"); return map_->getMaxGlobalIndex(); }
157
158template<class LocalOrdinal, class GlobalOrdinal, class Node>
160{ XPETRA_MONITOR("TpetraMap::getMinAllGlobalIndex"); return map_->getMinAllGlobalIndex(); }
161
162template<class LocalOrdinal, class GlobalOrdinal, class Node>
164{ XPETRA_MONITOR("TpetraMap::getMaxAllGlobalIndex"); return map_->getMaxAllGlobalIndex(); }
165
166template<class LocalOrdinal, class GlobalOrdinal, class Node>
167LocalOrdinal TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::getLocalElement(GlobalOrdinal globalIndex) const
168{ XPETRA_MONITOR("TpetraMap::getLocalElement"); return map_->getLocalElement(globalIndex); }
169
170template<class LocalOrdinal, class GlobalOrdinal, class Node>
171GlobalOrdinal TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::getGlobalElement(LocalOrdinal localIndex) const
172{ XPETRA_MONITOR("TpetraMap::getGlobalElement"); return map_->getGlobalElement(localIndex); }
173
174template<class LocalOrdinal, class GlobalOrdinal, class Node>
176{ XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList)); }
177
178template<class LocalOrdinal, class GlobalOrdinal, class Node>
180{ XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
181
182template<class LocalOrdinal, class GlobalOrdinal, class Node>
184{ XPETRA_MONITOR("TpetraMap::getNodeElementList"); return map_->getNodeElementList(); }
185
186template<class LocalOrdinal, class GlobalOrdinal, class Node>
188{ XPETRA_MONITOR("TpetraMap::isNodeLocalElement"); return map_->isNodeLocalElement(localIndex); }
189
190template<class LocalOrdinal, class GlobalOrdinal, class Node>
192{ XPETRA_MONITOR("TpetraMap::isNodeGlobalElement"); return map_->isNodeGlobalElement(globalIndex); }
193
194template<class LocalOrdinal, class GlobalOrdinal, class Node>
196{ XPETRA_MONITOR("TpetraMap::isContiguous"); return map_->isContiguous(); }
197
198template<class LocalOrdinal, class GlobalOrdinal, class Node>
200{ XPETRA_MONITOR("TpetraMap::isDistributed"); return map_->isDistributed(); }
201
202template<class LocalOrdinal, class GlobalOrdinal, class Node>
204{ XPETRA_MONITOR("TpetraMap::isCompatible"); return map_->isCompatible(toTpetra(map)); }
205
206template<class LocalOrdinal, class GlobalOrdinal, class Node>
208{ XPETRA_MONITOR("TpetraMap::isSameAs"); return map_->isSameAs(toTpetra(map)); }
209
210template<class LocalOrdinal, class GlobalOrdinal, class Node>
212{ XPETRA_MONITOR("TpetraMap::getComm"); return map_->getComm(); }
213
214template<class LocalOrdinal, class GlobalOrdinal, class Node>
216{ XPETRA_MONITOR("TpetraMap::description"); return map_->description(); }
217
218template<class LocalOrdinal, class GlobalOrdinal, class Node>
220{ XPETRA_MONITOR("TpetraMap::describe"); map_->describe(out, verbLevel); }
221
222template<class LocalOrdinal, class GlobalOrdinal, class Node>
224{
225 return toXpetra(map_->removeEmptyProcesses());
226}
227
228template<class LocalOrdinal, class GlobalOrdinal, class Node>
230{
231 return toXpetra(map_->replaceCommWithSubset(newComm));
232}
233
234template<class LocalOrdinal, class GlobalOrdinal, class Node>
235TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map)
236: map_(map) { }
237
238template<class LocalOrdinal, class GlobalOrdinal, class Node>
240
241template<class LocalOrdinal, class GlobalOrdinal, class Node>
243{ return map_; }
244
245
246#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
247#ifdef HAVE_XPETRA_TPETRA
248
249template<class LocalOrdinal, class GlobalOrdinal, class Node>
251{
252 return map_->getLocalMap();
253}
254#endif
255#endif
256
257
258#ifdef HAVE_XPETRA_EPETRA
259
260#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
261 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
262
263 // specialization for Tpetra Map on EpetraNode and GO=int
264 template <>
265 class TpetraMap<int, int, EpetraNode>
266 : public virtual Map<int,int,EpetraNode> {
267
268 public:
269 typedef int GlobalOrdinal;
270 typedef int LocalOrdinal;
272
274
275
276
278
279
280 TpetraMap (global_size_t numGlobalElements,
281 GlobalOrdinal indexBase,
282 const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
285 }
286
287
289
290
291 TpetraMap (global_size_t numGlobalElements,
292 size_t numLocalElements,
293 GlobalOrdinal indexBase,
294 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
296 }
297
298
300
301
302 TpetraMap (global_size_t numGlobalElements,
304 GlobalOrdinal indexBase,
305 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
307 }
308
309
312
314
316
317
320
322 size_t getNodeNumElements() const { return 0; }
323
325 GlobalOrdinal getIndexBase() const { return 0; }
326
328 LocalOrdinal getMinLocalIndex() const { return 0; }
329
331 LocalOrdinal getMaxLocalIndex() const { return 0; }
332
334 GlobalOrdinal getMinGlobalIndex() const { return 0; }
335
337 GlobalOrdinal getMaxGlobalIndex() const { return 0; }
338
341
344
346 LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
347
349 GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
350
353
356
359
361
363
364
366 bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
367
369 bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
370
372 bool isContiguous() const { return false; }
373
375 bool isDistributed() const { return false; }
376
378 bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
379
381 bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
382
384
386
387
389 Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
390
391
393
395
396
398 std::string description() const { return std::string(""); }
399
402
405
407
409
410
412 TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
414 }
415
417 UnderlyingLib lib() const { return UseTpetra; }
418
421
422#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
423#ifdef HAVE_XPETRA_TPETRA
424 using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
426 local_map_type getLocalMap () const {
427 return local_map_type();
428 }
429#endif
430#endif
431
433
434 }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
435#endif
436
437#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
438 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
439 // specialization for Tpetra Map on EpetraNode and GO=int
440 template <>
441 class TpetraMap<int, long long, EpetraNode>
442 : public virtual Map<int,long long,EpetraNode> {
443
444 public:
445 typedef long long GlobalOrdinal;
446 typedef int LocalOrdinal;
448
450
451
453 TpetraMap (global_size_t numGlobalElements,
454 GlobalOrdinal indexBase,
455 const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
458 }
459
461 TpetraMap (global_size_t numGlobalElements,
462 size_t numLocalElements,
463 GlobalOrdinal indexBase,
464 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
466 }
467
469 TpetraMap (global_size_t numGlobalElements,
471 GlobalOrdinal indexBase,
472 const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
474 }
475
478
480
482
483
486
488 size_t getNodeNumElements() const { return 0; }
489
491 GlobalOrdinal getIndexBase() const { return 0; }
492
494 LocalOrdinal getMinLocalIndex() const { return 0; }
495
497 LocalOrdinal getMaxLocalIndex() const { return 0; }
498
500 GlobalOrdinal getMinGlobalIndex() const { return 0; }
501
503 GlobalOrdinal getMaxGlobalIndex() const { return 0; }
504
507
510
512 LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
513
515 GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
516
519
522
525
527
529
530
532 bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
533
535 bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
536
538 bool isContiguous() const { return false; }
539
541 bool isDistributed() const { return false; }
542
544 bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
545
547 bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
548
550
552
553
555 Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
556
557
559
561
562
564 std::string description() const { return std::string(""); }
565
568
571
573
575
576
578 TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
580 }
581
583 UnderlyingLib lib() const { return UseTpetra; }
584
587
588#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
589#ifdef HAVE_XPETRA_TPETRA
590 using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
592 local_map_type getLocalMap () const {
593 // We will never be here, this is a stub class
594 return local_map_type();
595 }
596#endif
597#endif
598
600 }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
601#endif
602
603#endif // HAVE_XPETRA_EPETRA
604
605} // Xpetra namespace
606
607// TODO: remove?
609template <class LocalOrdinal, class GlobalOrdinal, class Node>
611 XPETRA_MONITOR("TpetraMap==TpetraMap");
612 return map1.isSameAs(map2);
613}
614
616template <class LocalOrdinal, class GlobalOrdinal, class Node>
618 XPETRA_MONITOR("TpetraMap!=TpetraMap");
619 return !map1.isSameAs(map2);
620}
621
622#endif // XPETRA_TPETRAMAP_DEF_HPP
623
#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
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
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.
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.
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
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.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
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 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 getNodeNumElements() 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.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
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.
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.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() 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?)
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.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
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.
size_t getNodeNumElements() 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.
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.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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)