Epetra Package Browser (Single Doxygen Collection) Development
Epetra_Import_Util.h
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 // 
00005 //               Epetra: Linear Algebra Services Package 
00006 //                 Copyright 2011 Sandia Corporation
00007 // 
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00039 // 
00040 // ************************************************************************
00041 //@HEADER
00042 */
00043 
00044 #ifndef EPETRA_IMPORT_UTIL_H
00045 #define EPETRA_IMPORT_UTIL_H
00046 
00047 #include "Epetra_ConfigDefs.h"
00048 #include "Epetra_Object.h"
00049 #include "Epetra_CrsMatrix.h"
00050 #include <vector>
00051 class Epetra_Map;
00052 class Epetra_CrsMatrix;
00053 class Epetra_Import;
00054 
00056 
00061 namespace Epetra_Import_Util { 
00062 
00063 //=========================================================================
00065 
00070 int PackAndPrepareWithOwningPIDs(const Epetra_CrsMatrix & SourceMatrix, 
00071          int NumExportIDs,
00072          int * ExportLIDs,
00073          int & LenExports,
00074          char *& Exports,
00075          int & SizeOfPacket,
00076          int * Sizes,
00077          bool & VarSizes,
00078          std::vector<int>& SourcePids);
00079 
00080 // ===================================================================
00082 
00086 int UnpackWithOwningPIDsCount(const Epetra_CrsMatrix& SourceMatrix, 
00087             int NumSameIDs,
00088             int NumRemoteIDs,
00089             const int * RemoteLIDs,
00090             int NumPermuteIDs,
00091             const int *PermuteToLIDs,
00092             const int *PermuteFromLIDs,
00093             int LenImports,
00094             char* Imports);
00095 
00096 // ===================================================================
00098 
00108 int UnpackAndCombineIntoCrsArrays(const Epetra_CrsMatrix& SourceMatrix, 
00109           int NumSameIDs,
00110           int NumRemoteIDs,
00111           const int * RemoteLIDs,
00112           int NumPermuteIDs,
00113           const int *PermuteToLIDs,
00114           const int *PermuteFromLIDs,
00115           int LenImports,
00116           char* Imports,
00117           int TargetNumRows,
00118           int TargetNumNonzeros,
00119           int MyTargetPID,
00120           int * CSR_rowptr,
00121           int * CSR_colind,
00122           double * CSR_values,
00123           const std::vector<int> &SourcePids,
00124           std::vector<int> &TargetPids);
00125 // ===================================================================
00127 
00137 int UnpackAndCombineIntoCrsArrays(const Epetra_CrsMatrix& SourceMatrix, 
00138           int NumSameIDs,
00139           int NumRemoteIDs,
00140           const int * RemoteLIDs,
00141           int NumPermuteIDs,
00142           const int *PermuteToLIDs,
00143           const int *PermuteFromLIDs,
00144           int LenImports,
00145           char* Imports,
00146           int TargetNumRows,
00147           int TargetNumNonzeros,
00148           int MyTargetPID,
00149           int * CSR_rowptr,
00150           long long * CSR_colind,
00151           double * CSR_values,
00152           const std::vector<int> &SourcePids,
00153           std::vector<int> &TargetPids);
00154 
00155 
00156 
00157 // ===================================================================
00159 
00168 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00169 int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind, const Epetra_Map& domainMap, 
00170            const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor, 
00171            std::vector<int>& RemotePIDs, Epetra_BlockMap & NewColMap);
00172 #endif 
00173 // ===================================================================
00175 
00184 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
00185 int LowCommunicationMakeColMapAndReindex(int N, const int *rowptr, int *colind_LID, long long *colind_GID, const Epetra_Map& domainMap, 
00186            const int *owningPIDs, bool SortGhostsAssociatedWithEachProcessor, std::vector<int>& RemotePIDs, Epetra_BlockMap & NewColMap);
00187 #endif
00188 
00189 } /* Epetra_Import_Util namespace */
00190 
00191 #endif /* EPETRA_IMPORT_UTIL_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines