From: bangerth Date: Thu, 23 Oct 2008 04:04:41 +0000 (+0000) Subject: Add a function that allows to generate a sparse matrix only using m,n,n_nonzero_per_r... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=075d8058408ae8157e9187810a1ab5d496660750;p=dealii-svn.git Add a function that allows to generate a sparse matrix only using m,n,n_nonzero_per_row, creating a local matrix. This allows to compile a bunch of testcases, but they abort right now. Will have to investigate later. git-svn-id: https://svn.dealii.org/trunk@17318 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/trilinos_sparse_matrix.h b/deal.II/lac/include/lac/trilinos_sparse_matrix.h index 2bf080ecf0..6520591907 100755 --- a/deal.II/lac/include/lac/trilinos_sparse_matrix.h +++ b/deal.II/lac/include/lac/trilinos_sparse_matrix.h @@ -446,6 +446,21 @@ namespace TrilinosWrappers const Epetra_Map &InputColMap, const std::vector &n_entries_per_row); + /** + * Generate a matrix that is completely + * stored locally, having #m rows and + * #n columns. The resulting matrix + * will be completely stored locally. + * + * The number of columns entries + * per row is specified as the + * maximum number of entries + * argument. + */ + SparseMatrix (const unsigned int m, + const unsigned int n, + const unsigned int n_max_entries_per_row); + /** * Copy constructor. Sets the * calling matrix to be the same diff --git a/deal.II/lac/source/trilinos_sparse_matrix.cc b/deal.II/lac/source/trilinos_sparse_matrix.cc index 36a3844dfd..05e261a633 100755 --- a/deal.II/lac/source/trilinos_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_sparse_matrix.cc @@ -149,6 +149,24 @@ namespace TrilinosWrappers false))) {} + SparseMatrix::SparseMatrix (const unsigned int m, + const unsigned int n, + const unsigned int n_max_entries_per_row) + : +#ifdef DEAL_II_COMPILER_SUPPORTS_MPI + row_map (m, 0, Epetra_MpiComm(MPI_COMM_WORLD)), + col_map (n, 0, Epetra_MpiComm(MPI_COMM_WORLD)), +#else + row_map (m, 0, Epetra_SerialComm()), + col_map (n, 0, Epetra_SerialComm()), +#endif + last_action (Zero), + compressed (true), + matrix (std::auto_ptr + (new Epetra_FECrsMatrix(Copy, row_map, col_map, + int(n_max_entries_per_row), false))) + {} + SparseMatrix::SparseMatrix (const SparseMatrix &InputMatrix) : Subscriptor(),