Xpetra_TpetraMap.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_HPP
47 #define XPETRA_TPETRAMAP_HPP
48 
49 /* this file is automatically generated - do not edit (see script/tpetra.py) */
50 
52 
53 #include <Tpetra_Map.hpp>
54 
55 #include "Xpetra_Map.hpp"
56 #include "Xpetra_Utils.hpp"
57 
58 #include "Xpetra_Exceptions.hpp"
59 
60 namespace Xpetra {
61 
62  // TODO: move that elsewhere
63  template <class LocalOrdinal, class GlobalOrdinal, class Node>
64  const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node>& toTpetra(const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node>&);
65 
66  template <class LocalOrdinal, class GlobalOrdinal, class Node>
67  const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node > > toTpetra(const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >&);
68 
69  template <class LocalOrdinal, class GlobalOrdinal, class Node>
70  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node > > toXpetra(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >&);
71 
72  template <class LocalOrdinal, class GlobalOrdinal, class Node>
73  const RCP<Map<LocalOrdinal,GlobalOrdinal,Node > > toXpetraNonConst(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >&);
74  //
75 
76  template <class LocalOrdinal = Map<>::local_ordinal_type,
77  class GlobalOrdinal = typename Map<LocalOrdinal>::global_ordinal_type,
78  class Node = typename Map<LocalOrdinal, GlobalOrdinal>::node_type>
79  class TpetraMap
80  : public virtual Map<LocalOrdinal,GlobalOrdinal,Node> {
81 
82  public:
83 
85 
86 
88  TpetraMap (global_size_t numGlobalElements,
89  GlobalOrdinal indexBase,
90  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
92  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node))
93  : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
94  indexBase, comm,
95  toTpetra(lg), node)))
96  {}
97 
99  TpetraMap (global_size_t numGlobalElements,
100  size_t numLocalElements,
101  GlobalOrdinal indexBase,
102  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
103  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node))
104  : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
105  numLocalElements,
106  indexBase, comm,
107  node)))
108  {}
109 
111  TpetraMap (global_size_t numGlobalElements,
113  GlobalOrdinal indexBase,
114  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
115  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node))
116  : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
117  elementList, indexBase,
118  comm, node)))
119  {}
120 
123 
125 
127 
128 
130  global_size_t getGlobalNumElements() const { XPETRA_MONITOR("TpetraMap::getGlobalNumElements"); return map_->getGlobalNumElements(); }
131 
133  size_t getNodeNumElements() const { XPETRA_MONITOR("TpetraMap::getNodeNumElements"); return map_->getNodeNumElements(); }
134 
136  GlobalOrdinal getIndexBase() const { XPETRA_MONITOR("TpetraMap::getIndexBase"); return map_->getIndexBase(); }
137 
139  LocalOrdinal getMinLocalIndex() const { XPETRA_MONITOR("TpetraMap::getMinLocalIndex"); return map_->getMinLocalIndex(); }
140 
142  LocalOrdinal getMaxLocalIndex() const { XPETRA_MONITOR("TpetraMap::getMaxLocalIndex"); return map_->getMaxLocalIndex(); }
143 
145  GlobalOrdinal getMinGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMinGlobalIndex"); return map_->getMinGlobalIndex(); }
146 
148  GlobalOrdinal getMaxGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMaxGlobalIndex"); return map_->getMaxGlobalIndex(); }
149 
151  GlobalOrdinal getMinAllGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMinAllGlobalIndex"); return map_->getMinAllGlobalIndex(); }
152 
154  GlobalOrdinal getMaxAllGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMaxAllGlobalIndex"); return map_->getMaxAllGlobalIndex(); }
155 
157  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { XPETRA_MONITOR("TpetraMap::getLocalElement"); return map_->getLocalElement(globalIndex); }
158 
160  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { XPETRA_MONITOR("TpetraMap::getGlobalElement"); return map_->getGlobalElement(localIndex); }
161 
163  LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< LocalOrdinal > &LIDList) const { XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList, LIDList)); }
164 
166  LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const { XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
167 
169  Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const { XPETRA_MONITOR("TpetraMap::getNodeElementList"); return map_->getNodeElementList(); }
170 
172 
174 
175 
177  bool isNodeLocalElement(LocalOrdinal localIndex) const { XPETRA_MONITOR("TpetraMap::isNodeLocalElement"); return map_->isNodeLocalElement(localIndex); }
178 
180  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { XPETRA_MONITOR("TpetraMap::isNodeGlobalElement"); return map_->isNodeGlobalElement(globalIndex); }
181 
183  bool isContiguous() const { XPETRA_MONITOR("TpetraMap::isContiguous"); return map_->isContiguous(); }
184 
186  bool isDistributed() const { XPETRA_MONITOR("TpetraMap::isDistributed"); return map_->isDistributed(); }
187 
189  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { XPETRA_MONITOR("TpetraMap::isCompatible"); return map_->isCompatible(toTpetra(map)); }
190 
192  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { XPETRA_MONITOR("TpetraMap::isSameAs"); return map_->isSameAs(toTpetra(map)); }
193 
195 
197 
198 
200  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { XPETRA_MONITOR("TpetraMap::getComm"); return map_->getComm(); }
201 
203  Teuchos::RCP< Node > getNode() const { XPETRA_MONITOR("TpetraMap::getNode"); return map_->getNode(); }
204 
206 
208 
209 
211  std::string description() const { XPETRA_MONITOR("TpetraMap::description"); return map_->description(); }
212 
214  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { XPETRA_MONITOR("TpetraMap::describe"); map_->describe(out, verbLevel); }
215 
217  return toXpetra(map_->removeEmptyProcesses());
218  }
220  return toXpetra(map_->replaceCommWithSubset(newComm));
221  }
222 
223  template<class Node2>
225  return toXpetraNonConst(map_->clone(node2));
226  }
227 
229 
231 
232 
234  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map)
235  : map_(map) { }
236 
238  UnderlyingLib lib() const { return UseTpetra; }
239 
242 
243 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
244 #ifdef HAVE_XPETRA_TPETRA
245  using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
247  local_map_type getLocalMap () const {
248  return map_->getLocalMap();
249  }
250 #endif
251 #endif
252 
254 
255  protected:
256 
258 
259  }; // TpetraMap class
260 
261  // TODO: move that elsewhere
262  template <class LocalOrdinal, class GlobalOrdinal, class Node>
263  const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> & toTpetra(const Map<LocalOrdinal,GlobalOrdinal,Node> &map) {
264  // TODO: throw exception
265  const TpetraMap<LocalOrdinal,GlobalOrdinal,Node> & tpetraMap = dynamic_cast<const TpetraMap<LocalOrdinal,GlobalOrdinal,Node> &>(*map.getMap());
266  return *tpetraMap.getTpetra_Map();
267  }
268 
269  template <class LocalOrdinal, class GlobalOrdinal, class Node>
271  typedef TpetraMap<LocalOrdinal, GlobalOrdinal, Node> TpetraMapClass;
272  if (map != Teuchos::null) {
273  XPETRA_RCP_DYNAMIC_CAST(const TpetraMapClass, map->getMap(), tpetraMap, "toTpetra");
274  return tpetraMap->getTpetra_Map();
275  }
276  return Teuchos::null;
277  }
278 
279  // In some cases (for instance, in MueLu adapter to Tpetra operator), we need to return a reference. This is only possible if
280  // we assume that the map argument is nonzero
281  template <class LocalOrdinal, class GlobalOrdinal, class Node>
283  TEUCHOS_TEST_FOR_EXCEPTION(map.is_null(), std::invalid_argument, "map must be nonzero");
284  typedef TpetraMap<LocalOrdinal, GlobalOrdinal, Node> TpetraMapClass;
285  XPETRA_RCP_DYNAMIC_CAST(const TpetraMapClass, map->getMap(), tpetraMap, "toTpetra");
286  return tpetraMap->getTpetra_Map();
287  }
288 
289  template <class LocalOrdinal, class GlobalOrdinal, class Node>
290  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > toXpetra(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map) {
291  if (!map.is_null())
293 
294  return Teuchos::null;
295  }
296 
297  template <class LocalOrdinal, class GlobalOrdinal, class Node>
298  const RCP<Map<LocalOrdinal,GlobalOrdinal,Node> > toXpetraNonConst(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map) {
299  if (!map.is_null())
301 
302  return Teuchos::null;
303  }
304 
305  // TODO: removed (but currently used in unit test)
306  namespace useTpetra {
307 
309  template <class LocalOrdinal, class GlobalOrdinal, class Node>
311  createLocalMapWithNode(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > & /* node */ = Teuchos::null) {
312  XPETRA_MONITOR("useTpetra::createLocalMapWithNode");
313 
314  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
315  }
316 
318  template <class LocalOrdinal, class GlobalOrdinal>
320  createContigMap(global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
321  XPETRA_MONITOR("useTpetra::createContigMap");
322 
323  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal>(Tpetra::createContigMap<LocalOrdinal,GlobalOrdinal>(numElements, localNumElements, comm)));
324  }
325 
327  template <class LocalOrdinal, class GlobalOrdinal, class Node>
329  createContigMapWithNode(global_size_t numElements, size_t localNumElements,
330  const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > & /* node */ = Teuchos::null) {
331  XPETRA_MONITOR("useTpetra::createContigMap");
332  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
333  }
334  } // useTpetra namespace
335 
336  // TODO: move that elsewhere
337  template <class LocalOrdinal, class GlobalOrdinal, class Node>
338  const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node>& toTpetra(const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node>&);
339 
340  template <class LocalOrdinal, class GlobalOrdinal, class Node>
342 
343  template <class LocalOrdinal, class GlobalOrdinal, class Node>
344  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node > > toXpetra(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >&);
345 
346  template <class LocalOrdinal, class GlobalOrdinal, class Node>
347  const RCP<Map<LocalOrdinal,GlobalOrdinal,Node > > toXpetraNonConst(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >&);
348 
349 #ifdef HAVE_XPETRA_EPETRA
350 
351 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
352  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
353 
354  // specialization for Tpetra Map on EpetraNode and GO=int
355  template <>
356  class TpetraMap<int, int, EpetraNode>
357  : public virtual Map<int,int,EpetraNode> {
358 
359  public:
360  typedef int GlobalOrdinal;
361  typedef int LocalOrdinal;
362  typedef EpetraNode Node;
363 
365 
366 
368  TpetraMap (global_size_t numGlobalElements,
369  GlobalOrdinal indexBase,
370  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
372  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node)) {
374  }
375 
377  TpetraMap (global_size_t numGlobalElements,
378  size_t numLocalElements,
379  GlobalOrdinal indexBase,
380  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
381  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node)) {
383  }
384 
386  TpetraMap (global_size_t numGlobalElements,
388  GlobalOrdinal indexBase,
389  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
390  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node)) {
392  }
393 
396 
398 
400 
401 
403  global_size_t getGlobalNumElements() const { return 0; }
404 
406  size_t getNodeNumElements() const { return 0; }
407 
409  GlobalOrdinal getIndexBase() const { return 0; }
410 
412  LocalOrdinal getMinLocalIndex() const { return 0; }
413 
415  LocalOrdinal getMaxLocalIndex() const { return 0; }
416 
418  GlobalOrdinal getMinGlobalIndex() const { return 0; }
419 
421  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
422 
424  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
425 
427  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
428 
430  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
431 
433  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
434 
437 
440 
443 
445 
447 
448 
450  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
451 
453  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
454 
456  bool isContiguous() const { return false; }
457 
459  bool isDistributed() const { return false; }
460 
462  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
463 
465  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
466 
468 
470 
471 
473  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
474 
476  Teuchos::RCP< Node > getNode() const { return Teuchos::null; }
477 
479 
481 
482 
484  std::string description() const { return std::string(""); }
485 
488 
491 
492  template<class Node2>
493  RCP<Map<LocalOrdinal, GlobalOrdinal, Node2> > clone(const RCP<Node2> &node2) const { return Teuchos::null; }
494 
496 
498 
499 
501  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
503  }
504 
506  UnderlyingLib lib() const { return UseTpetra; }
507 
510 
511 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
512 #ifdef HAVE_XPETRA_TPETRA
513  using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
515  local_map_type getLocalMap () const {
516  return local_map_type();
517  }
518 #endif
519 #endif
520 
522 
523  }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
524 #endif
525 
526 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
527  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
528  // specialization for Tpetra Map on EpetraNode and GO=int
529  template <>
530  class TpetraMap<int, long long, EpetraNode>
531  : public virtual Map<int,long long,EpetraNode> {
532 
533  public:
534  typedef long long GlobalOrdinal;
535  typedef int LocalOrdinal;
536  typedef EpetraNode Node;
537 
539 
540 
542  TpetraMap (global_size_t numGlobalElements,
543  GlobalOrdinal indexBase,
544  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
546  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node)) {
548  }
549 
551  TpetraMap (global_size_t numGlobalElements,
552  size_t numLocalElements,
553  GlobalOrdinal indexBase,
554  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
555  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node)) {
557  }
558 
560  TpetraMap (global_size_t numGlobalElements,
562  GlobalOrdinal indexBase,
563  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
564  const Teuchos::RCP< Node > &node = Teuchos::rcp(new Node)) {
566  }
567 
570 
572 
574 
575 
577  global_size_t getGlobalNumElements() const { return 0; }
578 
580  size_t getNodeNumElements() const { return 0; }
581 
583  GlobalOrdinal getIndexBase() const { return 0; }
584 
586  LocalOrdinal getMinLocalIndex() const { return 0; }
587 
589  LocalOrdinal getMaxLocalIndex() const { return 0; }
590 
592  GlobalOrdinal getMinGlobalIndex() const { return 0; }
593 
595  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
596 
598  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
599 
601  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
602 
604  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
605 
607  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
608 
611 
614 
617 
619 
621 
622 
624  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
625 
627  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
628 
630  bool isContiguous() const { return false; }
631 
633  bool isDistributed() const { return false; }
634 
636  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
637 
639  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
640 
642 
644 
645 
647  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
648 
650  Teuchos::RCP< Node > getNode() const { return Teuchos::null; }
651 
653 
655 
656 
658  std::string description() const { return std::string(""); }
659 
662 
665 
666  template<class Node2>
667  RCP<Map<LocalOrdinal, GlobalOrdinal, Node2> > clone(const RCP<Node2> &node2) const { return Teuchos::null; }
668 
670 
672 
673 
675  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) {
677  }
678 
680  UnderlyingLib lib() const { return UseTpetra; }
681 
684 
685 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
686 #ifdef HAVE_XPETRA_TPETRA
687  using local_map_type = typename Map<LocalOrdinal, GlobalOrdinal, Node>::local_map_type;
689  local_map_type getLocalMap () const {
690  // We will never be here, this is a stub class
691  return local_map_type();
692  }
693 #endif
694 #endif
695 
697  }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
698 #endif
699 
700 #endif // HAVE_XPETRA_EPETRA
701 
702 } // Xpetra namespace
703 
704 // TODO: remove?
706 template <class LocalOrdinal, class GlobalOrdinal, class Node>
708  XPETRA_MONITOR("TpetraMap==TpetraMap");
709  return map1.isSameAs(map2);
710 }
711 
713 template <class LocalOrdinal, class GlobalOrdinal, class Node>
715  XPETRA_MONITOR("TpetraMap!=TpetraMap");
716  return !map1.isSameAs(map2);
717 }
718 
719 #define XPETRA_TPETRAMAP_SHORT
720 #endif // XPETRA_TPETRAMAP_HPP
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
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().
global_size_t getGlobalNumElements() const
The number of elements in this Map.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Non-member function to create a locally replicated Map with a specified node.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal > > createContigMap(global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member function to create a (potentially) non-uniform, contiguous Map with the default node...
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
GlobalOrdinal global_ordinal_type
Definition: Xpetra_Map.hpp:95
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print this object with the given verbosity level to the given FancyOStream.
GlobalOrdinal getIndexBase() const
The index base for this Map.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
std::string description() const
Return a simple one-line description of this object.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > toTpetraNonZero(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
global_size_t getGlobalNumElements() const
The number of elements in 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.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with a user-defined contiguous 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.
Teuchos::RCP< Node > getNode() const
Get this Map&#39;s Node 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.
Node node_type
Definition: Xpetra_Map.hpp:96
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
Teuchos::RCP< Node > getNode() const
Get this Map&#39;s Node object.
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
Xpetra namespace
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Non-member function to create a (potentially) non-uniform, contiguous Map with a user-specified node...
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 Teuchos::ArrayView< LocalOrdinal > &LIDList) const
Return the process IDs and corresponding local IDs for the given global IDs.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global index.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
~TpetraMap()
Destructor.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
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.
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.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
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.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with Tpetra-defined contiguous uniform distribution.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with a user-defined contiguous distribution.
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.
Teuchos::RCP< Node > getNode() const
Get this Map&#39;s Node object.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
size_t getNodeNumElements() const
The number of elements belonging to the calling node.
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
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, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with a user-defined contiguous distribution.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
TpetraMap(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
GlobalOrdinal getIndexBase() const
The index base for this Map.
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.
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
GlobalOrdinal getIndexBase() const
The index base for this Map.
const RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > toXpetraNonConst(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &)
size_t global_size_t
Global size_t object.
static const EVerbosityLevel verbLevel_default
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 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().
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
bool isNodeGlobalElement(GlobalOrdinal globalIndex) const
True if the global index is found in this Map on this node, else false.
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.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
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.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const
Return the process IDs for the given global IDs.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Get this Map&#39;s Comm object.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > map_
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with Tpetra-defined contiguous uniform distribution.
#define XPETRA_MONITOR(funcName)
virtual RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Definition: Xpetra_Map.hpp:220
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const
The local index corresponding to the given global 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.
std::string description() const
Return a simple one-line description of this object.
TpetraMap(global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
LocalOrdinal getMinLocalIndex() const
The minimum local index.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is compatible with this Map.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
bool isNodeLocalElement(LocalOrdinal localIndex) const
True if the local index is valid for this Map on this node, else false.