Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AffineConstraints::constrain_dof_to_zero(). #16163

Merged
merged 3 commits into from Oct 23, 2023

Conversation

bangerth
Copy link
Member

I'm generally not a friend of introducing more member functions for convenience, but think that this may be an exception (that I'm happy to see debated): In a previous patch (#16103), I added AffineConstraints::add_constraint() that adds an entire constraint at once. But, in a substantial number of places, we call this as constraints.add_constraint(dof_index, {}, 0.), which means to constrain the DoF to zero, without dependencies. This is not wrong, and documented as saying exactly that, but it isn't entirely obvious to read. So this patch introduces AffineConstraints::constrain_to_zero(dof_index), which I think is easier to read. The patch then also converts all of the places in the library and the examples to call this function. The last commit also replaces some calls to our old API in the test suite by the new function.

Happy to debate the wisdom of the proposal :-)

In reference to #15375.

Copy link
Member

@marcfehling marcfehling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this addition as it improves code readability.

@drwells drwells merged commit bfca6bd into dealii:master Oct 23, 2023
15 checks passed
@drwells
Copy link
Member

drwells commented Oct 23, 2023

This is much easier to read - lets do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants