The script validate.sh should run this self test on 1, 2, 3 and 4 cores.
68 MPI_Helpers::init(argc,argv);
76 const unsigned my_rank = comm_pt->
my_rank();
77 const unsigned nproc = comm_pt->
nproc();
89 unsigned nrow_global_t1m1 = 5;
90 unsigned ncol_t1m1 = 5;
91 unsigned nnz_t1m1 = 9;
96 double val_array_t1m1[] = {1,2,3,4,5,6,7,8,9};
97 int col_i_array_t1m1[] = {0,1,0,2,3,4,0,1,4};
98 int row_s_array_t1m1[] = {0,2,4,6,9,9};
106 nrow_global_t1m1,ncol_t1m1,comm_pt,
107 val_t1m1,col_i_t1m1,row_s_t1m1,mat_t1m1);
109 std::ostringstream mat_t1m1_stream;
110 mat_t1m1_stream <<
"t1m1_NP"<<nproc<<
"R"<<my_rank;
116 std::ostringstream copy_of_mat_t1m1_stream;
117 copy_of_mat_t1m1_stream <<
"copy_of_t1m1_NP" << nproc <<
"R" << my_rank;
118 copy_of_mat_t1m1.sparse_indexed_output(copy_of_mat_t1m1_stream.str());
125 unsigned nrow_global_t2m1 = 3;
126 unsigned ncol_t2m1 = 6;
127 unsigned nnz_t2m1 = 18;
132 double val_array_t2m1[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18};
133 int col_i_array_t2m1[] = {0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5};
134 int row_s_array_t2m1[] = {0,6,12,18};
142 nrow_global_t2m1,ncol_t2m1,comm_pt,
143 val_t2m1,col_i_t2m1,row_s_t2m1,mat_t2m1);
145 std::ostringstream mat_t2m1_stream;
146 mat_t2m1_stream <<
"t2m1_NP"<<nproc<<
"R"<<my_rank;
152 std::ostringstream copy_of_mat_t2m1_stream;
153 copy_of_mat_t2m1_stream <<
"copy_of_t2m1_NP" << nproc <<
"R" << my_rank;
154 copy_of_mat_t2m1.sparse_indexed_output(copy_of_mat_t2m1_stream.str());
164 unsigned nrow_global_t3m1 = 6;
165 unsigned ncol_t3m1 = 3;
166 unsigned nnz_t3m1 = 18;
171 double val_array_t3m1[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18};
172 int col_i_array_t3m1[] = {0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2};
173 int row_s_array_t3m1[] = {0,3,6,9,12,15,18};
181 nrow_global_t3m1,ncol_t3m1,comm_pt,
182 val_t3m1,col_i_t3m1,row_s_t3m1,mat_t3m1);
184 std::ostringstream mat_t3m1_stream;
185 mat_t3m1_stream <<
"t3m1_NP"<<nproc<<
"R"<<my_rank;
191 std::ostringstream copy_of_mat_t3m1_stream;
192 copy_of_mat_t3m1_stream <<
"copy_of_t3m1_NP" << nproc <<
"R" << my_rank;
193 copy_of_mat_t3m1.sparse_indexed_output(copy_of_mat_t3m1_stream.str());
197 MPI_Helpers::finalize();
199 return(EXIT_SUCCESS);
Definition: matrices.h:888
void sparse_indexed_output(std::ostream &outfile, const unsigned &precision=0, const bool &output_bottom_right_zero=false) const
Definition: matrices.h:182
Definition: communicator.h:54
int my_rank() const
my rank
Definition: communicator.h:176
int nproc() const
number of processors
Definition: communicator.h:157
void construct_vector(const myType given_array[], const unsigned given_arraysize, Vector< myType > &result_vector)
Definition: crdoublematrix_copy_constructor.cc:35
void create_uniformly_distributed_matrix(const unsigned &nrow, const unsigned &ncol, const OomphCommunicator *const comm_pt, const Vector< double > &values, const Vector< int > &column_indices, const Vector< int > &row_start, CRDoubleMatrix &matrix_out)
Definition: matrices.cc:3676