Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
Map_decl.hpp
1#ifndef MAP_DECL_hpp
2#define MAP_DECL_hpp
3
4#include "feddlib/core/FEDDCore.hpp"
5#include "feddlib/core/General/DefaultTypeDefs.hpp"
6
7#include <Xpetra_MapFactory.hpp>
8#include <Xpetra_MultiVectorFactory.hpp>
9#include <Xpetra_VectorFactory.hpp>
10#include <Xpetra_ExportFactory.hpp>
11#include <Xpetra_ImportFactory.hpp>
12#include <Teuchos_VerboseObject.hpp>
13#include <Xpetra_ThyraUtils.hpp>
14#include <Thyra_VectorSpaceBase_decl.hpp>
15
16#include <Tpetra_Map.hpp>
17#include <Tpetra_MultiVector.hpp>
18#include <Tpetra_Vector.hpp>
19#include <Tpetra_Export.hpp>
20#include <Tpetra_Import.hpp>
21#include <Thyra_TpetraThyraWrappers.hpp>
22#include <Thyra_TpetraVector.hpp>
23#include <Thyra_TpetraMultiVector.hpp>
24#include <Thyra_TpetraVectorSpace.hpp>
33
34namespace FEDD {
35template < class LO = default_lo, class GO = default_go, class NO = default_no>
36class Map {
37
38public:
39
40 typedef Map<LO,GO,NO> Map_Type;
41 typedef Teuchos::RCP<Map_Type> MapPtr_Type;
42 typedef Teuchos::RCP<const Map_Type> MapConstPtr_Type;
43
44 typedef Tpetra::Map<LO,GO,NO> TpetraMap_Type;
45 typedef Teuchos::RCP<TpetraMap_Type> TpetraMapPtr_Type;
46 typedef Teuchos::RCP<const TpetraMap_Type> TpetraMapConstPtr_Type;
47 typedef const TpetraMapConstPtr_Type TpetraMapConstPtrConst_Type;
48
49 typedef Xpetra::Map<LO,GO,NO> XpetraMap_Type;
50 typedef Teuchos::RCP<XpetraMap_Type> XpetraMapPtr_Type;
51 typedef Teuchos::RCP<const XpetraMap_Type> XpetraMapConstPtr_Type;
52 typedef const XpetraMapConstPtr_Type XpetraMapConstPtrConst_Type;
53
54 typedef Thyra::VectorSpaceBase<default_sc> ThyraVSB_Type;
55 typedef Teuchos::RCP<ThyraVSB_Type> ThyraVSBPtr_Type;
56 typedef Teuchos::RCP<const ThyraVSB_Type> ThyraVSBConstPtr_Type;
57
58 typedef Teuchos::Comm<int> Comm_Type;
59 typedef Teuchos::RCP<Comm_Type> CommPtr_Type;
60 typedef Teuchos::RCP<const Comm_Type> CommConstPtr_Type;
61
62 Map();
63
64 Map( const TpetraMapConstPtr_Type& tpetraMatPtrIn );
65
66 Map( const Map_Type& mapIn );
67
68 Map(GO numGlobalElements,
69 const Teuchos::ArrayView<const GO> &elementList,
70 GO indexBase,
71 const CommConstPtr_Type &comm);
72
73 Map(GO numGlobalElements,
74 LO numLocalElements,
75 GO indexBase,
76 const CommConstPtr_Type &comm);
77
78
79 ~Map();
80
81 LO getNodeNumElements() const;
82
83 GO getGlobalNumElements() const;
84
85 GO getGlobalElement(LO id) const;
86
87 LO getLocalElement(GO id) const;
88
89 CommConstPtr_Type getComm() const;
90
91 Teuchos::ArrayView<const GO> getNodeElementList() const;
92
93 GO getIndexBase() const;
94
95 std::string getUnderlyingLib( ) const;
96
97 MapPtr_Type buildVecFieldMap(UN numDofs, std::string ordering="NodeWise") const;
98
99 TpetraMapConstPtr_Type getTpetraMap() const;
100
101 XpetraMapConstPtr_Type getXpetraMap();
102
103 GO getMaxAllGlobalIndex() const;
104
105 LO getMaxLocalIndex() const;
106
107 void print(Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_EXTREME) const;
108
109 ThyraVSBConstPtr_Type getThyraVectorSpaceBase() const;
110
111 CommPtr_Type getCommNonConst();
112
116 Teuchos::RCP<Map<LO,GO,NO> > buildUniqueMap( int numFreeProcs=0 ) const;
117
118 Teuchos::RCP<Map<LO,GO,NO> > buildUniqueMap( tuple_intint_Type rankRange ) const;
119
120
121private:
122
123 TpetraMapConstPtr_Type map_;
124 XpetraMapConstPtr_Type mapX_;
125
126};
127}
128
129#endif
Teuchos::RCP< Map< LO, GO, NO > > buildUniqueMap(int numFreeProcs=0) const
Definition Map_def.hpp:180
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5