All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 
52 
53 namespace Xpetra {
54 
55 
57 
58 
59 
60 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
61  template<class LocalOrdinal, class GlobalOrdinal, class Node>
62  TPETRA_DEPRECATED
64  TpetraMap (global_size_t numGlobalElements,
65  GlobalOrdinal indexBase,
66  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
67  LocalGlobal lg,
68  const Teuchos::RCP< Node > & /* node */)
69  : TpetraMap(numGlobalElements, indexBase, comm, lg)
70  {}
71 #endif // TPETRA_ENABLE_DEPRECATED_CODE
72 
73 
74  template<class LocalOrdinal, class GlobalOrdinal, class Node>
75  TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::
76  TpetraMap (global_size_t numGlobalElements,
77  GlobalOrdinal indexBase,
78  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
79  LocalGlobal lg)
80  : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
81  indexBase, comm,
82  toTpetra(lg))))
83  {}
84 
85 
87 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
88  template<class LocalOrdinal, class GlobalOrdinal, class Node>
89  TPETRA_DEPRECATED
91  TpetraMap (global_size_t numGlobalElements,
92  size_t numLocalElements,
93  GlobalOrdinal indexBase,
94  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
95  const Teuchos::RCP< Node > & /* node */)
96  : TpetraMap(numGlobalElements, numLocalElements, indexBase, comm)
97  {}
98 #endif // TPETRA_ENABLE_DEPRECATED_CODE
99 
100 
101  template<class LocalOrdinal, class GlobalOrdinal, class Node>
103  TpetraMap (global_size_t numGlobalElements,
104  size_t numLocalElements,
105  GlobalOrdinal indexBase,
106  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
107  : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
108  numLocalElements,
109  indexBase, comm)))
110  {}
111 
112 
114 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
115  template<class LocalOrdinal, class GlobalOrdinal, class Node>
116  TPETRA_DEPRECATED
118  TpetraMap (global_size_t numGlobalElements,
120  GlobalOrdinal indexBase,
121  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
122  const Teuchos::RCP< Node > & /* node */)
123  : TpetraMap(numGlobalElements, elementList, indexBase, comm)
124  {}
125 #endif // TPETRA_ENABLE_DEPRECATED_CODE
126 
127 
128  template<class LocalOrdinal, class GlobalOrdinal, class Node>
130  TpetraMap (global_size_t numGlobalElements,
132  GlobalOrdinal indexBase,
133  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
134  : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
135  elementList,
136  indexBase,
137  comm)))
138  {}
139 
140 
141 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
142 #ifdef HAVE_XPETRA_TPETRA
143 
145  template<class LocalOrdinal, class GlobalOrdinal, class Node>
147  TpetraMap (global_size_t numGlobalElements,
148  const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
149  GlobalOrdinal indexBase,
150  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
151  : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
152  indexList,
153  indexBase,
154  comm)))
155  {}
156 #endif
157 #endif
158 
160 template<class LocalOrdinal, class GlobalOrdinal, class Node>
162 { }
163 
165 
166 template<class LocalOrdinal, class GlobalOrdinal, class Node>
168 { XPETRA_MONITOR("TpetraMap::getGlobalNumElements"); return map_->getGlobalNumElements(); }
169 
170 template<class LocalOrdinal, class GlobalOrdinal, class Node>
172 { XPETRA_MONITOR("TpetraMap::getNodeNumElements"); return map_->getNodeNumElements(); }
173 
174 template<class LocalOrdinal, class GlobalOrdinal, class Node>
176 { XPETRA_MONITOR("TpetraMap::getIndexBase"); return map_->getIndexBase(); }
177 
178 template<class LocalOrdinal, class GlobalOrdinal, class Node>
180 { XPETRA_MONITOR("TpetraMap::getMinLocalIndex"); return map_->getMinLocalIndex(); }
181 
182 template<class LocalOrdinal, class GlobalOrdinal, class Node>
184 { XPETRA_MONITOR("TpetraMap::getMaxLocalIndex"); return map_->getMaxLocalIndex(); }
185 
186 template<class LocalOrdinal, class GlobalOrdinal, class Node>
188 { XPETRA_MONITOR("TpetraMap::getMinGlobalIndex"); return map_->getMinGlobalIndex(); }
189 
190 template<class LocalOrdinal, class GlobalOrdinal, class Node>
192 { XPETRA_MONITOR("TpetraMap::getMaxGlobalIndex"); return map_->getMaxGlobalIndex(); }
193 
194 template<class LocalOrdinal, class GlobalOrdinal, class Node>
196 { XPETRA_MONITOR("TpetraMap::getMinAllGlobalIndex"); return map_->getMinAllGlobalIndex(); }
197 
198 template<class LocalOrdinal, class GlobalOrdinal, class Node>
200 { XPETRA_MONITOR("TpetraMap::getMaxAllGlobalIndex"); return map_->getMaxAllGlobalIndex(); }
201 
202 template<class LocalOrdinal, class GlobalOrdinal, class Node>
203 LocalOrdinal TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::getLocalElement(GlobalOrdinal globalIndex) const
204 { XPETRA_MONITOR("TpetraMap::getLocalElement"); return map_->getLocalElement(globalIndex); }
205 
206 template<class LocalOrdinal, class GlobalOrdinal, class Node>
207 GlobalOrdinal TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::getGlobalElement(LocalOrdinal localIndex) const
208 { XPETRA_MONITOR("TpetraMap::getGlobalElement"); return map_->getGlobalElement(localIndex); }
209 
210 template<class LocalOrdinal, class GlobalOrdinal, class Node>
212 { XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList)); }
213 
214 template<class LocalOrdinal, class GlobalOrdinal, class Node>
216 { XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
217 
218 template<class LocalOrdinal, class GlobalOrdinal, class Node>
220 { XPETRA_MONITOR("TpetraMap::getNodeElementList"); return map_->getNodeElementList(); }
221 
222 template<class LocalOrdinal, class GlobalOrdinal, class Node>
224 { XPETRA_MONITOR("TpetraMap::isNodeLocalElement"); return map_->isNodeLocalElement(localIndex); }
225 
226 template<class LocalOrdinal, class GlobalOrdinal, class Node>
228 { XPETRA_MONITOR("TpetraMap::isNodeGlobalElement"); return map_->isNodeGlobalElement(globalIndex); }
229 
230 template<class LocalOrdinal, class GlobalOrdinal, class Node>
232 { XPETRA_MONITOR("TpetraMap::isContiguous"); return map_->isContiguous(); }
233 
234 template<class LocalOrdinal, class GlobalOrdinal, class Node>
236 { XPETRA_MONITOR("TpetraMap::isDistributed"); return map_->isDistributed(); }
237 
238 template<class LocalOrdinal, class GlobalOrdinal, class Node>
240 { XPETRA_MONITOR("TpetraMap::isCompatible"); return map_->isCompatible(toTpetra(map)); }
241 
242 template<class LocalOrdinal, class GlobalOrdinal, class Node>
244 { XPETRA_MONITOR("TpetraMap::isSameAs"); return map_->isSameAs(toTpetra(map)); }
245 
246 template<class LocalOrdinal, class GlobalOrdinal, class Node>
248 { XPETRA_MONITOR("TpetraMap::getComm"); return map_->getComm(); }
249 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
250 
251 template<class LocalOrdinal, class GlobalOrdinal, class Node>
253 { XPETRA_MONITOR("TpetraMap::getNode"); return map_->getNode(); }
254 #endif // TPETRA_ENABLE_DEPRECATED_CODE
255 
256 template<class LocalOrdinal, class GlobalOrdinal, class Node>
258 { XPETRA_MONITOR("TpetraMap::description"); return map_->description(); }
259 
260 template<class LocalOrdinal, class GlobalOrdinal, class Node>
262 { XPETRA_MONITOR("TpetraMap::describe"); map_->describe(out, verbLevel); }
263 
264 template<class LocalOrdinal, class GlobalOrdinal, class Node>
266 {
267  return toXpetra(map_->removeEmptyProcesses());
268 }
269 
270 template<class LocalOrdinal, class GlobalOrdinal, class Node>
272 {
273  return toXpetra(map_->replaceCommWithSubset(newComm));
274 }
275 
276 template<class LocalOrdinal, class GlobalOrdinal, class Node>
277 TpetraMap<LocalOrdinal,GlobalOrdinal,Node>::TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map)
278 : map_(map) { }
279 
280 template<class LocalOrdinal, class GlobalOrdinal, class Node>
282 
283 template<class LocalOrdinal, class GlobalOrdinal, class Node>
285 { return map_; }
286 
287 
288 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
289 #ifdef HAVE_XPETRA_TPETRA
290 
291 template<class LocalOrdinal, class GlobalOrdinal, class Node>
293 {
294  return map_->getLocalMap();
295 }
296 #endif
297 #endif
298 
299 
300 #ifdef HAVE_XPETRA_EPETRA
301 
302 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
303  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
304 
305  // specialization for Tpetra Map on EpetraNode and GO=int
306  template <>
307  class TpetraMap<int, int, EpetraNode>
308  : public virtual Map<int,int,EpetraNode> {
309 
310  public:
311  typedef int GlobalOrdinal;
312  typedef int LocalOrdinal;
313  typedef EpetraNode Node;
314 
316 
317 
318 
320 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
321  TPETRA_DEPRECATED
322  TpetraMap (global_size_t numGlobalElements,
323  GlobalOrdinal indexBase,
324  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
325  LocalGlobal lg,
326  const Teuchos::RCP< Node > & /*node*/)
327  : TpetraMap(numGlobalElements, indexBase, comm, lg)
328  {}
329 #endif // TPETRA_ENABLE_DEPRECATED_CODE
330 
331 
332  TpetraMap (global_size_t numGlobalElements,
333  GlobalOrdinal indexBase,
334  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
337  }
338 
339 
341 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
342  TPETRA_DEPRECATED
343  TpetraMap (global_size_t numGlobalElements,
344  size_t numLocalElements,
345  GlobalOrdinal indexBase,
346  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
347  const Teuchos::RCP< Node > & /*node */)
348  : TpetraMap(numGlobalElements, numLocalElements, indexBase, comm)
349  {}
350 #endif // TPETRA_ENABLE_DEPRECATED_CODE
351 
352 
353  TpetraMap (global_size_t numGlobalElements,
354  size_t numLocalElements,
355  GlobalOrdinal indexBase,
356  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
358  }
359 
360 
362 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
363  TPETRA_DEPRECATED
364  TpetraMap (global_size_t numGlobalElements,
366  GlobalOrdinal indexBase,
367  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
368  const Teuchos::RCP< Node > & /* node */)
369  : TpetraMap(numGlobalElements, elementList, indexBase, comm)
370  {}
371 #endif // TPETRA_ENABLE_DEPRECATED_CODE
372 
373 
374  TpetraMap (global_size_t numGlobalElements,
376  GlobalOrdinal indexBase,
377  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
379  }
380 
381 
384 
386 
388 
389 
391  global_size_t getGlobalNumElements() const { return 0; }
392 
394  size_t getNodeNumElements() const { return 0; }
395 
397  GlobalOrdinal getIndexBase() const { return 0; }
398 
400  LocalOrdinal getMinLocalIndex() const { return 0; }
401 
403  LocalOrdinal getMaxLocalIndex() const { return 0; }
404 
406  GlobalOrdinal getMinGlobalIndex() const { return 0; }
407 
409  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
410 
412  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
413 
415  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
416 
418  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
419 
421  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
422 
425 
428 
431 
433 
435 
436 
438  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
439 
441  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
442 
444  bool isContiguous() const { return false; }
445 
447  bool isDistributed() const { return false; }
448 
450  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
451 
453  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
454 
456 
458 
459 
461  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
462 
463 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
464  Teuchos::RCP< Node > getNode() const { return Teuchos::null; }
466 #endif // TPETRA_ENABLE_DEPRECATED_CODE
467 
469 
471 
472 
474  std::string description() const { return std::string(""); }
475 
478 
481 
482 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
483  template<class Node2>
485  clone(const RCP<Node2> &node2) const
486  {
487  return Teuchos::null;
488  }
489 #endif
490 
491 
493 
494 
496  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
498  }
499 
501  UnderlyingLib lib() const { return UseTpetra; }
502 
505 
506 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
507 #ifdef HAVE_XPETRA_TPETRA
508  using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
510  local_map_type getLocalMap () const {
511  return local_map_type();
512  }
513 #endif
514 #endif
515 
517 
518  }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
519 #endif
520 
521 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
522  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
523  // specialization for Tpetra Map on EpetraNode and GO=int
524  template <>
525  class TpetraMap<int, long long, EpetraNode>
526  : public virtual Map<int,long long,EpetraNode> {
527 
528  public:
529  typedef long long GlobalOrdinal;
530  typedef int LocalOrdinal;
531  typedef EpetraNode Node;
532 
534 
535 
537 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
538  TPETRA_DEPRECATED
539  TpetraMap (global_size_t numGlobalElements,
540  GlobalOrdinal indexBase,
541  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
542  LocalGlobal lg,
543  const Teuchos::RCP< Node > & /* node */)
544  : TpetraMap(numGlobalElements, indexBase, comm, lg)
545  {}
546 #endif // TPETRA_ENABLE_DEPRECATED_CODE
547  TpetraMap (global_size_t numGlobalElements,
548  GlobalOrdinal indexBase,
549  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
552  }
553 
555 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
556  TPETRA_DEPRECATED
557  TpetraMap (global_size_t numGlobalElements,
558  size_t numLocalElements,
559  GlobalOrdinal indexBase,
560  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
561  const Teuchos::RCP< Node > & /* node */)
562  : TpetraMap(numGlobalElements, numLocalElements, indexBase, comm)
563  {}
564 #endif // TPETRA_ENABLE_DEPRECATED_CODE
565  TpetraMap (global_size_t numGlobalElements,
566  size_t numLocalElements,
567  GlobalOrdinal indexBase,
568  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
570  }
571 
573 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
574  TPETRA_DEPRECATED
575  TpetraMap (global_size_t numGlobalElements,
577  GlobalOrdinal indexBase,
578  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
579  const Teuchos::RCP< Node > & /* node */)
580  : TpetraMap(numGlobalElements, elementList, indexBase, comm)
581  {}
582 #endif // TPETRA_ENABLE_DEPRECATED_CODE
583  TpetraMap (global_size_t numGlobalElements,
585  GlobalOrdinal indexBase,
586  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
588  }
589 
592 
594 
596 
597 
599  global_size_t getGlobalNumElements() const { return 0; }
600 
602  size_t getNodeNumElements() const { return 0; }
603 
605  GlobalOrdinal getIndexBase() const { return 0; }
606 
608  LocalOrdinal getMinLocalIndex() const { return 0; }
609 
611  LocalOrdinal getMaxLocalIndex() const { return 0; }
612 
614  GlobalOrdinal getMinGlobalIndex() const { return 0; }
615 
617  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
618 
620  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
621 
623  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
624 
626  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
627 
629  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
630 
633 
636 
639 
641 
643 
644 
646  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
647 
649  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
650 
652  bool isContiguous() const { return false; }
653 
655  bool isDistributed() const { return false; }
656 
658  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
659 
661  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
662 
664 
666 
667 
669  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
670 
671 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
672  Teuchos::RCP< Node > getNode() const { return Teuchos::null; }
674 #endif // TPETRA_ENABLE_DEPRECATED_CODE
675 
677 
679 
680 
682  std::string description() const { return std::string(""); }
683 
686 
689 
690 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
691  template<class Node2>
693  clone(const RCP<Node2> &node2) const
694  {
695  return Teuchos::null;
696  }
697 #endif
698 
699 
701 
702 
704  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
706  }
707 
709  UnderlyingLib lib() const { return UseTpetra; }
710 
713 
714 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
715 #ifdef HAVE_XPETRA_TPETRA
716  using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
718  local_map_type getLocalMap () const {
719  // We will never be here, this is a stub class
720  return local_map_type();
721  }
722 #endif
723 #endif
724 
726  }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
727 #endif
728 
729 #endif // HAVE_XPETRA_EPETRA
730 
731 } // Xpetra namespace
732 
733 // TODO: remove?
735 template <class LocalOrdinal, class GlobalOrdinal, class Node>
737  XPETRA_MONITOR("TpetraMap==TpetraMap");
738  return map1.isSameAs(map2);
739 }
740 
742 template <class LocalOrdinal, class GlobalOrdinal, class Node>
744  XPETRA_MONITOR("TpetraMap!=TpetraMap");
745  return !map1.isSameAs(map2);
746 }
747 
748 #endif // XPETRA_TPETRAMAP_DEF_HPP
749 
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Map< LocalOrdinal, GlobalOrdinal, Node1 > &map, const RCP< Node2 > &node2)
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?)
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
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.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
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.
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.
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.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this 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.
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.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
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 getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
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.
size_t global_size_t
Global size_t object.
static const EVerbosityLevel verbLevel_default
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.
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.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() 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.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
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)
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
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.
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.
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.