]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a function that allows to generate a sparse matrix only using m,n,n_nonzero_per_r...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Oct 2008 04:04:41 +0000 (04:04 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Oct 2008 04:04:41 +0000 (04:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@17318 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/trilinos_sparse_matrix.h
deal.II/lac/source/trilinos_sparse_matrix.cc

index 2bf080ecf02ea87e0919a2ac75a7c481a10d8f2e..6520591907e89b2f5a4b1dcc8e52bad9a392da11 100755 (executable)
@@ -446,6 +446,21 @@ namespace TrilinosWrappers
                    const Epetra_Map                &InputColMap,
                    const std::vector<unsigned int> &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
index 36a3844dfd622724105600379dba20476264697b..05e261a633cc604f0f52a43707b2d81118c1fd42 100755 (executable)
@@ -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<Epetra_FECrsMatrix>
+                               (new Epetra_FECrsMatrix(Copy, row_map, col_map, 
+                                       int(n_max_entries_per_row), false)))
+  {}
+
   SparseMatrix::SparseMatrix (const SparseMatrix &InputMatrix)
                  :
                   Subscriptor(),

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.