On 1/5/21 11:32 AM, Zachary Streeter wrote:
Yes, I want to use the constructor with the dynamic sparsity pattern. So with
your suggestion in mind, would that just be the following:
dealii::IndexSet local_owned(a_local_row_set.size());
local_owned.add_range(*a_local_row_set.begin(),
*a_local_row_set.begin() +
a_local_row_set.n_elements());
m_dynamic_sparsity_pattern.reinit(a_local_row_set.size(),
a_local_row_set.size(),
local_owned);
std::vector<size_type> local_rows_per_process(num_procs,
a_local_row_set.n_elements() );
This creates a vector of size num_procs in which all entries are equal to
a_local_row_set.n_elements(). But why would all processors have the same
number of rows? And are you sure that a_local_row_set.n_elements() is the same
number on all processors anyway?
std::vector<size_type> local_columns_per_process(num_procs,
a_local_row_set.n_elements() ); // before used a_local_row_set.size() here!
m_H1.reinit(MPI_COMM_WORLD, m_dynamic_sparsity_pattern,
local_rows_per_process, local_columns_per_process, my_proc);
I would try to stick with the fourth reinit() function here:
https://dealii.org/developer/doxygen/deal.II/classPETScWrappers_1_1MPI_1_1SparseMatrix.html#a645ab9f99494a47ebb6492e92e707130
It's the simplest to use because every processor only has to pass an IndexSet
object that describes which rows (and columns) it owns.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/d5d792d6-3c44-ccf4-903e-6825df57646e%40colostate.edu.