Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_MapExtractorFactory.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef XPETRA_MAPEXTRACTORFACTORY_HPP_
11 #define XPETRA_MAPEXTRACTORFACTORY_HPP_
12 
13 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
14 
15 #include <Xpetra_MapExtractor.hpp>
16 
17 namespace Xpetra {
18 
19 // factory class
20 template <class Scalar,
21  class LocalOrdinal,
22  class GlobalOrdinal,
23  class Node>
25 #undef XPETRA_MAPEXTRACTORFACTORY_SHORT
26 #include "Xpetra_UseShortNames.hpp"
27 
28  private:
30  MapExtractorFactory() = delete;
31 
32  public:
38  static Teuchos::RCP<Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
39  Build(const Teuchos::RCP<const Map>& fullmap,
40  const std::vector<Teuchos::RCP<const Map>>& maps,
41  bool bThyraMode = false) {
42  return rcp(new Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node>(fullmap, maps, bThyraMode));
43  }
44 
50  static Teuchos::RCP<Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
51  Build(const Teuchos::RCP<const Xpetra::BlockedMap<LocalOrdinal, GlobalOrdinal, Node>>& blockedMap) {
52  return rcp(new MapExtractor(blockedMap));
53  }
54 };
55 
56 } // namespace Xpetra
57 
58 #define XPETRA_MAPEXTRACTORFACTORY_SHORT
59 #endif /* XPETRA_MAPEXTRACTORFACTORY_HPP_ */
static Teuchos::RCP< Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map > &fullmap, const std::vector< Teuchos::RCP< const Map >> &maps, bool bThyraMode=false)
Build MapExtrasctor from a given set of partial maps.
static Teuchos::RCP< Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Xpetra::BlockedMap< LocalOrdinal, GlobalOrdinal, Node >> &blockedMap)
Build MapExtrasctor from a given BlockedMap.
MapExtractorFactory()=delete
Private construtor, since this is a static class.