Hello Daniel,

Thank you so much for pointing this out. I have been stuck here for a long 
time and could not figure out. 

I understood that the sparsity pattern class was some how failing to know 
that space needs to be allocated for coupling with *the_dof even though it 
was not locally relevant dof.*
But again, I was under the impression that since the constraintMatrix 
object is passed to it, it should now which dofs are coupled and which are 
not.

I tried to understand whether they work on the same index set by looking at 
the source code of ConstraintMatrix::add_entries_local_to_global to 
generate sparsity pattern.
https://github.com/dealii/dealii/blob/c2df3112da1f688721750d7b206b0ad25bdad10f/include/deal.II/lac/constraint_matrix.templates.h
 

Here is a suggestion, that I think might be helpful in debugging such 
errors.

When constraint matrix object was initialized only with locally relevant 
dofs and had no knowledge of *the_dof, *an assert was triggered which 
helped me understand the error.
By looking at the source code where the assert was triggered, I was able to 
add *the_dof* to the locally relevant IndexSet  to initialize constraint 
Matrix.

I think  it would be much more clear if such an Assert / Assert Throw is 
 placed somewhere in the Sparsity pattern class. This way one can make sure 
that error is not coming while assembling (doing cell->get_dof_indices()) 
or from any other source. More over, if such an issue arises, the error 
will be reported right away while generating sparsity pattern.

For example: Such an assert is triggered if two constraints are merged when 
they are initialized with different index sets.
So, should the index sets of two objects -- constraints and sparsity 
pattern -- not be compared when making a sparsity pattern?

I again would like to thank you for pointing out the error. I really 
appreciate your help.



On Thursday, April 20, 2017 at 9:16:57 AM UTC-4, Daniel Arndt wrote:
>
> Rajat,
>
> It seems that I confused lines and did not express in the code what I 
> wrote above:
> You have to add that additional index also when initializing the sparsity 
> pattern, i.e.
>   std::cout << " constraints printed " <<std::endl;
>   DynamicSparsityPattern dsp (locally_relevant_dofs);
> should become
>   std::cout << " constraints printed " <<std::endl;
>   locally_relevant_dofs.add_index(the_dof);
>   DynamicSparsityPattern dsp (locally_relevant_dofs);
>
> Best,
> Daniel
>

-- 
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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to