queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 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(int numGlobalElements,
57  int indexBase,
58  const MpiComm& comm);
59 
61  Map(const Map& src);
62 
64  ~Map();
66 
68 
69  Map& operator= (const Map& rhs);
72 
73 
75 
76  int NumGlobalElements() const;
78 
81  int IndexBase () const;//1st position in the global processor in my processors
82 
84  int NumMyElements () const;
85 
87  int MinMyGID () const;
89 
91 
92  const MpiComm& Comm () const;
94 
95 #ifdef QUESO_HAS_TRILINOS
96  const Epetra_Map& epetraMap () const;
98 #endif
99 
101 private:
103  Map();
104 
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
Map & operator=(const Map &rhs)
Assignment operator.
Definition: Map.C:76
Epetra_Map * m_epetraMap
Epetra_Map.
Definition: Map.h:113
A class for partitioning vectors and matrices.
Definition: Map.h:49
const Epetra_Map & epetraMap() const
Trilinos Epetra_Map: A class for partitioning vectors and matrices.
Definition: Map.C:138
int MinMyGID() const
The minimum global index value on the calling processor.
Definition: Map.C:118
int m_numGlobalElements
Total number of elements across all processors.
Definition: Map.h:116
int m_numMyElements
Number of elements owned by the calling processor.
Definition: Map.h:122
int IndexBase() const
Definition: Map.C:96
MpiComm m_MpiComm
This communicator can be queried for processor rank and size information.
Definition: Map.h:109
~Map()
Destructor.
int NumGlobalElements() const
Returns the total number of elements across all processors.
Definition: Map.C:85
int m_indexBase
Base integer value for indexed array references.
Definition: Map.h:119
The QUESO MPI Communicator Class.
Definition: MpiComm.h:203
void copy(const Map &src)
Copies the map.
Definition: Map.C:146
int NumMyElements() const
Returns the number of elements owned by the calling processor.
Definition: Map.C:107
const MpiComm & Comm() const
Access function for MpiComm communicator.
Definition: Map.C:131
Map()
Default constructor. Do not call this directly.
Definition: Map.C:63

Generated on Tue Jun 5 2018 19:48:54 for queso-0.57.1 by  doxygen 1.8.5