I created IndexSets by using the function DoFTools::locally_owned_dofs_per_component() and then gathering all indices corresponding to displacement DoFs (three instances of IndexSet) into one IndexSet using IndexSet::add_indices() and the fourth instance correponded to electric potential DoFs. However, the function DoFTools::locally_owned_dofs_per_component() wasn't returning only locally owned DoFs but also the locally not owned ones. In the end I used the check locally_owned_dofs.is_element() to make sure I gather only locally owned DoFs for displacement and electric potential into my final IndexSets. The resulting IndexSets were always of size 2145.
I also tried first explicitly setting the sizes of the final IndexSets using IndexSet::set_size() function, but as said, I could not add indices larger than the size to these index sets (eg. id = 440 could not be added to the IndexSet of size 330). I didn't try the function IndexSet::split_by_block(), I didn't notice it in the dealii manual. I will try this one when I come back to the office, thank you for the suggestion! Best, Gabriel środa, 16 września 2020 o 19:52:50 UTC+2 Timo Heister napisał(a): > > This results in failed assertion, since: rows[0].size() = 2145, > rows[1].size() = 2145, but bdsp.block(0,0).n_rows() = 1815, > bdsp.block(1,1).n_rows() = 330 etc... > > The size() of each IndexSet needs to correspond to the size of each > block of the sparsity pattern and this is what the assertion checks. I > think that this check is correct. If you want your first block to be > 1815 DoFs large, then rows[0].size() needs to be 1815. > > How are you creating these IndexSets? I find the function > IndexSet::split_by_block() convenient to use. > > > -- > Timo Heister > http://www.math.clemson.edu/~heister/ > -- 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/7b6a254b-02d4-4339-b44b-716aca258292n%40googlegroups.com.
