All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:
80 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
81  TPETRA_DEPRECATED
83  Build (UnderlyingLib lib,
84  global_size_t numGlobalElements,
85  GlobalOrdinal indexBase,
86  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
87  LocalGlobal lg,
88  const Teuchos::RCP<Node> & /* node */)
89  {
90  return Build(lib, numGlobalElements, indexBase, comm, lg);
91  }
92 #endif // TPETRA_ENABLE_DEPRECATED_CODE
95  global_size_t numGlobalElements,
96  GlobalOrdinal indexBase,
97  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
99  {
100  XPETRA_MONITOR("MapFactory::Build");
101 
102 #ifdef HAVE_XPETRA_TPETRA
103  if (lib == UseTpetra)
104  return Teuchos::rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, indexBase, comm, lg) );
105 #endif
106 
109  }
110 
112 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
113  TPETRA_DEPRECATED
115  Build (UnderlyingLib lib,
116  global_size_t numGlobalElements,
117  size_t numLocalElements,
118  GlobalOrdinal indexBase,
119  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
120  const Teuchos::RCP<Node> & /* node */)
121  {
122  return Build(lib, numGlobalElements, numLocalElements, indexBase, comm);
123  }
124 #endif // TPETRA_ENABLE_DEPRECATED_CODE
127  global_size_t numGlobalElements,
128  size_t numLocalElements,
129  GlobalOrdinal indexBase,
130  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
131  {
132  XPETRA_MONITOR("MapFactory::Build");
133 
134 #ifdef HAVE_XPETRA_TPETRA
135  if (lib == UseTpetra)
136  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, numLocalElements, indexBase, comm) );
137 #endif
138 
141  }
142 
144 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
145  TPETRA_DEPRECATED
147  Build (UnderlyingLib lib,
148  global_size_t numGlobalElements,
149  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
150  GlobalOrdinal indexBase,
151  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
152  const Teuchos::RCP<Node> & /* node */)
153  {
154  return Build(lib, numGlobalElements, elementList, indexBase, comm);
155  }
156 #endif // TPETRA_ENABLE_DEPRECATED_CODE
159  global_size_t numGlobalElements,
160  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
161  GlobalOrdinal indexBase,
162  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
163  {
164  XPETRA_MONITOR("MapFactory::Build");
165 
166 #ifdef HAVE_XPETRA_TPETRA
167  if (lib == UseTpetra)
168  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, elementList, indexBase, comm) );
169 #endif
170 
173  }
174 
179  LocalOrdinal numDofPerNode)
180  {
181  XPETRA_MONITOR("MapFactory::Build");
182 
184  if(!bmap.is_null()) {
186  "Xpetra::MapFactory::Build: When provided a BlockedMap numDofPerNode must set to be one. It is set to " << numDofPerNode << ".");
188  }
189 
190 #ifdef HAVE_XPETRA_TPETRA
191  LocalOrdinal N = map->getNodeNumElements();
192  Teuchos::ArrayView<const GlobalOrdinal> oldElements = map->getNodeElementList();
193  Teuchos::Array<GlobalOrdinal> newElements(map->getNodeNumElements()*numDofPerNode);
194  for (LocalOrdinal i = 0; i < N; i++)
195  for (LocalOrdinal j = 0; j < numDofPerNode; j++)
196  newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
197  if (map->lib() == UseTpetra)
198  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm()));
199 #endif
200 
201  XPETRA_FACTORY_ERROR_IF_EPETRA(map->lib());
203  }
204 
205 
206 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
207 #ifdef HAVE_XPETRA_TPETRA
209  Build (UnderlyingLib lib,
210  global_size_t numGlobalElements,
211  const Kokkos::View<const GlobalOrdinal*, typename Node::device_type>& indexList,
212  GlobalOrdinal indexBase,
213  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
214  {
215  XPETRA_MONITOR("MapFactory::Build");
216  if (lib == UseTpetra)
217  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements,
218  indexList,
219  indexBase,
220  comm));
223  }
224 #endif
225 #endif
226 
230  size_t numElements,
231  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
232  {
233  XPETRA_MONITOR("MapFactory::Build");
234 
235 #ifdef HAVE_XPETRA_TPETRA
236  if (lib == UseTpetra)
237  return rcp(new Xpetra::TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createLocalMap<LocalOrdinal,GlobalOrdinal>(numElements, comm)));
238 #endif
239 
242  }
243 
245 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
246  TPETRA_DEPRECATED
249  size_t numElements,
250  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
251  const Teuchos::RCP< Node > & /* node */)
252  {
253  return createLocalMapWithNode(lib, numElements, comm);
254  }
255 #endif // TPETRA_ENABLE_DEPRECATED_CODE
258  size_t numElements,
259  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
260  {
261  XPETRA_MONITOR("MapFactory::Build");
262 
263 #ifdef HAVE_XPETRA_TPETRA
264  if (lib == UseTpetra)
265  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
266 #endif
267 
270  }
271 
273 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
274  TPETRA_DEPRECATED
277  global_size_t numElements,
278  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
279  const Teuchos::RCP< Node > & /* node */ )
280  {
281  return createUniformContigMapWithNode(lib, numElements, comm);
282  }
283 #endif // TPETRA_ENABLE_DEPRECATED_CODE
286  global_size_t numElements,
287  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
288  {
289  XPETRA_MONITOR("MapFactory::Build");
290 
291 #ifdef HAVE_XPETRA_TPETRA
292  if (lib == UseTpetra)
293  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
294 #endif
295 
298  }
299 
303  global_size_t numElements,
304  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
305  {
306  XPETRA_MONITOR("MapFactory::Build");
307 
308 #ifdef HAVE_XPETRA_TPETRA
309  if (lib == UseTpetra)
310  return rcp(new Xpetra::TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, comm)));
311 #endif
312 
315  }
316 
320  global_size_t numElements,
321  size_t localNumElements,
322  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
323  {
324  XPETRA_MONITOR("MapFactory::Build");
325 
326 #ifdef HAVE_XPETRA_TPETRA
327  if (lib == UseTpetra)
328  return rcp(new Xpetra::TpetraMap<LocalOrdinal,GlobalOrdinal,Node>(Tpetra::createContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
329 #endif
330 
333  }
334 
336 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
337  TPETRA_DEPRECATED
340  global_size_t numElements,
341  size_t localNumElements,
342  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
343  const Teuchos::RCP< Node > & /* node */)
344  {
345  return createContigMapWithNode(lib, numElements, localNumElements, comm);
346  }
347 #endif // TPETRA_ENABLE_DEPRECATED_CODE
350  global_size_t numElements,
351  size_t localNumElements,
352  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
353  {
354  XPETRA_MONITOR("MapFactory::Build");
355 
356 #ifdef HAVE_XPETRA_TPETRA
357  if (lib == UseTpetra)
358  return rcp(new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<LocalOrdinal,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
359 #endif
360 
363  }
364  };
365 
366 // we need the Epetra specialization only if Epetra is enabled
367 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
368  template <>
369  class MapFactory<int, int, EpetraNode> {
370 
371  typedef int LocalOrdinal;
372  typedef int GlobalOrdinal;
373  typedef EpetraNode Node;
374 
375  private:
378 
379  public:
380 
381 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
382  TPETRA_DEPRECATED
384  Build (UnderlyingLib lib,
385  global_size_t numGlobalElements,
386  int indexBase,
387  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
388  LocalGlobal lg,
389  const Teuchos::RCP<Node>& /* node */ )
390  {
391  return Build(lib, numGlobalElements, indexBase, comm, lg);
392  }
393 #endif // TPETRA_ENABLE_DEPRECATED_CODE
394  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> >
396  global_size_t numGlobalElements,
397  int indexBase,
398  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
400  {
401  XPETRA_MONITOR("MapFactory::Build");
402 
403 #ifdef HAVE_XPETRA_TPETRA
404  if (lib == UseTpetra)
405  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, indexBase, comm, lg) );
406 #endif
407 
408  if (lib == UseEpetra)
409  return rcp( new EpetraMapT<int, Node>(numGlobalElements, indexBase, comm, lg) );
410 
412  }
413 
414 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
415  TPETRA_DEPRECATED
417  Build (UnderlyingLib lib,
418  global_size_t numGlobalElements,
419  size_t numLocalElements,
420  int indexBase,
421  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
422  const Teuchos::RCP<Node>& /* node */ )
423  {
424  return Build(lib, numGlobalElements, numLocalElements, indexBase, comm);
425  }
426 #endif // TPETRA_ENABLE_DEPRECATED_CODE
427  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> >
429  global_size_t numGlobalElements,
430  size_t numLocalElements,
431  int indexBase,
432  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
433  {
434  XPETRA_MONITOR("MapFactory::Build");
435 #ifdef HAVE_XPETRA_TPETRA
436  if (lib == UseTpetra)
437  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, numLocalElements, indexBase, comm) );
438 #endif
439 
440  if (lib == UseEpetra)
441  return rcp( new EpetraMapT<int, Node>(numGlobalElements, numLocalElements, indexBase, comm) );
442 
444  }
445 
446 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
447  TPETRA_DEPRECATED
449  Build(UnderlyingLib lib,
450  global_size_t numGlobalElements,
451  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
452  int indexBase,
453  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
454  const Teuchos::RCP<Node>& /* node */ )
455  {
456  return Build(lib, numGlobalElements, elementList, indexBase, comm);
457  }
458 #endif // TPETRA_ENABLE_DEPRECATED_CODE
459  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> >
461  global_size_t numGlobalElements,
462  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
463  int indexBase,
464  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
465  {
466  XPETRA_MONITOR("MapFactory::Build");
467 #ifdef HAVE_XPETRA_TPETRA
468  if (lib == UseTpetra)
469  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, elementList, indexBase, comm) );
470 #endif
471 
472  if (lib == UseEpetra)
473  return rcp( new EpetraMapT<int, Node>(numGlobalElements, elementList, indexBase, comm) );
474 
476  }
477 
481  LocalOrdinal numDofPerNode) {
482  XPETRA_MONITOR("MapFactory::Build");
483 
485  if(!bmap.is_null()) {
487  "Xpetra::MapFactory::Build: When provided a BlockedMap numDofPerNode must set to be one. It is set to " << numDofPerNode << ".");
489  }
490 
491  LocalOrdinal N = Teuchos::as<LocalOrdinal>(map->getNodeNumElements());
492  Teuchos::ArrayView<const GlobalOrdinal> oldElements = map->getNodeElementList();
493  Teuchos::Array<GlobalOrdinal> newElements(map->getNodeNumElements()*numDofPerNode);
494  for (LocalOrdinal i = 0; i < N; i++)
495  for (LocalOrdinal j = 0; j < numDofPerNode; j++)
496  newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
497 
498 #ifdef HAVE_XPETRA_TPETRA
499  if (map->lib() == UseTpetra)
500  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm()) );
501 #endif
502 
503  if (map->lib() == UseEpetra)
504  return rcp( new EpetraMapT<int, Node>(map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm()) );
505 
507  }
508 
511  size_t numElements,
512  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
513  XPETRA_MONITOR("MapFactory::Build");
514 
515 #ifdef HAVE_XPETRA_TPETRA
516  if (lib == UseTpetra)
517 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
518  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
519  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
520 #else
522  "Xpetra::MapFactory::createLocalMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
523 #endif
524 #endif
525 
526  if (lib == UseEpetra) {
528  map = Teuchos::rcp( new EpetraMapT<int, Node>((Xpetra::global_size_t)numElements, // num elements, global and local
529  0, // index base is zero
530  comm, LocallyReplicated));
531  return map.getConst();
532  }
533 
535  }
536 
537  // TODO remove this
538 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
539  TPETRA_DEPRECATED
542  size_t numElements,
543  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
544  const Teuchos::RCP<Node> & /* node */)
545  {
546  return createLocalMapWithNode(lib, numElements, comm);
547  }
548 #endif // TPETRA_ENABLE_DEPRECATED_CODE
551  size_t numElements,
552  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
553  {
554  XPETRA_MONITOR("MapFactory::Build");
555 
556 #ifdef HAVE_XPETRA_TPETRA
557  if (lib == UseTpetra)
558 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
559  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
560  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<int, GlobalOrdinal, Node> (numElements, comm)));
561 #else
563  "Xpetra::MapFactory::createLocalMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
564 #endif
565 #endif
566 
567  if (lib == UseEpetra) {
569  map = Teuchos::rcp( new EpetraMapT<int, Node>((Xpetra::global_size_t)numElements, // num elements, global and local
570  0, // index base is zero
571  comm, LocallyReplicated));
572  return map.getConst();
573  }
574 
576  }
577 
578  // TODO remove this
579 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
580  TPETRA_DEPRECATED
583  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
584  const Teuchos::RCP<Node>& /* node */)
585  {
586  return createUniformContigMapWithNode(lib, numElements, comm);
587  }
588 #endif // TPETRA_ENABLE_DEPRECATED_CODE
591  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
592  {
593  XPETRA_MONITOR("MapFactory::Build");
594 
595 #ifdef HAVE_XPETRA_TPETRA
596  if (lib == UseTpetra)
597 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
598  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
599  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<int,GlobalOrdinal,Node> (numElements, comm)));
600 #else
602  "Xpetra::MapFactory::createUniformContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
603 #endif
604 #endif
605 
606  if (lib == UseEpetra) {
608  map = Teuchos::rcp( new EpetraMapT<int,Node>(numElements, // num elements, global and local
609  0, //index base is zero
610  comm, GloballyDistributed));
611  return map.getConst();
612  }
613 
615  }
616 
619  global_size_t numElements,
620  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
621  XPETRA_MONITOR("MapFactory::Build");
622 
623 #ifdef HAVE_XPETRA_TPETRA
624  if (lib == UseTpetra)
625 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
626  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
627  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
628 #else
630  "Xpetra::MapFactory::createUniformContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
631 #endif
632 #endif
633 
634  if (lib == UseEpetra) {
635 
637  map = Teuchos::rcp( new EpetraMapT<int,Node>(numElements, // num elements, global and local
638  0, //index base is zero
639  comm, GloballyDistributed));
640  return map.getConst();
641  }
642 
644  }
645 
648  global_size_t numElements,
649  size_t localNumElements,
650  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
651  XPETRA_MONITOR("MapFactory::Build");
652 
653 #ifdef HAVE_XPETRA_TPETRA
654  if (lib == UseTpetra)
655 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
656  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
657  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
658 #else
660  "Xpetra::MapFactory::createContigMap: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
661 #endif
662 #endif
663 
664  if (lib == UseEpetra)
665  return MapFactory<int, GlobalOrdinal, Node>::createContigMapWithNode(lib, numElements, localNumElements, comm);
666 
668  }
669 
670 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
671  TPETRA_DEPRECATED
674  global_size_t numElements,
675  size_t localNumElements,
676  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
677  const Teuchos::RCP<Node> & /* node */)
678  {
679  return createContigMapWithNode(lib, numElements, localNumElements, comm);
680  }
681 #endif // TPETRA_ENABLE_DEPRECATED_CODE
684  global_size_t numElements,
685  size_t localNumElements,
686  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
687  {
688  XPETRA_MONITOR("MapFactory::Build");
689 
690 #ifdef HAVE_XPETRA_TPETRA
691  if (lib == UseTpetra)
692 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT))) || \
693  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT))))
694  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
695 #else
697  "Xpetra::MapFactory::createContigMapWithNode: Cannot create Xpetra::TpetraMap, since Tpetra is not instantiated on EpetraNode (Serial or OpenMP, depending on configuration) and/or GO=int");
698 #endif
699 #endif
700 
701  if (lib == UseEpetra) {
702 
704  map = Teuchos::rcp( new EpetraMapT<int, Node>(numElements,localNumElements,
705  0, // index base is zero
706  comm) );
707  return map.getConst();
708  }
709 
711  }
712 
713  };
714 #endif
715 
716  // we need the Epetra specialization only if Epetra is enabled
717 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
718  template <>
719  class MapFactory<int, long long, EpetraNode> {
720 
721  typedef int LocalOrdinal;
722  typedef long long GlobalOrdinal;
723  typedef EpetraNode Node;
724 
725  private:
728 
729  public:
730 
731 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
732  TPETRA_DEPRECATED
734  Build (UnderlyingLib lib,
735  global_size_t numGlobalElements,
736  int indexBase,
737  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
738  LocalGlobal lg,
739  const Teuchos::RCP<Node>& /* node */)
740  {
741  return Build(lib, numGlobalElements, indexBase, comm, lg);
742  }
743 #endif // TPETRA_ENABLE_DEPRECATED_CODE
744  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> >
746  global_size_t numGlobalElements,
747  int indexBase,
748  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
750  {
751  XPETRA_MONITOR("MapFactory::Build");
752 
753 #ifdef HAVE_XPETRA_TPETRA
754  if (lib == UseTpetra)
755  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, indexBase, comm, lg) );
756 #endif
757 
758  if (lib == UseEpetra)
759  return rcp( new EpetraMapT<long long, Node>(numGlobalElements, indexBase, comm, lg) );
760 
762  }
763 
764 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
765  TPETRA_DEPRECATED
767  Build (UnderlyingLib lib,
768  global_size_t numGlobalElements,
769  size_t numLocalElements,
770  int indexBase,
771  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
772  const Teuchos::RCP<Node>& /* node */)
773  {
774  return Build(lib, numGlobalElements, numLocalElements, indexBase, comm);
775  }
776 #endif // TPETRA_ENABLE_DEPRECATED_CODE
777  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> >
779  global_size_t numGlobalElements,
780  size_t numLocalElements,
781  int indexBase,
782  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
783  {
784  XPETRA_MONITOR("MapFactory::Build");
785 
786 #ifdef HAVE_XPETRA_TPETRA
787  if (lib == UseTpetra)
788  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, numLocalElements, indexBase, comm) );
789 #endif
790 
791  if (lib == UseEpetra)
792  return rcp( new EpetraMapT<long long, Node>(numGlobalElements, numLocalElements, indexBase, comm) );
793 
795  }
796 
797 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
798  TPETRA_DEPRECATED
800  Build(UnderlyingLib lib,
801  global_size_t numGlobalElements,
802  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
803  int indexBase,
804  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
805  const Teuchos::RCP<Node>& /* node */)
806  {
807  return Build(lib, numGlobalElements, elementList, indexBase, comm);
808  }
809 #endif // TPETRA_ENABLE_DEPRECATED_CODE
810  static RCP<Map<LocalOrdinal,GlobalOrdinal, Node> >
812  global_size_t numGlobalElements,
813  const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
814  int indexBase,
815  const Teuchos::RCP<const Teuchos::Comm<int> > &comm)
816  {
817  XPETRA_MONITOR("MapFactory::Build");
818 
819 #ifdef HAVE_XPETRA_TPETRA
820  if (lib == UseTpetra)
821  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (numGlobalElements, elementList, indexBase, comm) );
822 #endif
823 
824  if (lib == UseEpetra)
825  return rcp( new EpetraMapT<long long, Node>(numGlobalElements, elementList, indexBase, comm) );
826 
828  }
829 
833  LocalOrdinal numDofPerNode) {
834  XPETRA_MONITOR("MapFactory::Build");
835 
837  if(!bmap.is_null()) {
839  "Xpetra::MapFactory::Build: When provided a BlockedMap numDofPerNode must set to be one. It is set to " << numDofPerNode << ".");
841  }
842 
843  LocalOrdinal N = map->getNodeNumElements();
844  Teuchos::ArrayView<const GlobalOrdinal> oldElements = map->getNodeElementList();
845  Teuchos::Array<GlobalOrdinal> newElements(map->getNodeNumElements()*numDofPerNode);
846  for (LocalOrdinal i = 0; i < N; i++)
847  for (LocalOrdinal j = 0; j < numDofPerNode; j++)
848  newElements[i*numDofPerNode + j] = oldElements[i]*numDofPerNode + j;
849 
850 #ifdef HAVE_XPETRA_TPETRA
851  if (map->lib() == UseTpetra)
852  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm()) );
853 #endif
854 
855  if (map->lib() == UseEpetra)
856  return rcp( new EpetraMapT<long long, Node>(map->getGlobalNumElements()*numDofPerNode, newElements, map->getIndexBase(), map->getComm()) );
857 
859  }
860 
863  size_t numElements,
864  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
865  XPETRA_MONITOR("MapFactory::Build");
866 
867 #ifdef HAVE_XPETRA_TPETRA
868  if (lib == UseTpetra)
869 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
870  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
871  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
872 #else
874  "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");
875 #endif
876 #endif
877 
878  if (lib == UseEpetra)
879  return MapFactory<int, GlobalOrdinal, Node>::createLocalMapWithNode (lib, numElements, comm);
880 
882  }
883 
884 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
885  TPETRA_DEPRECATED
888  size_t numElements,
889  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
890  const Teuchos::RCP<Node> & /* node */)
891  {
892  return createLocalMapWithNode(lib, numElements, comm);
893  }
894 #endif // TPETRA_ENABLE_DEPRECATED_CODE
895 
898  size_t numElements,
899  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
900  {
901  XPETRA_MONITOR("MapFactory::Build");
902 
903 #ifdef HAVE_XPETRA_TPETRA
904  if (lib == UseTpetra)
905 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
906  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
907  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createLocalMapWithNode<int, GlobalOrdinal, Node> (numElements, comm)));
908 #else
910  "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");
911 #endif
912 #endif
913 
914  if (lib == UseEpetra) {
916  map = Teuchos::rcp( new EpetraMapT<long long, Node>((Xpetra::global_size_t)numElements, // num elements, global and local
917  0, // index base is zero
918  comm, LocallyReplicated));
919  return map.getConst();
920  }
921 
923  }
924 
925 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
926  TPETRA_DEPRECATED
929  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
930  const Teuchos::RCP<Node>& /* node */)
931  {
932  return createUniformContigMapWithNode(lib, numElements, comm);
933  }
934 #endif // TPETRA_ENABLE_DEPRECATED_CODE
937  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
938  {
939  XPETRA_MONITOR("MapFactory::Build");
940 
941 #ifdef HAVE_XPETRA_TPETRA
942  if (lib == UseTpetra)
943 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
944  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
945  return rcp (new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<int,GlobalOrdinal,Node> (numElements, comm)));
946 #else
948  "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");
949 #endif
950 #endif
951 
952  if (lib == UseEpetra) {
954  map = Teuchos::rcp( new EpetraMapT<long long, Node>(numElements, // num elements, global and local
955  0, //index base is zero
956  comm, GloballyDistributed));
957  return map.getConst();
958  }
959 
961  }
962 
965  global_size_t numElements,
966  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
967  XPETRA_MONITOR("MapFactory::Build");
968 
969 #ifdef HAVE_XPETRA_TPETRA
970  if (lib == UseTpetra)
971 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
972  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
973  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createUniformContigMapWithNode<LocalOrdinal,GlobalOrdinal, Node>(numElements, comm)));
974 #else
976  "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");
977 #endif
978 #endif
979 
980  if (lib == UseEpetra)
982 
984  }
985 
988  global_size_t numElements,
989  size_t localNumElements,
990  const Teuchos::RCP< const Teuchos::Comm< int > > &comm) {
991  XPETRA_MONITOR("MapFactory::Build");
992 
993 #ifdef HAVE_XPETRA_TPETRA
994  if (lib == UseTpetra)
995 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
996  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
997  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
998 #else
1000  "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");
1001 #endif
1002 #endif
1003 
1004  if (lib == UseEpetra)
1005  return MapFactory<int, GlobalOrdinal, Node>::createContigMapWithNode(lib, numElements, localNumElements, comm);
1006 
1008  }
1009 
1010 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
1011  TPETRA_DEPRECATED
1014  global_size_t numElements,
1015  size_t localNumElements,
1016  const Teuchos::RCP< const Teuchos::Comm< int > > &comm,
1017  const Teuchos::RCP<Node> & /* node */ )
1018  {
1019  return createContigMapWithNode(lib, numElements, localNumElements, comm);
1020  }
1021 #endif // TPETRA_ENABLE_DEPRECATED_CODE
1024  global_size_t numElements,
1025  size_t localNumElements,
1026  const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
1027  {
1028  XPETRA_MONITOR("MapFactory::Build");
1029 
1030 #ifdef HAVE_XPETRA_TPETRA
1031  if (lib == UseTpetra)
1032 #if ((defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1033  (!defined(EPETRA_HAVE_OMP) && (defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1034  return rcp( new TpetraMap<LocalOrdinal,GlobalOrdinal, Node> (Tpetra::createContigMapWithNode<int,GlobalOrdinal,Node>(numElements, localNumElements, comm)));
1035 #else
1037  "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");
1038 #endif
1039 #endif
1040 
1041  if (lib == UseEpetra) {
1043  map = Teuchos::rcp( new EpetraMapT<long long, Node>(numElements,localNumElements,
1044  0, // index base is zero
1045  comm) );
1046  return map.getConst();
1047  }
1048 
1050  }
1051 
1052  };
1053 #endif
1054 
1055 }
1056 
1057 #define XPETRA_MAPFACTORY_SHORT
1058 #endif
1059 //TODO: removed unused methods
RCP< const T > getConst() const
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
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.
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)
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
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)
Create a (potentially) non-uniform, contiguous Map with a user-specified node.
static Teuchos::RCP< Map< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, LocalOrdinal numDofPerNode)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
MapFactory()
Private constructor. This is a static class.
Exception throws to report errors in the internal logical of the program.
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
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)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
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)
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.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a uniform, contiguous Map with a user-specified node.
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)
Map constructor with user-defined non-contiguous (arbitrary) distribution.
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.
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)
Map constructor with a user-defined contiguous distribution.
MapFactory()
Private constructor. This is a static class.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMap(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
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)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Create a locally replicated Map with a specified node.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(UnderlyingLib lib, size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
#define XPETRA_FACTORY_END
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)
size_t global_size_t
Global size_t object.
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)
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)
Create an Xpetra::Map instance.
static Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMap(UnderlyingLib lib, global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
#define XPETRA_MONITOR(funcName)
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)
Map constructor with Xpetra-defined contiguous uniform distribution.
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)
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)
bool is_null() const
MapFactory()
Private constructor. This is a static class.