Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_Import_Util.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // Epetra: Linear Algebra Services Package
6 // Copyright 2011 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 Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ************************************************************************
41 //@HEADER
42 */
43 
44 #ifndef EPETRA_IMPORT_UTIL_H
45 #define EPETRA_IMPORT_UTIL_H
46 
47 #include "Epetra_ConfigDefs.h"
48 #include "Epetra_Object.h"
49 #include "Epetra_CrsMatrix.h"
50 #include <vector>
51 class Epetra_Map;
52 class Epetra_CrsMatrix;
53 class Epetra_Import;
54 
56 
61 namespace Epetra_Import_Util {
62 
63 //=========================================================================
65 
70 int PackAndPrepareWithOwningPIDs(const Epetra_CrsMatrix & SourceMatrix,
71  int NumExportIDs,
72  int * ExportLIDs,
73  int & LenExports,
74  char *& Exports,
75  int & SizeOfPacket,
76  int * Sizes,
77  bool & VarSizes,
78  std::vector<int>& SourcePids);
79 
80 // ===================================================================
82 
86 int UnpackWithOwningPIDsCount(const Epetra_CrsMatrix& SourceMatrix,
87  int NumSameIDs,
88  int NumRemoteIDs,
89  const int * RemoteLIDs,
90  int NumPermuteIDs,
91  const int *PermuteToLIDs,
92  const int *PermuteFromLIDs,
93  int LenImports,
94  char* Imports);
95 
96 // ===================================================================
98 
108 int UnpackAndCombineIntoCrsArrays(const Epetra_CrsMatrix& SourceMatrix,
109  int NumSameIDs,
110  int NumRemoteIDs,
111  const int * RemoteLIDs,
112  int NumPermuteIDs,
113  const int *PermuteToLIDs,
114  const int *PermuteFromLIDs,
115  int LenImports,
116  char* Imports,
117  int TargetNumRows,
118  int TargetNumNonzeros,
119  int MyTargetPID,
120  int * CSR_rowptr,
121  int * CSR_colind,
122  double * CSR_values,
123  const std::vector<int> &SourcePids,
124  std::vector<int> &TargetPids);
125 // ===================================================================
127 
137 int UnpackAndCombineIntoCrsArrays(const Epetra_CrsMatrix& SourceMatrix,
138  int NumSameIDs,
139  int NumRemoteIDs,
140  const int * RemoteLIDs,
141  int NumPermuteIDs,
142  const int *PermuteToLIDs,
143  const int *PermuteFromLIDs,
144  int LenImports,
145  char* Imports,
146  int TargetNumRows,
147  int TargetNumNonzeros,
148  int MyTargetPID,
149  int * CSR_rowptr,
150  long long * CSR_colind,
151  double * CSR_values,
152  const std::vector<int> &SourcePids,
153  std::vector<int> &TargetPids);
154 
155 
156 
157 // ===================================================================
159 
168 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
169 int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind, const Epetra_Map& domainMap,
170  const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor,
171  std::vector<int>& RemotePIDs, Epetra_BlockMap & NewColMap);
172 #endif
173 // ===================================================================
175 
184 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
185 int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind_LID, long long *colind_GID, const Epetra_Map& domainMap,
186  const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor, std::vector<int>& RemotePIDs, Epetra_BlockMap & NewColMap);
187 #endif
188 
189 } /* Epetra_Import_Util namespace */
190 
191 #endif /* EPETRA_IMPORT_UTIL_H */
Epetra_Map: A class for partitioning vectors and matrices.
Definition: Epetra_Map.h:119
Epetra_Import: This class builds an import object for efficient importing of off-processor elements...
Definition: Epetra_Import.h:63
int PackAndPrepareWithOwningPIDs(const Epetra_CrsMatrix &SourceMatrix, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, std::vector< int > &SourcePids)
PackAndPrepareWithOwningPIDs.
int UnpackWithOwningPIDsCount(const Epetra_CrsMatrix &SourceMatrix, int NumSameIDs, int NumRemoteIDs, const int *RemoteLIDs, int NumPermuteIDs, const int *PermuteToLIDs, const int *PermuteFromLIDs, int LenImports, char *Imports)
UnpackWithOwningPIDsCount.
int UnpackAndCombineIntoCrsArrays(const Epetra_CrsMatrix &SourceMatrix, int NumSameIDs, int NumRemoteIDs, const int *RemoteLIDs, int NumPermuteIDs, const int *PermuteToLIDs, const int *PermuteFromLIDs, int LenImports, char *Imports, int TargetNumRows, int TargetNumNonzeros, int MyTargetPID, int *CSR_rowptr, int *CSR_colind, double *CSR_values, const std::vector< int > &SourcePids, std::vector< int > &TargetPids)
UnpackAndCombineIntoCrsArrays.
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind, const Epetra_Map &domainMap, const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor, std::vector< int > &RemotePIDs, Epetra_BlockMap &NewColMap)
LowCommunicationMakeColMapAndReindex.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...