<h3>Specific improvements</h3>
<ol>
+ <li>
+ Fixed: Under some circumstances (see http://code.google.com/p/dealii/issues/detail?id=82)
+ the DoFTools::make_periodicity_constraints() function could create cycles in
+ the ConstraintMatrix object. This is now fixed.
+ <br>
+ (David Emerson, Wolfgang Bangerth, 2013/08/16)
+ </li>
+
+ <li>
+ New: There is now a function ConstraintMatrix::are_identity_constrained().
+ <br>
+ (Wolfgang Bangerth, 2013/08/16)
+ </li>
+
<li>
New: TableHandler::write_text() now also supports output in
org-mode (http://orgmode.org/) format via a new entry in the
*/
bool is_identity_constrained (const size_type index) const;
+ /**
+ * Return whether the two given degrees of freedom are linked by an
+ * equality constraint that either constrains index1 to be so that
+ * <code>index1=index2</code> or constrains index2 so that
+ * <code>index2=index1</code>.
+ */
+ bool are_identity_constrained (const size_type index1,
+ const size_type index2) const;
+
/**
* Return the maximum number of other
* dofs that one dof is constrained
}
+bool ConstraintMatrix::are_identity_constrained (const size_type index1,
+ const size_type index2) const
+{
+ if (is_constrained(index1) == true)
+ {
+ const ConstraintLine &p = lines[lines_cache[calculate_line_index(index1)]];
+ Assert (p.line == index1, ExcInternalError());
+
+ // return if an entry for this line was found and if it has only one
+ // entry equal to 1.0 and that one is index2
+ return ((p.entries.size() == 1) &&
+ (p.entries[0].first == index2) &&
+ (p.entries[0].second == 1.0));
+ }
+ else if (is_constrained(index2) == true)
+ {
+ const ConstraintLine &p = lines[lines_cache[calculate_line_index(index2)]];
+ Assert (p.line == index2, ExcInternalError());
+
+ // return if an entry for this line was found and if it has only one
+ // entry equal to 1.0 and that one is index1
+ return ((p.entries.size() == 1) &&
+ (p.entries[0].first == index1) &&
+ (p.entries[0].second == 1.0));
+ }
+ else
+ return false;
+}
+
+
ConstraintMatrix::size_type
ConstraintMatrix::max_constraint_indirections () const