]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Small updates.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 31 Jan 2000 16:30:46 +0000 (16:30 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 31 Jan 2000 16:30:46 +0000 (16:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@2297 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_vanka.h
deal.II/lac/include/lac/sparse_vanka.templates.h

index 1793b35563dd89dee93f29df59027f881512577c..9facd46b5d9a7e6ab82a66f9a822b8789579c5a7 100644 (file)
@@ -148,10 +148,19 @@ class SparseVanka
                                      * preconditioning are used. This
                                      * may lead to different results,
                                      * obviously, of #M# changes.
+                                     *
+                                     * The parameter #n_threads#
+                                     * determines how many threads
+                                     * shall be used in parallel when
+                                     * building the inverses of the
+                                     * diagonal blocks. This
+                                     * parameter is ignored if not in
+                                     * multithreaded mode.
                                      */
     SparseVanka(const SparseMatrix<number> &M,
                const vector<bool>         &selected,
-               const bool                  conserve_memory = false);
+               const bool                  conserve_memory = false,
+               const unsigned int          n_threads       = 1);
     
                                     /**
                                      * Destructor.
@@ -189,7 +198,15 @@ class SparseVanka
                                     /**
                                      * Conserve memory flag.
                                      */
-    bool conserve_mem;
+    const bool conserve_mem;
+
+                                    /**
+                                     * Number of threads to be used
+                                     * when building the
+                                     * inverses. Only relevant in
+                                     * multithread mode.
+                                     */
+    const unsigned int n_threads;
     
                                     /**
                                      * Array of inverse matrices,
index 02d4e00099841c505a2dd4cf6444503a049d7fb0..d074beb7e546d5713da7f307a1594d4f77165fd1 100644 (file)
 template<typename number>
 SparseVanka<number>::SparseVanka(const SparseMatrix<number> &M,
                                 const vector<bool>         &selected,
-                                const bool                  conserve_mem)
+                                const bool                  conserve_mem,
+                                const unsigned int          n_threads)
                :
-               matrix(&M),
-               selected(selected),
-               conserve_mem(conserve_mem),
-               inverses(M.m(),0)
+               matrix (&M),
+               selected (selected),
+               n_threads (n_threads),
+               conserve_mem (conserve_mem),
+               inverses (M.m(), 0)
 {
   Assert (M.m() == M.n(),
          ExcMatrixNotSquare ());
@@ -52,7 +54,6 @@ void
 SparseVanka<number>::compute_inverses () 
 {
 #ifdef DEAL_II_USE_MT
-  const unsigned int n_threads  = 4;
   const unsigned int n_inverses = count (selected.begin(),
                                         selected.end(),
                                         true);

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.