constraining dofs across distributed mesh

53 views
Skip to first unread message

Reza Rastak

unread,
Jul 10, 2019, 8:48:22 PM7/10/19
to deal.II User Group

Hi,


I like to link all the dofs of all the nodes along an edge of the body together. So I find the first dof (dof i) located on the edge and then I try to link all the dofs on that edge (except i) to dof i. It does not work if I have sufficiently large number of processes where that edge is chopped by different MPI processes. I know why it does not work, but I don't know any methods that can provide my desired dof constraints. Anyone has attempted to solve something similar?


This is the error that I get with 8 MPI processes.

--------------------------------------------------------

An error occurred in line <1607> of file </opt/local/dealii-9/deal.II-v9.0.1/include/deal.II/lac/constraint_matrix.h> in function

    void dealii::ConstraintMatrix::add_entry(dealii::ConstraintMatrix::size_type, dealii::ConstraintMatrix::size_type, double)

The violated condition was: 

    !local_lines.size() || local_lines.is_element(column)

Additional information: 

    The index set given to this constraint matrix indicates constraints using degree of freedom 580 should not be stored by this object, but a constraint for degree of freedom 736 uses it.

--------------------------------------------------------


Regards,


Reza


Daniel Arndt

unread,
Jul 10, 2019, 10:24:47 PM7/10/19
to dea...@googlegroups.com
Reza,

What exactly do you mean by "link all the dofs of all the nodes along an edge of the body together"?
From the error message above, I assume that you want to identify certain degrees of freedom via a ConstraintMatrix (or AffineConstraints) object.
That is basically what DoFTools::make_periodicity_constraints is doing as well. Are you trying to do something similar?
In any way, you need to make sure that the ConstraintMatrix (or AffineConstraints) object can store all the degrees of freedom you want to constrain.
This is normally the set of locally relevant degrees and freedoms and the reason why you normally do

constraints.reinit (locally_relevant_dofs);

In your case, you need to make sure that you extend this IndexSet by the degrees of freedom you want to constrain. Furthermore, all processes need to know about all
the constraints related to these constraints. There is AffineConstraints::is_consistent_in_parallel (https://www.dealii.org/current/doxygen/deal.II/classAffineConstraints.html#ad5fb8d3ca686a76ba33eb82d7f52b5fd)
that checks that this is the case. Of course, you need to pass the modified IndexSet there as well instead of just the 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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/31e7aedd-b087-41d4-a412-0e211bcb27bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reza Rastak

unread,
Jul 10, 2019, 11:09:51 PM7/10/19
to deal.II User Group
Thank you Daniel,

I think the way I described the question was a little vague, so I like to clarify it. Consider the simplified mesh (shown below) with 30 cells, 42 vertices, and 42 dofs. My desired constraint specifies that all the dofs corresponding to the vertices on the right edge must have the same value. So if I call the unknown field 'u', then I like to enforce u6 = u13 = u20 = u27 = u34 = u41. In my current code, I do something similar to:

constraint_matrix.reinit(locally_relevant_dofs);
constraint_matrix.add_entry(34, 41, 1.0); 
constraint_matrix.add_entry(27, 41, 1.0); 
constraint_matrix.add_entry(20, 41, 1.0); 
constraint_matrix.add_entry(13, 41, 1.0); 
constraint_matrix.add_entry(6, 41, 1.0); 

It works in the serial case. However, it doesn't work when I use multiple MPI processes. For my actual mesh, it breaks when n_processes >= 5. Basically I have to make sure that dof 41 is included in the relevant dofs of all the processes. How to I do that? I think this type of constraint is different than a periodic boundary condition and I could not find a dedicated function that takes care of it.

Thanks,
Reza


To unsubscribe from this group and stop receiving emails from it, send an email to dea...@googlegroups.com.

Reza Rastak

unread,
Jul 10, 2019, 11:12:36 PM7/10/19
to deal.II User Group
The picture I mentioned can we viewed at this link.


Reza

Daniel Arndt

unread,
Jul 10, 2019, 11:42:51 PM7/10/19
to deal.II User Group

[...]
It works in the serial case. However, it doesn't work when I use multiple MPI processes. For my actual mesh, it breaks when n_processes >= 5. Basically I have to make sure that dof 41 is included in the relevant dofs of all the processes. How to I do that? I think this type of constraint is different than a periodic boundary condition and I could not find a dedicated function that takes care of it.
No, there is no function for that. It would of course be pretty simple if you just knew the value all these dofsshould be set to, but I assume that's not the case.

I didn't mean to say that you have to modify the locally relevant dofs, i.e. the IndexSet you obtain from DoFtools::locally_relevant_dofs, but tha tyou need to use an extended IndexSet in all the places you would normally use that IndexSet.
There is IndexSet::add_index that you can use to add entries to an existing IndexSet object.

Best,
Daniel

Reza Rastak

unread,
Aug 5, 2019, 6:06:44 PM8/5/19
to deal.II User Group
Thank you Danial for the explanation. I used the IndexSet::add_index() method and its seems to be working so far.

Reza
Reply all
Reply to author
Forward
0 new messages