W.,
Ah okay I see, I will try that in my program and let you know.
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() );
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);
On Tuesday, January 5, 2021 at 12:12:06 PM UTC-6 Wolfgang Bangerth wrote:
> On 1/5/21 8:21 AM, Zachary Streeter wrote:
> > Let me know if this is okay. This compiled, ran, and produced the same
> error
> > on my end.
>
> Yes, that's the sort of testcase that makes it easy to debug :-)
>
> In this call,
> m_H1.reinit(MPI_COMM_WORLD,
> a_local_row_set.size(),
> a_local_row_set.size(),
> a_local_row_set.n_elements(),
> a_local_row_set.size(),
> guess);
> the 'local_columns' given in the fifth argument also need to add up to the
> total number of columns. So if you change this to
> m_H1.reinit(MPI_COMM_WORLD,
> a_local_row_set.size(),
> a_local_row_set.size(),
> a_local_row_set.n_elements(),
> a_local_row_set.n_elements(),
> guess);
> then things run fine.
>
> That said, this specific function is deprecated:
>
> https://dealii.org/developer/doxygen/deal.II/classPETScWrappers_1_1MPI_1_1SparseMatrix.html#a645ab9f99494a47ebb6492e92e707130
> You will want to use the suggested alternative.
>
> 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/c27e2ee3-9387-4333-a5ce-28f3cbb7bd61n%40googlegroups.com.