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 EPETRA_LIB_DLL_EXPORT PackAndPrepareWithOwningPIDs(
71  const Epetra_CrsMatrix & SourceMatrix,
72  int NumExportIDs,
73  int * ExportLIDs,
74  int & LenExports,
75  char *& Exports,
76  int & SizeOfPacket,
77  int * Sizes,
78  bool & VarSizes,
79  std::vector<int>& SourcePids);
80 
81 // ===================================================================
83 
87 int EPETRA_LIB_DLL_EXPORT UnpackWithOwningPIDsCount(
88  const Epetra_CrsMatrix& SourceMatrix,
89  int NumSameIDs,
90  int NumRemoteIDs,
91  const int * RemoteLIDs,
92  int NumPermuteIDs,
93  const int *PermuteToLIDs,
94  const int *PermuteFromLIDs,
95  int LenImports,
96  char* Imports);
97 
98 // ===================================================================
100 
110 int EPETRA_LIB_DLL_EXPORT UnpackAndCombineIntoCrsArrays(
111  const Epetra_CrsMatrix& SourceMatrix,
112  int NumSameIDs,
113  int NumRemoteIDs,
114  const int * RemoteLIDs,
115  int NumPermuteIDs,
116  const int *PermuteToLIDs,
117  const int *PermuteFromLIDs,
118  int LenImports,
119  char* Imports,
120  int TargetNumRows,
121  int TargetNumNonzeros,
122  int MyTargetPID,
123  int * CSR_rowptr,
124  int * CSR_colind,
125  double * CSR_values,
126  const std::vector<int> &SourcePids,
127  std::vector<int> &TargetPids);
128 // ===================================================================
130 
140 int EPETRA_LIB_DLL_EXPORT UnpackAndCombineIntoCrsArrays(
141  const Epetra_CrsMatrix& SourceMatrix,
142  int NumSameIDs,
143  int NumRemoteIDs,
144  const int * RemoteLIDs,
145  int NumPermuteIDs,
146  const int *PermuteToLIDs,
147  const int *PermuteFromLIDs,
148  int LenImports,
149  char* Imports,
150  int TargetNumRows,
151  int TargetNumNonzeros,
152  int MyTargetPID,
153  int * CSR_rowptr,
154  long long * CSR_colind,
155  double * CSR_values,
156  const std::vector<int> &SourcePids,
157  std::vector<int> &TargetPids);
158 
159 
160 
161 // ===================================================================
163 
172 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
173 int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind, const Epetra_Map& domainMap,
174  const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor,
175  std::vector<int>& RemotePIDs, Epetra_BlockMap & NewColMap);
176 #endif
177 // ===================================================================
179 
188 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
189 int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind_LID, long long *colind_GID, const Epetra_Map& domainMap,
190  const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor, std::vector<int>& RemotePIDs, Epetra_BlockMap & NewColMap);
191 #endif
192 
193 } /* Epetra_Import_Util namespace */
194 
195 #endif /* EPETRA_IMPORT_UTIL_H */
Epetra_Map: A class for partitioning vectors and matrices.
Definition: Epetra_Map.h:119
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 PackAndPrepareWithOwningPIDs(const Epetra_CrsMatrix &SourceMatrix, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, std::vector< int > &SourcePids)
PackAndPrepareWithOwningPIDs.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements...
Definition: Epetra_Import.h:63
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...