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  // Workaround function for a deferred visual studio bug
86  // http://connect.microsoft.com/VisualStudio/feedback/details/719847/erroneous-error-c2783-could-not-deduce-template-argument
87  // Use this function for default arguments rather than calling
88  // what is the return value below. Also helps in reducing
89  // duplication in various constructors.
90  return KokkosClassic::Details::getNode<Node>();
91  }
92 
94 
95 
97  TpetraMap (global_size_t numGlobalElements,
98  GlobalOrdinal indexBase,
99  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
101  const Teuchos::RCP< Node > &node = defaultArgNode())
102  : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
103  indexBase, comm,
104  toTpetra(lg), node)))
105  {}
106 
108  TpetraMap (global_size_t numGlobalElements,
109  size_t numLocalElements,
110  GlobalOrdinal indexBase,
111  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
112  const Teuchos::RCP< Node > &node = defaultArgNode())
113  : map_ (Teuchos::rcp (new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > (numGlobalElements,
114  numLocalElements,
115  indexBase, comm,
116  node)))
117  {}
118 
120  TpetraMap (global_size_t numGlobalElements,
122  GlobalOrdinal indexBase,
123  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
124  const Teuchos::RCP< Node > &node = defaultArgNode())
125  : map_(Teuchos::rcp(new Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node >(numGlobalElements,
126  elementList, indexBase,
127  comm, node)))
128  {}
129 
132 
134 
136 
137 
139  global_size_t getGlobalNumElements() const { XPETRA_MONITOR("TpetraMap::getGlobalNumElements"); return map_->getGlobalNumElements(); }
140 
142  size_t getNodeNumElements() const { XPETRA_MONITOR("TpetraMap::getNodeNumElements"); return map_->getNodeNumElements(); }
143 
145  GlobalOrdinal getIndexBase() const { XPETRA_MONITOR("TpetraMap::getIndexBase"); return map_->getIndexBase(); }
146 
148  LocalOrdinal getMinLocalIndex() const { XPETRA_MONITOR("TpetraMap::getMinLocalIndex"); return map_->getMinLocalIndex(); }
149 
151  LocalOrdinal getMaxLocalIndex() const { XPETRA_MONITOR("TpetraMap::getMaxLocalIndex"); return map_->getMaxLocalIndex(); }
152 
154  GlobalOrdinal getMinGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMinGlobalIndex"); return map_->getMinGlobalIndex(); }
155 
157  GlobalOrdinal getMaxGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMaxGlobalIndex"); return map_->getMaxGlobalIndex(); }
158 
160  GlobalOrdinal getMinAllGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMinAllGlobalIndex"); return map_->getMinAllGlobalIndex(); }
161 
163  GlobalOrdinal getMaxAllGlobalIndex() const { XPETRA_MONITOR("TpetraMap::getMaxAllGlobalIndex"); return map_->getMaxAllGlobalIndex(); }
164 
166  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { XPETRA_MONITOR("TpetraMap::getLocalElement"); return map_->getLocalElement(globalIndex); }
167 
169  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { XPETRA_MONITOR("TpetraMap::getGlobalElement"); return map_->getGlobalElement(localIndex); }
170 
172  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)); }
173 
175  LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const GlobalOrdinal > &GIDList, const Teuchos::ArrayView< int > &nodeIDList) const { XPETRA_MONITOR("TpetraMap::getRemoteIndexList"); return toXpetra(map_->getRemoteIndexList(GIDList, nodeIDList)); }
176 
178  Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const { XPETRA_MONITOR("TpetraMap::getNodeElementList"); return map_->getNodeElementList(); }
179 
181 
183 
184 
186  bool isNodeLocalElement(LocalOrdinal localIndex) const { XPETRA_MONITOR("TpetraMap::isNodeLocalElement"); return map_->isNodeLocalElement(localIndex); }
187 
189  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { XPETRA_MONITOR("TpetraMap::isNodeGlobalElement"); return map_->isNodeGlobalElement(globalIndex); }
190 
192  bool isContiguous() const { XPETRA_MONITOR("TpetraMap::isContiguous"); return map_->isContiguous(); }
193 
195  bool isDistributed() const { XPETRA_MONITOR("TpetraMap::isDistributed"); return map_->isDistributed(); }
196 
198  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { XPETRA_MONITOR("TpetraMap::isCompatible"); return map_->isCompatible(toTpetra(map)); }
199 
201  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { XPETRA_MONITOR("TpetraMap::isSameAs"); return map_->isSameAs(toTpetra(map)); }
202 
204 
206 
207 
209  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { XPETRA_MONITOR("TpetraMap::getComm"); return map_->getComm(); }
210 
212  Teuchos::RCP< Node > getNode() const { XPETRA_MONITOR("TpetraMap::getNode"); return map_->getNode(); }
213 
215 
217 
218 
220  std::string description() const { XPETRA_MONITOR("TpetraMap::description"); return map_->description(); }
221 
223  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { XPETRA_MONITOR("TpetraMap::describe"); map_->describe(out, verbLevel); }
224 
226  return toXpetra(map_->removeEmptyProcesses());
227  }
229  return toXpetra(map_->replaceCommWithSubset(newComm));
230  }
231 
232  template<class Node2>
234  return toXpetraNonConst(map_->clone(node2));
235  }
236 
238 
240 
241 
243  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map)
244  : map_(map) { }
245 
247  UnderlyingLib lib() const { return UseTpetra; }
248 
251 
253 
254  protected:
255 
257 
258  }; // TpetraMap class
259 
260  // TODO: move that elsewhere
261  template <class LocalOrdinal, class GlobalOrdinal, class Node>
262  const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> & toTpetra(const Map<LocalOrdinal,GlobalOrdinal,Node> &map) {
263  // TODO: throw exception
264  const TpetraMap<LocalOrdinal,GlobalOrdinal,Node> & tpetraMap = dynamic_cast<const TpetraMap<LocalOrdinal,GlobalOrdinal,Node> &>(*map.getMap());
265  return *tpetraMap.getTpetra_Map();
266  }
267 
268  template <class LocalOrdinal, class GlobalOrdinal, class Node>
270  typedef TpetraMap<LocalOrdinal, GlobalOrdinal, Node> TpetraMapClass;
271  if (map != Teuchos::null) {
272  XPETRA_RCP_DYNAMIC_CAST(const TpetraMapClass, map->getMap(), tpetraMap, "toTpetra");
273  return tpetraMap->getTpetra_Map();
274  }
275  return Teuchos::null;
276  }
277 
278  // In some cases (for instance, in MueLu adapter to Tpetra operator), we need to return a reference. This is only possible if
279  // we assume that the map argument is nonzero
280  template <class LocalOrdinal, class GlobalOrdinal, class Node>
282  TEUCHOS_TEST_FOR_EXCEPTION(map.is_null(), std::invalid_argument, "map must be nonzero");
283  typedef TpetraMap<LocalOrdinal, GlobalOrdinal, Node> TpetraMapClass;
284  XPETRA_RCP_DYNAMIC_CAST(const TpetraMapClass, map->getMap(), tpetraMap, "toTpetra");
285  return tpetraMap->getTpetra_Map();
286  }
287 
288  template <class LocalOrdinal, class GlobalOrdinal, class Node>
289  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > toXpetra(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map) {
290  if (!map.is_null())
292 
293  return Teuchos::null;
294  }
295 
296  template <class LocalOrdinal, class GlobalOrdinal, class Node>
297  const RCP<Map<LocalOrdinal,GlobalOrdinal,Node> > toXpetraNonConst(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& map) {
298  if (!map.is_null())
300 
301  return Teuchos::null;
302  }
303 
304  // TODO: removed (but currently used in unit test)
305  namespace useTpetra {
306 
308  template <class LocalOrdinal, class GlobalOrdinal, class Node>
310  createLocalMapWithNode(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node) {
311  XPETRA_MONITOR("useTpetra::createLocalMapWithNode");
312 
313  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm, node)));
314  }
315 
317  template <class LocalOrdinal, class GlobalOrdinal>
319  createContigMap(global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
320  XPETRA_MONITOR("useTpetra::createContigMap");
321 
322  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal>(Tpetra::createContigMap<LocalOrdinal,GlobalOrdinal>(numElements, localNumElements, comm)));
323  }
324 
326  template <class LocalOrdinal, class GlobalOrdinal, class Node>
328  createContigMapWithNode(global_size_t numElements, size_t localNumElements,
329  const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node) {
330  XPETRA_MONITOR("useTpetra::createContigMap");
331  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, localNumElements, comm, node)));
332  }
333  } // useTpetra namespace
334 
335  // TODO: move that elsewhere
336  template <class LocalOrdinal, class GlobalOrdinal, class Node>
337  const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node>& toTpetra(const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node>&);
338 
339  template <class LocalOrdinal, class GlobalOrdinal, class Node>
341 
342  template <class LocalOrdinal, class GlobalOrdinal, class Node>
343  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node > > toXpetra(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >&);
344 
345  template <class LocalOrdinal, class GlobalOrdinal, class Node>
346  const RCP<Map<LocalOrdinal,GlobalOrdinal,Node > > toXpetraNonConst(const RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >&);
347 
348 #ifdef HAVE_XPETRA_EPETRA
349 
350 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
351  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
352 
353  // specialization for Tpetra Map on EpetraNode and GO=int
354  template <>
355  class TpetraMap<int, int, EpetraNode>
356  : public virtual Map<int,int,EpetraNode> {
357 
358  public:
359  typedef int GlobalOrdinal;
360  typedef int LocalOrdinal;
361  typedef EpetraNode Node;
362 
364  // Workaround function for a deferred visual studio bug
365  // http://connect.microsoft.com/VisualStudio/feedback/details/719847/erroneous-error-c2783-could-not-deduce-template-argument
366  // Use this function for default arguments rather than calling
367  // what is the return value below. Also helps in reducing
368  // duplication in various constructors.
369  return KokkosClassic::Details::getNode<Node>();
370  }
371 
373 
374 
376  TpetraMap (global_size_t numGlobalElements,
377  GlobalOrdinal indexBase,
378  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
380  const Teuchos::RCP< Node > &node = defaultArgNode()) {
381  XPETRA_TPETRA_ETI_EXCEPTION("TpetraMap<int,int,EpetraNode>", "TpetraMap<int,int,EpetraNode>", "int");
382  }
383 
385  TpetraMap (global_size_t numGlobalElements,
386  size_t numLocalElements,
387  GlobalOrdinal indexBase,
388  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
389  const Teuchos::RCP< Node > &node = defaultArgNode()) {
390  XPETRA_TPETRA_ETI_EXCEPTION("TpetraMap<int,int,EpetraNode>", "TpetraMap<int,int,EpetraNode>", "int");
391  }
392 
394  TpetraMap (global_size_t numGlobalElements,
396  GlobalOrdinal indexBase,
397  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
398  const Teuchos::RCP< Node > &node = defaultArgNode()) {
399  XPETRA_TPETRA_ETI_EXCEPTION("TpetraMap<int,int,EpetraNode>", "TpetraMap<int,int,EpetraNode>", "int");
400  }
401 
404 
406 
408 
409 
411  global_size_t getGlobalNumElements() const { return 0; }
412 
414  size_t getNodeNumElements() const { return 0; }
415 
417  GlobalOrdinal getIndexBase() const { return 0; }
418 
420  LocalOrdinal getMinLocalIndex() const { return 0; }
421 
423  LocalOrdinal getMaxLocalIndex() const { return 0; }
424 
426  GlobalOrdinal getMinGlobalIndex() const { return 0; }
427 
429  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
430 
432  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
433 
435  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
436 
438  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
439 
441  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
442 
445 
448 
451 
453 
455 
456 
458  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
459 
461  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
462 
464  bool isContiguous() const { return false; }
465 
467  bool isDistributed() const { return false; }
468 
470  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
471 
473  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
474 
476 
478 
479 
481  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
482 
484  Teuchos::RCP< Node > getNode() const { return Teuchos::null; }
485 
487 
489 
490 
492  std::string description() const { return std::string(""); }
493 
496 
499 
500  template<class Node2>
501  RCP<Map<LocalOrdinal, GlobalOrdinal, Node2> > clone(const RCP<Node2> &node2) const { return Teuchos::null; }
502 
504 
506 
507 
509  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) { }
510 
512  UnderlyingLib lib() const { return UseTpetra; }
513 
516 
518 
519  }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
520 #endif
521 
522 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
523  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
524  // specialization for Tpetra Map on EpetraNode and GO=int
525  template <>
526  class TpetraMap<int, long long, EpetraNode>
527  : public virtual Map<int,long long,EpetraNode> {
528 
529  public:
530  typedef long long GlobalOrdinal;
531  typedef int LocalOrdinal;
532  typedef EpetraNode Node;
533 
535  // Workaround function for a deferred visual studio bug
536  // http://connect.microsoft.com/VisualStudio/feedback/details/719847/erroneous-error-c2783-could-not-deduce-template-argument
537  // Use this function for default arguments rather than calling
538  // what is the return value below. Also helps in reducing
539  // duplication in various constructors.
540  return KokkosClassic::Details::getNode<Node>();
541  }
542 
544 
545 
547  TpetraMap (global_size_t numGlobalElements,
548  GlobalOrdinal indexBase,
549  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
551  const Teuchos::RCP< Node > &node = defaultArgNode()) {
552  XPETRA_TPETRA_ETI_EXCEPTION("TpetraMap<int,long long,EpetraNode>", "TpetraMap<int,long long,EpetraNode>", "long long");
553  }
554 
556  TpetraMap (global_size_t numGlobalElements,
557  size_t numLocalElements,
558  GlobalOrdinal indexBase,
559  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
560  const Teuchos::RCP< Node > &node = defaultArgNode()) {
561  XPETRA_TPETRA_ETI_EXCEPTION("TpetraMap<int,long long,EpetraNode>", "TpetraMap<int,long long,EpetraNode>", "long long");
562  }
563 
565  TpetraMap (global_size_t numGlobalElements,
567  GlobalOrdinal indexBase,
568  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
569  const Teuchos::RCP< Node > &node = defaultArgNode()) {
570  XPETRA_TPETRA_ETI_EXCEPTION("TpetraMap<int,long long,EpetraNode>", "TpetraMap<int,long long,EpetraNode>", "long long");
571  }
572 
575 
577 
579 
580 
582  global_size_t getGlobalNumElements() const { return 0; }
583 
585  size_t getNodeNumElements() const { return 0; }
586 
588  GlobalOrdinal getIndexBase() const { return 0; }
589 
591  LocalOrdinal getMinLocalIndex() const { return 0; }
592 
594  LocalOrdinal getMaxLocalIndex() const { return 0; }
595 
597  GlobalOrdinal getMinGlobalIndex() const { return 0; }
598 
600  GlobalOrdinal getMaxGlobalIndex() const { return 0; }
601 
603  GlobalOrdinal getMinAllGlobalIndex() const { return 0; }
604 
606  GlobalOrdinal getMaxAllGlobalIndex() const { return 0; }
607 
609  LocalOrdinal getLocalElement(GlobalOrdinal globalIndex) const { return 0; }
610 
612  GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const { return 0; }
613 
616 
619 
622 
624 
626 
627 
629  bool isNodeLocalElement(LocalOrdinal localIndex) const { return false; }
630 
632  bool isNodeGlobalElement(GlobalOrdinal globalIndex) const { return false; }
633 
635  bool isContiguous() const { return false; }
636 
638  bool isDistributed() const { return false; }
639 
641  bool isCompatible(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
642 
644  bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const { return false; }
645 
647 
649 
650 
652  Teuchos::RCP< const Teuchos::Comm< int > > getComm() const { return Teuchos::null; }
653 
655  Teuchos::RCP< Node > getNode() const { return Teuchos::null; }
656 
658 
660 
661 
663  std::string description() const { return std::string(""); }
664 
667 
670 
671  template<class Node2>
672  RCP<Map<LocalOrdinal, GlobalOrdinal, Node2> > clone(const RCP<Node2> &node2) const { return Teuchos::null; }
673 
675 
677 
678 
680  TpetraMap(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node > > &map) { }
681 
683  UnderlyingLib lib() const { return UseTpetra; }
684 
687 
689  }; // TpetraMap class (specialization for GO=int and NO=EpetraNode)
690 #endif
691 
692 #endif // HAVE_XPETRA_EPETRA
693 
694 } // Xpetra namespace
695 
696 // TODO: remove?
698 template <class LocalOrdinal, class GlobalOrdinal, class Node>
700  XPETRA_MONITOR("TpetraMap==TpetraMap");
701  return map1.isSameAs(map2);
702 }
703 
705 template <class LocalOrdinal, class GlobalOrdinal, class Node>
707  XPETRA_MONITOR("TpetraMap!=TpetraMap");
708  return !map1.isSameAs(map2);
709 }
710 
711 #define XPETRA_TPETRAMAP_SHORT
712 #endif // XPETRA_TPETRAMAP_HPP
Teuchos::RCP< const TpetraMap< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node)
Non-member function to create a locally replicated Map with a specified node.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
Teuchos::RCP< Node > getNode() const
Get this Map&#39;s Node object.
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 not identical to this map. Implemented in TpetraMap::isSameAs().
Teuchos::ArrayView< const GlobalOrdinal > getNodeElementList() const
Return a view of the global indices owned by this node.
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.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
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...
GlobalOrdinal getGlobalElement(LocalOrdinal localIndex) const
The global index corresponding to the given local index.
GlobalOrdinal global_ordinal_type
Definition: Xpetra_Map.hpp:86
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with a user-defined contiguous distribution.
UnderlyingLib lib() const
Get the library used by this object (Tpetra or Epetra?)
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with Tpetra-defined contiguous uniform distribution.
const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > toTpetraNonZero(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
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.
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 > &node)
Non-member function to create a (potentially) non-uniform, contiguous Map with a user-specified node...
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
Node node_type
Definition: Xpetra_Map.hpp:87
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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=defaultArgNode())
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Map() const
Get the underlying Tpetra map.
Xpetra namespace
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.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with Tpetra-defined contiguous uniform distribution.
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.
Teuchos::RCP< Node > getNode() const
Get this Map&#39;s Node 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=defaultArgNode())
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.
LocalOrdinal getMinLocalIndex() const
The minimum local index.
~TpetraMap()
Destructor.
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.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2) const
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.
TpetraMap(global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with Tpetra-defined contiguous uniform distribution.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
GlobalOrdinal getIndexBase() const
The index base for this Map.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with a user-defined contiguous distribution.
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.
virtual RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Definition: Xpetra_Map.hpp:211
TpetraMap(const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
TpetraMap constructor to wrap a Tpetra::Map object.
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, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go)
GlobalOrdinal getMinAllGlobalIndex() const
The minimum 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.
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.
const RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > toXpetraNonConst(const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > &)
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.
size_t global_size_t
Global size_t object.
static const EVerbosityLevel verbLevel_default
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
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.
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().
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.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
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.
TpetraMap(global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=defaultArgNode())
Constructor with a user-defined contiguous distribution.
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?)
Teuchos::RCP< Node > getNode() const
Get this Map&#39;s Node object.
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.
RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > map_
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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > removeEmptyProcesses() const
Return a new Map with processes with zero elements removed.
static Teuchos::RCP< Node > defaultArgNode()
global_size_t getGlobalNumElements() const
The number of elements in this Map.
static Teuchos::RCP< Node > defaultArgNode()
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
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.
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.