queso-0.52.0
Map.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_MAP_H
26 #define UQ_MAP_H
27 
28 #include <queso/Defines.h>
29 #ifdef QUESO_HAS_TRILINOS
30 #include <Epetra_Map.h>
31 #endif
32 
33 #include <queso/MpiComm.h>
34 
35 namespace QUESO {
36 
49 class Map
50 {
51 public:
53 
54 
56  Map();
57 
59  Map(int numGlobalElements,
60  int indexBase,
61  const MpiComm& comm);
62 
64  Map(const Map& src);
65 
67  ~Map();
69 
71 
72  Map& operator= (const Map& rhs);
75 
76 
78 
79  int NumGlobalElements() const;
81 
84  int IndexBase () const;//1st position in the global processor in my processors
85 
87  int NumMyElements () const;
88 
90  int MinMyGID () const;
92 
94 
95  const MpiComm& Comm () const;
97 
98 #ifdef QUESO_HAS_TRILINOS
99  const Epetra_Map& epetraMap () const;
101 #endif
102 
104 private:
106  void copy (const Map& src);
107 
110 
111 #ifdef QUESO_HAS_TRILINOS
112  Epetra_Map* m_epetraMap;
114 #else
117 
120 
123 #endif
124 };
125 
126 } // End namespace QUESO
127 
128 #endif // UQ_MAP_H
int NumGlobalElements() const
Returns the total number of elements across all processors.
Definition: Map.C:96
~Map()
Destructor.
Definition: Map.C:74
int NumMyElements() const
Returns the number of elements owned by the calling processor.
Definition: Map.C:118
A class for partitioning vectors and matrices.
Definition: Map.h:49
Map & operator=(const Map &rhs)
Assignment operator.
Definition: Map.C:87
void copy(const Map &src)
Copies the map.
Definition: Map.C:157
The QUESO MPI Communicator Class.
Definition: MpiComm.h:75
int m_numMyElements
Number of elements owned by the calling processor.
Definition: Map.h:122
int m_indexBase
Base integer value for indexed array references.
Definition: Map.h:119
Map()
Default constructor. Do not call this directly.
Definition: Map.C:34
MpiComm m_MpiComm
This communicator can be queried for processor rank and size information.
Definition: Map.h:109
const MpiComm & Comm() const
Access function for MpiComm communicator.
Definition: Map.C:142
int IndexBase() const
Definition: Map.C:107
int m_numGlobalElements
Total number of elements across all processors.
Definition: Map.h:116
int MinMyGID() const
The minimum global index value on the calling processor.
Definition: Map.C:129

Generated on Thu Apr 23 2015 19:30:54 for queso-0.52.0 by  doxygen 1.8.5