00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _ispatest_epetra_test_utils_hpp_
00031 #define _ispatest_epetra_test_utils_hpp_
00032
00033 #include <Isorropia_ConfigDefs.hpp>
00034 #include <string>
00035 #include <vector>
00036 #include <ostream>
00037
00038 #ifdef HAVE_EPETRA
00039
00040 class Epetra_CrsGraph;
00041 class Epetra_RowMatrix;
00042 class Epetra_LinearProblem;
00043 class Epetra_CrsMatrix;
00044 class Epetra_MultiVector;
00045 class Epetra_Map;
00046 class Epetra_BlockMap;
00047 class Epetra_Comm;
00048
00049 namespace ispatest {
00050
00057 int fill_matrix(Epetra_CrsMatrix& matrix,
00058 int numNonzerosPerRow,
00059 bool verbose);
00060
00066 int fill_graph(Epetra_CrsGraph& graph,
00067 int numNonzerosPerRow,
00068 bool verbose);
00069
00081 bool test_matrix_vector_multiply(Epetra_CrsMatrix &A);
00082
00092 bool test_row_matrix_vector_multiply(Epetra_RowMatrix &R);
00093
00105 bool test_matrix_vector_multiply(Epetra_CrsGraph &G);
00106
00121 bool test_matrix_vector_multiply(Epetra_LinearProblem &LP);
00122
00128 Epetra_Map *map_from_blockmap(const Epetra_BlockMap &b);
00129
00142 int readCoordFile(const std::string &fname,
00143 std::vector<double> &x, std::vector<double> &y, std::vector<double> &z);
00144
00152 Epetra_MultiVector *makeWeights(const Epetra_BlockMap &map, double (*wFunc)(const int, const int, const int, const int));
00153
00156 double unitWeights(const int id, const int me, const int nids, const int nprocs);
00157
00161 double veeWeights(const int id, const int me, const int nids, const int nprocs);
00162
00165 double alternateWeights(const int id, const int me, const int nids, const int nprocs);
00166
00170 Epetra_MultiVector *file2multivector(const Epetra_Comm &comm, const std::string &fname);
00171
00175 int printMultiVector(const Epetra_MultiVector mv, std::ostream &os,
00176 const char *s, int max=1000);
00177
00178 }
00179
00180 #endif //HAVE_EPETRA
00181
00182 #endif
00183