Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 namespace Xpetra {
52 
54 
55 
56 template <class LocalOrdinal, class GlobalOrdinal, class Node>
58  TpetraMap(global_size_t numGlobalElements,
59  GlobalOrdinal indexBase,
60  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
61  LocalGlobal lg)
62  : map_(Teuchos::rcp(new Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
63  indexBase, comm,
64  toTpetra(lg)))) {}
65 
67 
68 template <class LocalOrdinal, class GlobalOrdinal, class Node>
70  TpetraMap(global_size_t numGlobalElements,
71  size_t numLocalElements,
72  GlobalOrdinal indexBase,
73  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
74  : map_(Teuchos::rcp(new Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
75  numLocalElements,
76  indexBase, comm))) {}
77 
79 
80 template <class LocalOrdinal, class GlobalOrdinal, class Node>
82  TpetraMap(global_size_t numGlobalElements,
83  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
84  GlobalOrdinal indexBase,
85  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
86  : map_(Teuchos::rcp(new Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
87  elementList,
88  indexBase,
89  comm))) {}
90 
91 #ifdef HAVE_XPETRA_TPETRA
92 
94 template <class LocalOrdinal, class GlobalOrdinal, class Node>
96  TpetraMap(global_size_t numGlobalElements,
97  const Kokkos::View<const GlobalOrdinal *, typename Node::device_type> &indexList,
98  GlobalOrdinal indexBase,
99  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
100  : map_(Teuchos::rcp(new Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node>(numGlobalElements,
101  indexList,
102  indexBase,
103  comm))) {}
104 #endif
105 
107 template <class LocalOrdinal, class GlobalOrdinal, class Node>
109 
111 
112 template <class LocalOrdinal, class GlobalOrdinal, class Node>
114  XPETRA_MONITOR("TpetraMap::getGlobalNumElements");
115  return map_->getGlobalNumElements();
116 }
117 
118 template <class LocalOrdinal, class GlobalOrdinal, class Node>
120  XPETRA_MONITOR("TpetraMap::getLocalNumElements");
121  return map_->getLocalNumElements();
122 }
123 
124 template <class LocalOrdinal, class GlobalOrdinal, class Node>
126  XPETRA_MONITOR("TpetraMap::getIndexBase");
127  return map_->getIndexBase();
128 }
129 
130 template <class LocalOrdinal, class GlobalOrdinal, class Node>
132  XPETRA_MONITOR("TpetraMap::getMinLocalIndex");
133  return map_->getMinLocalIndex();
134 }
135 
136 template <class LocalOrdinal, class GlobalOrdinal, class Node>
138  XPETRA_MONITOR("TpetraMap::getMaxLocalIndex");
139  return map_->getMaxLocalIndex();
140 }
141 
142 template <class LocalOrdinal, class GlobalOrdinal, class Node>
144  XPETRA_MONITOR("TpetraMap::getMinGlobalIndex");
145  return map_->getMinGlobalIndex();
146 }
147 
148 template <class LocalOrdinal, class GlobalOrdinal, class Node>
150  XPETRA_MONITOR("TpetraMap::getMaxGlobalIndex");
151  return map_->getMaxGlobalIndex();
152 }
153 
154 template <class LocalOrdinal, class GlobalOrdinal, class Node>
156  XPETRA_MONITOR("TpetraMap::getMinAllGlobalIndex");
157  return map_->getMinAllGlobalIndex();
158 }
159 
160 template <class LocalOrdinal, class GlobalOrdinal, class Node>
162  XPETRA_MONITOR("TpetraMap::getMaxAllGlobalIndex");
163  return map_->getMaxAllGlobalIndex();
164 }
165 
166 template <class LocalOrdinal, class GlobalOrdinal, class Node>
167 LocalOrdinal TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getLocalElement(GlobalOrdinal globalIndex) const {
168  XPETRA_MONITOR("TpetraMap::getLocalElement");
169  return map_->getLocalElement(globalIndex);
170 }
171 
172 template <class LocalOrdinal, class GlobalOrdinal, class Node>
173 GlobalOrdinal TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getGlobalElement(LocalOrdinal localIndex) const {
174  XPETRA_MONITOR("TpetraMap::getGlobalElement");
175  return map_->getGlobalElement(localIndex);
176 }
177 
178 template <class LocalOrdinal, class GlobalOrdinal, class Node>
179 LookupStatus TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getRemoteIndexList(const Teuchos::ArrayView<const GlobalOrdinal> &GIDList, const Teuchos::ArrayView<int> &nodeIDList, const Teuchos::ArrayView<LocalOrdinal> &LIDList) const {
180  XPETRA_MONITOR("TpetraMap::getRemoteIndexList");
181  return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList));
182 }
183 
184 template <class LocalOrdinal, class GlobalOrdinal, class Node>
185 LookupStatus TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getRemoteIndexList(const Teuchos::ArrayView<const GlobalOrdinal> &GIDList, const Teuchos::ArrayView<int> &nodeIDList) const {
186  XPETRA_MONITOR("TpetraMap::getRemoteIndexList");
187  return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList));
188 }
189 
190 template <class LocalOrdinal, class GlobalOrdinal, class Node>
191 Teuchos::ArrayView<const GlobalOrdinal> TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getLocalElementList() const {
192  XPETRA_MONITOR("TpetraMap::getLocalElementList");
193  return map_->getLocalElementList();
194 }
195 
196 template <class LocalOrdinal, class GlobalOrdinal, class Node>
198  XPETRA_MONITOR("TpetraMap::getMyGlobalIndicesDevice");
199  return map_->getMyGlobalIndicesDevice();
200 }
201 
202 template <class LocalOrdinal, class GlobalOrdinal, class Node>
204  XPETRA_MONITOR("TpetraMap::isNodeLocalElement");
205  return map_->isNodeLocalElement(localIndex);
206 }
207 
208 template <class LocalOrdinal, class GlobalOrdinal, class Node>
210  XPETRA_MONITOR("TpetraMap::isNodeGlobalElement");
211  return map_->isNodeGlobalElement(globalIndex);
212 }
213 
214 template <class LocalOrdinal, class GlobalOrdinal, class Node>
216  XPETRA_MONITOR("TpetraMap::isContiguous");
217  return map_->isContiguous();
218 }
219 
220 template <class LocalOrdinal, class GlobalOrdinal, class Node>
222  XPETRA_MONITOR("TpetraMap::isDistributed");
223  return map_->isDistributed();
224 }
225 
226 template <class LocalOrdinal, class GlobalOrdinal, class Node>
228  XPETRA_MONITOR("TpetraMap::isCompatible");
229  return map_->isCompatible(toTpetra(map));
230 }
231 
232 template <class LocalOrdinal, class GlobalOrdinal, class Node>
234  XPETRA_MONITOR("TpetraMap::isSameAs");
235  return map_->isSameAs(toTpetra(map));
236 }
237 
238 template <class LocalOrdinal, class GlobalOrdinal, class Node>
239 Teuchos::RCP<const Teuchos::Comm<int> > TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getComm() const {
240  XPETRA_MONITOR("TpetraMap::getComm");
241  return map_->getComm();
242 }
243 
244 template <class LocalOrdinal, class GlobalOrdinal, class Node>
246  XPETRA_MONITOR("TpetraMap::description");
247  return map_->description();
248 }
249 
250 template <class LocalOrdinal, class GlobalOrdinal, class Node>
251 void TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const {
252  XPETRA_MONITOR("TpetraMap::describe");
253  map_->describe(out, verbLevel);
254 }
255 
256 template <class LocalOrdinal, class GlobalOrdinal, class Node>
257 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::removeEmptyProcesses() const {
258  return toXpetra(map_->removeEmptyProcesses());
259 }
260 
261 template <class LocalOrdinal, class GlobalOrdinal, class Node>
262 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::replaceCommWithSubset(const Teuchos::RCP<const Teuchos::Comm<int> > &newComm) const {
263  return toXpetra(map_->replaceCommWithSubset(newComm));
264 }
265 
266 template <class LocalOrdinal, class GlobalOrdinal, class Node>
267 TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map)
268  : map_(map) {}
269 
270 template <class LocalOrdinal, class GlobalOrdinal, class Node>
272 
273 template <class LocalOrdinal, class GlobalOrdinal, class Node>
274 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > TpetraMap<LocalOrdinal, GlobalOrdinal, Node>::getTpetra_Map() const { return map_; }
275 
276 #ifdef HAVE_XPETRA_TPETRA
277 
278 template <class LocalOrdinal, class GlobalOrdinal, class Node>
280  return map_->getLocalMap();
281 }
282 #endif
283 
284 #ifdef HAVE_XPETRA_EPETRA
285 
286 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
287  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
288 
289 // specialization for Tpetra Map on EpetraNode and GO=int
290 template <>
291 class TpetraMap<int, int, EpetraNode>
292  : public virtual Map<int, int, EpetraNode> {
293  public:
294  typedef int GlobalOrdinal;
295  typedef int LocalOrdinal;
296  typedef EpetraNode Node;
297 
299 
300 
302 
303  TpetraMap(global_size_t numGlobalElements,
304  GlobalOrdinal indexBase,
305  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
308  }
309 
311 
312  TpetraMap(global_size_t numGlobalElements,
313  size_t numLocalElements,
314  GlobalOrdinal indexBase,
315  const Teuchos::RCP<const Teuchos::Comm<int> > &comm) {
317  }
318 
320 
321  TpetraMap(global_size_t numGlobalElements,
322  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
323  GlobalOrdinal indexBase,
324  const Teuchos::RCP<const Teuchos::Comm<int> > &comm) {
326  }
327 
330 
332 
334 
335 
337  global_size_t getGlobalNumElements() const { return 0; }
338 
340  size_t getLocalNumElements() const { return 0; }
341 
343  GlobalOrdinal getIndexBase() const { return 0; }
344 
346  LocalOrdinal getMinLocalIndex() const { return 0; }
347 
349  LocalOrdinal getMaxLocalIndex() const { return 0; }
350 
352  GlobalOrdinal getMinGlobalIndex() const { return 0; }
353 
355  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
356 
358  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
359 
361  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
362 
364  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
365 
367  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
368 
370  LookupStatus getRemoteIndexList(const Teuchos::ArrayView<const GlobalOrdinal> &GIDList, const Teuchos::ArrayView<int> &nodeIDList, const Teuchos::ArrayView<LocalOrdinal> &LIDList) const { return Xpetra::IDNotPresent; }
371 
373  LookupStatus getRemoteIndexList(const Teuchos::ArrayView<const GlobalOrdinal> &GIDList, const Teuchos::ArrayView<int> &nodeIDList) const { return Xpetra::IDNotPresent; }
374 
376  Teuchos::ArrayView<const GlobalOrdinal> getLocalElementList() const { return Teuchos::ArrayView<const GlobalOrdinal>(); }
377 
379 
381 
382 
384  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
385 
387  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
388 
390  bool isContiguous() const { return false; }
391 
393  bool isDistributed() const { return false; }
394 
396  bool isCompatible(const Map<LocalOrdinal, GlobalOrdinal, Node> &map) const { return false; }
397 
399  bool isSameAs(const Map<LocalOrdinal, GlobalOrdinal, Node> &map) const { return false; }
400 
402 
404 
405 
407  Teuchos::RCP<const Teuchos::Comm<int> > getComm() const { return Teuchos::null; }
408 
410 
412 
413 
415  std::string description() const { return std::string(""); }
416 
418  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
419 
420  RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > removeEmptyProcesses() const { return Teuchos::null; }
421  RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > replaceCommWithSubset(const Teuchos::RCP<const Teuchos::Comm<int> > &newComm) const { return Teuchos::null; }
422 
424 
426 
427 
429  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {
431  }
432 
434  UnderlyingLib lib() const { return UseTpetra; }
435 
437  RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > getTpetra_Map() const { return Teuchos::null; }
438 
439 #ifdef HAVE_XPETRA_TPETRA
443  return local_map_type();
444  }
445 #endif
446 
448 
449 }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
450 #endif
451 
452 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
453  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
454 // specialization for Tpetra Map on EpetraNode and GO=int
455 template <>
456 class TpetraMap<int, long long, EpetraNode>
457  : public virtual Map<int, long long, EpetraNode> {
458  public:
459  typedef long long GlobalOrdinal;
460  typedef int LocalOrdinal;
461  typedef EpetraNode Node;
462 
464 
465 
467  TpetraMap(global_size_t numGlobalElements,
468  GlobalOrdinal indexBase,
469  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
472  }
473 
475  TpetraMap(global_size_t numGlobalElements,
476  size_t numLocalElements,
477  GlobalOrdinal indexBase,
478  const Teuchos::RCP<const Teuchos::Comm<int> > &comm) {
480  }
481 
483  TpetraMap(global_size_t numGlobalElements,
484  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
485  GlobalOrdinal indexBase,
486  const Teuchos::RCP<const Teuchos::Comm<int> > &comm) {
488  }
489 
492 
494 
496 
497 
499  global_size_t getGlobalNumElements() const { return 0; }
500 
502  size_t getLocalNumElements() const { return 0; }
503 
505  GlobalOrdinal getIndexBase() const { return 0; }
506 
508  LocalOrdinal getMinLocalIndex() const { return 0; }
509 
511  LocalOrdinal getMaxLocalIndex() const { return 0; }
512 
514  GlobalOrdinal getMinGlobalIndex() const { return 0; }
515 
517  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
518 
520  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
521 
523  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
524 
526  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
527 
529  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
530 
532  LookupStatus getRemoteIndexList(const Teuchos::ArrayView<const GlobalOrdinal> &GIDList, const Teuchos::ArrayView<int> &nodeIDList, const Teuchos::ArrayView<LocalOrdinal> &LIDList) const { return Xpetra::IDNotPresent; }
533 
535  LookupStatus getRemoteIndexList(const Teuchos::ArrayView<const GlobalOrdinal> &GIDList, const Teuchos::ArrayView<int> &nodeIDList) const { return Xpetra::IDNotPresent; }
536 
538  Teuchos::ArrayView<const GlobalOrdinal> getLocalElementList() const { return Teuchos::ArrayView<const GlobalOrdinal>(); }
539 
541 
543 
544 
546  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
547 
549  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
550 
552  bool isContiguous() const { return false; }
553 
555  bool isDistributed() const { return false; }
556 
558  bool isCompatible(const Map<LocalOrdinal, GlobalOrdinal, Node> &map) const { return false; }
559 
561  bool isSameAs(const Map<LocalOrdinal, GlobalOrdinal, Node> &map) const { return false; }
562 
564 
566 
567 
569  Teuchos::RCP<const Teuchos::Comm<int> > getComm() const { return Teuchos::null; }
570 
572 
574 
575 
577  std::string description() const { return std::string(""); }
578 
580  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
581 
582  RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > removeEmptyProcesses() const { return Teuchos::null; }
583  RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > replaceCommWithSubset(const Teuchos::RCP<const Teuchos::Comm<int> > &newComm) const { return Teuchos::null; }
584 
586 
588 
589 
591  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {
593  }
594 
596  UnderlyingLib lib() const { return UseTpetra; }
597 
599  RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > getTpetra_Map() const { return Teuchos::null; }
600 
601 #ifdef HAVE_XPETRA_TPETRA
605  // We will never be here, this is a stub class
606  return local_map_type();
607  }
608 #endif
609 
611 }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
612 #endif
613 
614 #endif // HAVE_XPETRA_EPETRA
615 
616 } // namespace Xpetra
617 
618 // TODO: remove?
620 template <class LocalOrdinal, class GlobalOrdinal, class Node>
622  XPETRA_MONITOR("TpetraMap==TpetraMap");
623  return map1.isSameAs(map2);
624 }
625 
627 template <class LocalOrdinal, class GlobalOrdinal, class Node>
629  XPETRA_MONITOR("TpetraMap!=TpetraMap");
630  return !map1.isSameAs(map2);
631 }
632 
633 #endif // XPETRA_TPETRAMAP_DEF_HPP
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
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 getMaxLocalIndex() const
The maximum local index on the calling process.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
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.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
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.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process IDs for the given global IDs.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
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.
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.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
LocalOrdinal getMinLocalIndex() const
The minimum local index.
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.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
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.
global_indices_array_device_type getMyGlobalIndicesDevice() const
Return a view of the global indices owned by this process.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
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 Map< LocalOrdinal, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map&#39;s communicator with a subset communicator.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
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.
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.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
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 isContiguous() const
True if this Map is distributed contiguously, else false.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
size_t global_size_t
Global size_t object.
Teuchos::ArrayView< const GlobalOrdinal > getLocalElementList() const
Return a view of the global indices owned by this node.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
GlobalOrdinal getIndexBase() const
The index base for this Map.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
Kokkos::View< const global_ordinal_type *, typename Node::device_type > global_indices_array_device_type
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in 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&#39;s communicator with a subset communicator.
std::string description() const
Return a simple one-line description of this object.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
typename Map< LocalOrdinal, GlobalOrdinal, Node >::local_map_type local_map_type
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.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
#define XPETRA_MONITOR(funcName)
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
size_t getLocalNumElements() const
The number of elements belonging to the calling node.
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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
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().
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the 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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map&#39;s communicator with a subset communicator.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
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.
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.
std::string description() const
Return a simple one-line description of this object.
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.
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.
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.