Xpetra_MapFactory.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_MAPFACTORY_HPP
47 #define XPETRA_MAPFACTORY_HPP
48 
49 #include "Xpetra_ConfigDefs.hpp"
50 #include "Xpetra_Map.hpp"
51 
52 #ifdef HAVE_XPETRA_TPETRA
53 # include "Xpetra_TpetraMap.hpp"
54 #endif
55 #ifdef HAVE_XPETRA_EPETRA
56 # include "Xpetra_EpetraMap.hpp"
57 #endif
58 #include "Xpetra_BlockedMap.hpp"
59 
60 #include "Xpetra_Exceptions.hpp"
61 
62 namespace Xpetra {
63 
69  template <class LocalOrdinal = Map<>::local_ordinal_type,
70  class GlobalOrdinal = typename Map<LocalOrdinal>::global_ordinal_type,
71  class Node = typename Map<LocalOrdinal, GlobalOrdinal>::node_type>
72  class MapFactory {
73 
74  private:
77 
78  public:
82  global_size_t numGlobalElements,
83  GlobalOrdinal indexBase,
84  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
86  const Teuchos::RCP<Node> & /* node */ = Teuchos::null)
87  {
88  XPETRA_MONITOR("MapFactory::Build");
89 
90 #ifdef HAVE_XPETRA_TPETRA
91  if (lib == UseTpetra)
92  return Teuchos::rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, indexBase, comm, lg) );
93 #endif
94 
97  }
98 
102  global_size_t numGlobalElements,
103  size_t numLocalElements,
104  GlobalOrdinal indexBase,
105  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
106  const Teuchos::RCP<Node> & /* node */ = Teuchos::null)
107  {
108  XPETRA_MONITOR("MapFactory::Build");
109 
110 #ifdef HAVE_XPETRA_TPETRA
111  if (lib == UseTpetra)
112  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, numLocalElements, indexBase, comm) );
113 #endif
114 
117  }
118 
122  global_size_t numGlobalElements,
123  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
124  GlobalOrdinal indexBase,
125  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
126  const Teuchos::RCP<Node> & /* node */ = Teuchos::null)
127  {
128  XPETRA_MONITOR("MapFactory::Build");
129 
130 #ifdef HAVE_XPETRA_TPETRA
131  if (lib == UseTpetra)
132  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, elementList, indexBase, comm) );
133 #endif
134 
137  }
138 
143  LocalOrdinal numDofPerNode)
144  {
145  XPETRA_MONITOR("MapFactory::Build");
146 
148  if(!bmap.is_null()) {
150  "Xpetra::MapFactory::Build: When provided a BlockedMap numDofPerNode must set to be one. It is set to " << numDofPerNode << ".");
152  }
153 
154 #ifdef HAVE_XPETRA_TPETRA
155  LocalOrdinal N = map->getNodeNumElements();
156  Teuchos::ArrayView<const GlobalOrdinal> oldElements = map->getNodeElementList();
157  Teuchos::Array<GlobalOrdinal> newElements(map->getNodeNumElements()*numDofPerNode);
158  for (LocalOrdinal i = 0; i < N; i++)
159  for (LocalOrdinal j = 0; j < numDofPerNode; j++)
160  newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
161  if (map->lib() == UseTpetra)
162  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm()));
163 #endif
164 
165  XPETRA_FACTORY_ERROR_IF_EPETRA(map->lib());
167  }
168 
172  size_t numElements,
173  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
174  {
175  XPETRA_MONITOR("MapFactory::Build");
176 
177 #ifdef HAVE_XPETRA_TPETRA
178  if (lib == UseTpetra)
179  return rcp(new Xpetra::TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createLocalMap<LocalOrdinal,GlobalOrdinal>(numElements, comm)));
180 #endif
181 
184  }
185 
189  size_t numElements,
190  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
191  const Teuchos::RCP< Node > & /* node */ = Teuchos::null)
192  {
193  XPETRA_MONITOR("MapFactory::Build");
194 
195 #ifdef HAVE_XPETRA_TPETRA
196  if (lib == UseTpetra)
197  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
198 #endif
199 
202  }
203 
207  global_size_t numElements,
208  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
209  const Teuchos::RCP< Node > & /* node */ = Teuchos::null)
210  {
211  XPETRA_MONITOR("MapFactory::Build");
212 
213 #ifdef HAVE_XPETRA_TPETRA
214  if (lib == UseTpetra)
215  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
216 #endif
217 
220  }
221 
225  global_size_t numElements,
226  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
227  {
228  XPETRA_MONITOR("MapFactory::Build");
229 
230 #ifdef HAVE_XPETRA_TPETRA
231  if (lib == UseTpetra)
232  return rcp(new Xpetra::TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
233 #endif
234 
237  }
238 
242  global_size_t numElements,
243  size_t localNumElements,
244  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
245  {
246  XPETRA_MONITOR("MapFactory::Build");
247 
248 #ifdef HAVE_XPETRA_TPETRA
249  if (lib == UseTpetra)
250  return rcp(new Xpetra::TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
251 #endif
252 
255  }
256 
260  global_size_t numElements,
261  size_t localNumElements,
262  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
263  const Teuchos::RCP< Node > & /* node */ = Teuchos::null)
264  {
265  XPETRA_MONITOR("MapFactory::Build");
266 
267 #ifdef HAVE_XPETRA_TPETRA
268  if (lib == UseTpetra)
269  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
270 #endif
271 
274  }
275  };
276 
277 // we need the Epetra specialization only if Epetra is enabled
278 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
279  template <>
280  class MapFactory<int, int, EpetraNode> {
281 
282  typedef int LocalOrdinal;
283  typedef int GlobalOrdinal;
284  typedef EpetraNode Node;
285 
286  private:
289 
290  public:
291 
294  global_size_t numGlobalElements,
295  int indexBase,
296  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
298  const Teuchos::RCP<Node>& node = Teuchos::rcp (new Node)) {
299  XPETRA_MONITOR("MapFactory::Build");
300 
301 #ifdef HAVE_XPETRA_TPETRA
302  if (lib == UseTpetra)
303  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, indexBase, comm, lg, node) );
304 #endif
305 
306  if (lib == UseEpetra)
307  return rcp( new EpetraMapT<int, Node>(numGlobalElements, indexBase, comm, lg, node) );
308 
310  }
311 
314  global_size_t numGlobalElements,
315  size_t numLocalElements,
316  int indexBase,
317  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
318  const Teuchos::RCP<Node>& node = Teuchos::rcp(new Node))
319  {
320  XPETRA_MONITOR("MapFactory::Build");
321 #ifdef HAVE_XPETRA_TPETRA
322  if (lib == UseTpetra)
323  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, numLocalElements, indexBase, comm, node) );
324 #endif
325 
326  if (lib == UseEpetra)
327  return rcp( new EpetraMapT<int, Node>(numGlobalElements, numLocalElements, indexBase, comm, node) );
328 
330  }
331 
332  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView<const GlobalOrdinal> &elementList, int indexBase, const Teuchos::RCP<const Teuchos::Comm<int> > &comm, const Teuchos::RCP<Node>& node = Teuchos::rcp (new Node)) {
333  XPETRA_MONITOR("MapFactory::Build");
334 #ifdef HAVE_XPETRA_TPETRA
335  if (lib == UseTpetra)
336  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, elementList, indexBase, comm, node) );
337 #endif
338 
339  if (lib == UseEpetra)
340  return rcp( new EpetraMapT<int, Node>(numGlobalElements, elementList, indexBase, comm, node) );
341 
343  }
344 
348  XPETRA_MONITOR("MapFactory::Build");
349 
351  if(!bmap.is_null()) {
353  "Xpetra::MapFactory::Build: When provided a BlockedMap numDofPerNode must set to be one. It is set to " << numDofPerNode << ".");
355  }
356 
357  LocalOrdinal N = Teuchos::as<LocalOrdinal>(map->getNodeNumElements());
358  Teuchos::ArrayView<const GlobalOrdinal> oldElements = map->getNodeElementList();
359  Teuchos::Array<GlobalOrdinal> newElements(map->getNodeNumElements()*numDofPerNode);
360  for (LocalOrdinal i = 0; i < N; i++)
361  for (LocalOrdinal j = 0; j < numDofPerNode; j++)
362  newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
363 
364 #ifdef HAVE_XPETRA_TPETRA
365  if (map->lib() == UseTpetra)
366  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm(), map->getNode()) );
367 #endif
368 
369  if (map->lib() == UseEpetra)
370  return rcp( new EpetraMapT<int, Node>(map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm(), map->getNode()) );
371 
373  }
374 
376  createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
377  XPETRA_MONITOR("MapFactory::Build");
378 
379 #ifdef HAVE_XPETRA_TPETRA
380  if (lib == UseTpetra)
381 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
382  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
383  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
384 #else
386  "Xpetra::MapFactory::createLocalMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
387 #endif
388 #endif
389 
390  if (lib == UseEpetra) {
392  map = Teuchos::rcp( new EpetraMapT<int, Node>((Xpetra::global_size_t)numElements, // num elements, global and local
393  0, // index base is zero
394  comm, LocallyReplicated));
395  return map.getConst();
396  }
397 
399  }
400 
401  // TODO remove this
403  createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP<Node> & /* node */ = Teuchos::null) {
404  XPETRA_MONITOR("MapFactory::Build");
405 
406 #ifdef HAVE_XPETRA_TPETRA
407  if (lib == UseTpetra)
408 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
409  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
410  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<int, GlobalOrdinal, Node> (numElements, comm)));
411 #else
413  "Xpetra::MapFactory::createLocalMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
414 #endif
415 #endif
416 
417  if (lib == UseEpetra) {
419  map = Teuchos::rcp( new EpetraMapT<int, Node>((Xpetra::global_size_t)numElements, // num elements, global and local
420  0, // index base is zero
421  comm, LocallyReplicated));
422  return map.getConst();
423  }
424 
426  }
427 
428  // TODO remove this
431  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
432  const Teuchos::RCP<Node>& /* node */ = Teuchos::null)
433  {
434  XPETRA_MONITOR("MapFactory::Build");
435 
436 #ifdef HAVE_XPETRA_TPETRA
437  if (lib == UseTpetra)
438 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
439  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
440  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<int,GlobalOrdinal,Node> (numElements, comm)));
441 #else
443  "Xpetra::MapFactory::createUniformContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
444 #endif
445 #endif
446 
447  if (lib == UseEpetra) {
449  map = Teuchos::rcp( new EpetraMapT<int,Node>(numElements, // num elements, global and local
450  0, //index base is zero
451  comm, GloballyDistributed));
452  return map.getConst();
453  }
454 
456  }
457 
460  XPETRA_MONITOR("MapFactory::Build");
461 
462 #ifdef HAVE_XPETRA_TPETRA
463  if (lib == UseTpetra)
464 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
465  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
466  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
467 #else
469  "Xpetra::MapFactory::createUniformContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
470 #endif
471 #endif
472 
473  if (lib == UseEpetra) {
474 
476  map = Teuchos::rcp( new EpetraMapT<int,Node>(numElements, // num elements, global and local
477  0, //index base is zero
478  comm, GloballyDistributed));
479  return map.getConst();
480  }
481 
483  }
484 
486  createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
487  XPETRA_MONITOR("MapFactory::Build");
488 
489 #ifdef HAVE_XPETRA_TPETRA
490  if (lib == UseTpetra)
491 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
492  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
493  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
494 #else
496  "Xpetra::MapFactory::createContigMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
497 #endif
498 #endif
499 
500  if (lib == UseEpetra)
501  return MapFactory<int, GlobalOrdinal, Node>::createContigMapWithNode(lib, numElements, localNumElements, comm);
502 
504  }
505 
507  createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements,
508  const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP<Node> & /* node */ = Teuchos::null) {
509  XPETRA_MONITOR("MapFactory::Build");
510 
511 #ifdef HAVE_XPETRA_TPETRA
512  if (lib == UseTpetra)
513 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
514  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
515  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
516 #else
518  "Xpetra::MapFactory::createContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
519 #endif
520 #endif
521 
522  if (lib == UseEpetra) {
523 
525  map = Teuchos::rcp( new EpetraMapT<int, Node>(numElements,localNumElements,
526  0, // index base is zero
527  comm) );
528  return map.getConst();
529  }
530 
532  }
533 
534  };
535 #endif
536 
537  // we need the Epetra specialization only if Epetra is enabled
538 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
539  template <>
540  class MapFactory<int, long long, EpetraNode> {
541 
542  typedef int LocalOrdinal;
543  typedef long long GlobalOrdinal;
544  typedef EpetraNode Node;
545 
546  private:
549 
550  public:
551 
554  global_size_t numGlobalElements,
555  int indexBase,
556  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
558  const Teuchos::RCP<Node>& node = Teuchos::rcp (new Node)) {
559  XPETRA_MONITOR("MapFactory::Build");
560 
561 #ifdef HAVE_XPETRA_TPETRA
562  if (lib == UseTpetra)
563  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, indexBase, comm, lg, node) );
564 #endif
565 
566  if (lib == UseEpetra)
567  return rcp( new EpetraMapT<long long, Node>(numGlobalElements, indexBase, comm, lg, node) );
568 
570  }
571 
574  global_size_t numGlobalElements,
575  size_t numLocalElements,
576  int indexBase,
577  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
578  const Teuchos::RCP<Node>& node = Teuchos::rcp (new Node))
579  {
580  XPETRA_MONITOR("MapFactory::Build");
581 
582 #ifdef HAVE_XPETRA_TPETRA
583  if (lib == UseTpetra)
584  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, numLocalElements, indexBase, comm, node) );
585 #endif
586 
587  if (lib == UseEpetra)
588  return rcp( new EpetraMapT<long long, Node>(numGlobalElements, numLocalElements, indexBase, comm, node) );
589 
591  }
592 
593  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView<const GlobalOrdinal> &elementList, int indexBase, const Teuchos::RCP<const Teuchos::Comm<int> > &comm, const Teuchos::RCP<Node>& node = Teuchos::rcp (new Node)) {
594  XPETRA_MONITOR("MapFactory::Build");
595 
596 #ifdef HAVE_XPETRA_TPETRA
597  if (lib == UseTpetra)
598  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, elementList, indexBase, comm, node) );
599 #endif
600 
601  if (lib == UseEpetra)
602  return rcp( new EpetraMapT<long long, Node>(numGlobalElements, elementList, indexBase, comm, node) );
603 
605  }
606 
610  XPETRA_MONITOR("MapFactory::Build");
611 
613  if(!bmap.is_null()) {
615  "Xpetra::MapFactory::Build: When provided a BlockedMap numDofPerNode must set to be one. It is set to " << numDofPerNode << ".");
617  }
618 
619  LocalOrdinal N = map->getNodeNumElements();
620  Teuchos::ArrayView<const GlobalOrdinal> oldElements = map->getNodeElementList();
621  Teuchos::Array<GlobalOrdinal> newElements(map->getNodeNumElements()*numDofPerNode);
622  for (LocalOrdinal i = 0; i < N; i++)
623  for (LocalOrdinal j = 0; j < numDofPerNode; j++)
624  newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
625 
626 #ifdef HAVE_XPETRA_TPETRA
627  if (map->lib() == UseTpetra)
628  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm(), map->getNode()) );
629 #endif
630 
631  if (map->lib() == UseEpetra)
632  return rcp( new EpetraMapT<long long, Node>(map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm(), map->getNode()) );
633 
635  }
636 
638  createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
639  XPETRA_MONITOR("MapFactory::Build");
640 
641 #ifdef HAVE_XPETRA_TPETRA
642  if (lib == UseTpetra)
643 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
644  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
645  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
646 #else
648  "Xpetra::MapFactory::createLocalMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=long long");
649 #endif
650 #endif
651 
652  if (lib == UseEpetra)
653  return MapFactory<int, GlobalOrdinal, Node>::createLocalMapWithNode (lib, numElements, comm);
654 
656  }
657 
659  createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP<Node> & /* node */ = Teuchos::null) {
660  XPETRA_MONITOR("MapFactory::Build");
661 
662 #ifdef HAVE_XPETRA_TPETRA
663  if (lib == UseTpetra)
664 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
665  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
666  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<int, GlobalOrdinal, Node> (numElements, comm)));
667 #else
669  "Xpetra::MapFactory::createLocalMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=long long");
670 #endif
671 #endif
672 
673  if (lib == UseEpetra) {
675  map = Teuchos::rcp( new EpetraMapT<long long, Node>((Xpetra::global_size_t)numElements, // num elements, global and local
676  0, // index base is zero
677  comm, LocallyReplicated));
678  return map.getConst();
679  }
680 
682  }
683 
686  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
687  const Teuchos::RCP<Node>& /* node */ = Teuchos::null)
688  {
689  XPETRA_MONITOR("MapFactory::Build");
690 
691 #ifdef HAVE_XPETRA_TPETRA
692  if (lib == UseTpetra)
693 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
694  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
695  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<int,GlobalOrdinal,Node> (numElements, comm)));
696 #else
698  "Xpetra::MapFactory::createUniformContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=long long");
699 #endif
700 #endif
701 
702  if (lib == UseEpetra) {
704  map = Teuchos::rcp( new EpetraMapT<long long, Node>(numElements, // num elements, global and local
705  0, //index base is zero
706  comm, GloballyDistributed));
707  return map.getConst();
708  }
709 
711  }
712 
715  XPETRA_MONITOR("MapFactory::Build");
716 
717 #ifdef HAVE_XPETRA_TPETRA
718  if (lib == UseTpetra)
719 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
720  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
721  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
722 #else
724  "Xpetra::MapFactory::createUniformContigMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=long long");
725 #endif
726 #endif
727 
728  if (lib == UseEpetra)
730 
732  }
733 
735  createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
736  XPETRA_MONITOR("MapFactory::Build");
737 
738 #ifdef HAVE_XPETRA_TPETRA
739  if (lib == UseTpetra)
740 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
741  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
742  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
743 #else
745  "Xpetra::MapFactory::createContigMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=long long");
746 #endif
747 #endif
748 
749  if (lib == UseEpetra)
750  return MapFactory<int, GlobalOrdinal, Node>::createContigMapWithNode(lib, numElements, localNumElements, comm);
751 
753  }
754 
756  createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements,
757  const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP<Node> & /* node */ = Teuchos::null) {
758  XPETRA_MONITOR("MapFactory::Build");
759 
760 #ifdef HAVE_XPETRA_TPETRA
761  if (lib == UseTpetra)
762 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
763  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
764  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
765 #else
767  "Xpetra::MapFactory::createContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=long long");
768 #endif
769 #endif
770 
771  if (lib == UseEpetra) {
773  map = Teuchos::rcp( new EpetraMapT<long long, Node>(numElements,localNumElements,
774  0, // index base is zero
775  comm) );
776  return map.getConst();
777  }
778 
780  }
781 
782  };
783 #endif
784 
785 }
786 
787 #define XPETRA_MAPFACTORY_SHORT
788 #endif
789 //TODO: removed unused methods
Kokkos::Compat::KokkosSerialWrapperNode
Definition: Kokkos_SerialNode.hpp:57
Xpetra_EpetraMap.hpp
Xpetra::MapFactory::Build
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, size_t numLocalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Map constructor with a user-defined contiguous distribution.
Definition: Xpetra_MapFactory.hpp:101
Xpetra::LocalGlobal
LocalGlobal
Definition: Xpetra_ConfigDefs.hpp:173
Xpetra::MapFactory< int, int, EpetraNode >::createUniformContigMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Definition: Xpetra_MapFactory.hpp:430
Xpetra
Xpetra namespace
Definition: Xpetra_BlockedCrsMatrix.hpp:86
Xpetra::MapFactory< int, long long, EpetraNode >::createContigMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition: Xpetra_MapFactory.hpp:735
Xpetra::MapFactory< int, int, EpetraNode >::createContigMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition: Xpetra_MapFactory.hpp:486
Xpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition: Xpetra_ConfigDefs.hpp:170
Xpetra::MapFactory< int, long long, EpetraNode >::createUniformContigMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Definition: Xpetra_MapFactory.hpp:685
Xpetra::MapFactory< int, int, EpetraNode >::createUniformContigMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition: Xpetra_MapFactory.hpp:459
Xpetra::MapFactory::createUniformContigMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Create a uniform, contiguous Map with a user-specified node.
Definition: Xpetra_MapFactory.hpp:206
Xpetra::MapFactory::createUniformContigMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a uniform, contiguous Map with the default node.
Definition: Xpetra_MapFactory.hpp:224
Xpetra::MapFactory< int, long long, EpetraNode >::createContigMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Definition: Xpetra_MapFactory.hpp:756
Xpetra::MapFactory< int, int, EpetraNode >::createContigMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Definition: Xpetra_MapFactory.hpp:507
Xpetra::MapFactory< int, long long, EpetraNode >::createLocalMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition: Xpetra_MapFactory.hpp:638
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Xpetra::GloballyDistributed
Definition: Xpetra_ConfigDefs.hpp:175
Xpetra::MapFactory::createLocalMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Create a locally replicated Map with a specified node.
Definition: Xpetra_MapFactory.hpp:188
Xpetra::UseTpetra
Definition: Xpetra_Map.hpp:83
Teuchos::ArrayView
Xpetra::MapFactory
Create an Xpetra::Map instance.
Definition: Xpetra_MapFactory.hpp:72
Xpetra::Map
Definition: Xpetra_Map.hpp:90
Xpetra::MapFactory::createLocalMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a locally replicated Map with the default node.
Definition: Xpetra_MapFactory.hpp:171
Teuchos::RCP
Teuchos::Array
Xpetra::MapFactory< int, long long, EpetraNode >::Build
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
Definition: Xpetra_MapFactory.hpp:609
Xpetra::MapFactory::createContigMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Create a (potentially) non-uniform, contiguous Map with a user-specified node.
Definition: Xpetra_MapFactory.hpp:259
Xpetra_TpetraMap.hpp
Xpetra::MapFactory< int, int, EpetraNode >::Build
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Definition: Xpetra_MapFactory.hpp:332
Xpetra::MapFactory::Build
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=Xpetra::GloballyDistributed, const Teuchos::RCP< Node > &=Teuchos::null)
Map constructor with Xpetra-defined contiguous uniform distribution.
Definition: Xpetra_MapFactory.hpp:81
Xpetra::Exceptions::RuntimeError
Exception throws to report errors in the internal logical of the program.
Definition: Xpetra_Exceptions.hpp:101
Xpetra::LocallyReplicated
Definition: Xpetra_ConfigDefs.hpp:174
Xpetra::MapFactory< int, int, EpetraNode >::MapFactory
MapFactory()
Private constructor. This is a static class.
Definition: Xpetra_MapFactory.hpp:288
Xpetra::TpetraMap
Definition: Xpetra_TpetraMap.hpp:79
XPETRA_FACTORY_ERROR_IF_EPETRA
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
Definition: Xpetra_Exceptions.hpp:70
Xpetra::MapFactory::Build
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Map constructor with user-defined non-contiguous (arbitrary) distribution.
Definition: Xpetra_MapFactory.hpp:121
Xpetra::MapFactory< int, long long, EpetraNode >::createUniformContigMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition: Xpetra_MapFactory.hpp:714
Xpetra::MapFactory< int, int, EpetraNode >::Build
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
Definition: Xpetra_MapFactory.hpp:347
Xpetra::MapFactory< int, long long, EpetraNode >::Build
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, size_t numLocalElements, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Definition: Xpetra_MapFactory.hpp:573
Xpetra::MapFactory< int, int, EpetraNode >::GlobalOrdinal
int GlobalOrdinal
Definition: Xpetra_MapFactory.hpp:283
Xpetra::MapFactory< int, long long, EpetraNode >::MapFactory
MapFactory()
Private constructor. This is a static class.
Definition: Xpetra_MapFactory.hpp:548
Xpetra_ConfigDefs.hpp
Teuchos::RCP::is_null
bool is_null() const
Xpetra::MapFactory::createContigMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMap(UnderlyingLib lib, global_size_t numElements, size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a (potentially) non-uniform, contiguous Map with the default node.
Definition: Xpetra_MapFactory.hpp:241
Xpetra::MapFactory< int, long long, EpetraNode >::Node
EpetraNode Node
Definition: Xpetra_MapFactory.hpp:544
Xpetra::Map::global_ordinal_type
GlobalOrdinal global_ordinal_type
Definition: Xpetra_Map.hpp:95
Xpetra::MapFactory< int, int, EpetraNode >::createLocalMap
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Definition: Xpetra_MapFactory.hpp:376
Xpetra::MapFactory< int, int, EpetraNode >::Node
EpetraNode Node
Definition: Xpetra_MapFactory.hpp:284
Xpetra::EpetraMapT
Definition: Xpetra_EpetraMap.hpp:77
Teuchos::RCP::getConst
RCP< const T > getConst() const
Xpetra_Exceptions.hpp
Xpetra::MapFactory< int, long long, EpetraNode >::LocalOrdinal
int LocalOrdinal
Definition: Xpetra_MapFactory.hpp:542
Xpetra::MapFactory::MapFactory
MapFactory()
Private constructor. This is a static class.
Definition: Xpetra_MapFactory.hpp:76
Xpetra::UnderlyingLib
UnderlyingLib
Definition: Xpetra_Map.hpp:81
Xpetra::UseEpetra
Definition: Xpetra_Map.hpp:82
Xpetra_BlockedMap.hpp
Xpetra::MapFactory< int, int, EpetraNode >::Build
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, size_t numLocalElements, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Definition: Xpetra_MapFactory.hpp:313
Xpetra::MapFactory::Build
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
Definition: Xpetra_MapFactory.hpp:142
Xpetra::MapFactory< int, long long, EpetraNode >::Build
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Definition: Xpetra_MapFactory.hpp:553
Teuchos::Comm
Xpetra::MapFactory< int, long long, EpetraNode >::createLocalMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Definition: Xpetra_MapFactory.hpp:659
Xpetra::MapFactory< int, int, EpetraNode >::LocalOrdinal
int LocalOrdinal
Definition: Xpetra_MapFactory.hpp:282
XPETRA_FACTORY_END
#define XPETRA_FACTORY_END
Definition: Xpetra_Exceptions.hpp:77
Xpetra::Map::node_type
Node node_type
Definition: Xpetra_Map.hpp:96
Xpetra::MapFactory< int, long long, EpetraNode >::Build
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, const Teuchos::ArrayView< const GlobalOrdinal > &elementList, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Definition: Xpetra_MapFactory.hpp:593
Xpetra::MapFactory< int, int, EpetraNode >::createLocalMapWithNode
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &=Teuchos::null)
Definition: Xpetra_MapFactory.hpp:403
TEUCHOS_TEST_FOR_EXCEPTION
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Xpetra::BlockedMap
Definition: Xpetra_BlockedMap.hpp:67
XPETRA_MONITOR
#define XPETRA_MONITOR(funcName)
Definition: Xpetra_ConfigDefs.hpp:128
Xpetra::MapFactory< int, int, EpetraNode >::Build
static RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, int indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< Node > &node=Teuchos::rcp(new Node))
Definition: Xpetra_MapFactory.hpp:293
Xpetra::MapFactory< int, long long, EpetraNode >::GlobalOrdinal
long long GlobalOrdinal
Definition: Xpetra_MapFactory.hpp:543
Xpetra_Map.hpp