The picture I mentioned can we viewed at this link. https://ibb.co/1nrRvfr
Reza On Wednesday, July 10, 2019 at 8:09:51 PM UTC-7, Reza Rastak wrote: > > 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 > > > > > On Wednesday, July 10, 2019 at 7:24:47 PM UTC-7, Daniel Arndt wrote: >> >> 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 >> <https://www.dealii.org/9.0.0/doxygen/deal.II/classConstraintMatrix.html#ac2726821354883ac97fe7e6181de9792> >> >> (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 >> >> >> Am Mi., 10. Juli 2019 um 20:48 Uhr schrieb Reza Rastak < >> reza....@gmail.com>: >> >>> 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 >>> >>> >>> -- >>> 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 dea...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/dealii/31e7aedd-b087-41d4-a412-0e211bcb27bd%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/dealii/31e7aedd-b087-41d4-a412-0e211bcb27bd%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/a32eb37b-fe53-43b1-93bb-a52a0fafa1c5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.