* 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.
/**
* 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,
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 ());
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);