* However, this behavior can be changed by providing a different value for
* the second argument.
*
- * If both this object and the object given as argument are initialized with
- * an IndexSet object, local_lines is set to the union of these IndexSet
- * objects.
+ * By default, merging two ConstraintMatrix objects that are initialized
+ * with different IndexSet objects is not allowed.
+ * This behavior can be altered by setting @p allow_different_local_lines
+ * appropriately.
*
* Merging a ConstraintMatrix that is initialized with an IndexSet
* and one that is not initialized with an IndexSet is not yet implemented.
*/
void merge (const ConstraintMatrix &other_constraints,
- const MergeConflictBehavior merge_conflict_behavior = no_conflicts_allowed);
+ const MergeConflictBehavior merge_conflict_behavior = no_conflicts_allowed,
+ const bool allow_different_local_lines = false);
/**
* Shift all entries of this matrix down @p offset rows and over @p offset
void
ConstraintMatrix::merge (const ConstraintMatrix &other_constraints,
- const MergeConflictBehavior merge_conflict_behavior)
+ const MergeConflictBehavior merge_conflict_behavior,
+ const bool allow_different_local_lines)
{
+ (void) allow_different_local_lines;
+ Assert(allow_different_local_lines ||
+ local_lines == other_constraints.local_lines,
+ ExcMessage("local_lines for this and the other objects are not the same "
+ "although allow_different_local_lines is false."));
+
// store the previous state with respect to sorting
const bool object_was_sorted = sorted;
sorted = false;
// now merge the two and print the
// results
- c1.merge (c2);
+ c1.merge (c2, ConstraintMatrix::no_conflicts_allowed, true);
c1.print(deallog.get_file_stream());
};
}