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

MatrixFree: Simplify some code in initialization of DoF indices #13951

Merged
merged 1 commit into from Jun 29, 2022

Conversation

kronbichler
Copy link
Member

@kronbichler kronbichler commented Jun 10, 2022

This PR moves some code that exists in both an if and else branch out of the condition. Furthermore, to detect the constrained DoFs kept in an AffineConstraints we can simply go through the lines of the object, rather than checking all DoFs.

@@ -1291,10 +1288,12 @@ namespace internal

for (unsigned int no = 0; no < n_dof_handlers; ++no)
{
const DoFHandler<dim> *dofh = &*dof_handler[no];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const DoFHandler<dim> *dofh = &*dof_handler[no];
const auto dofh = dof_handler[no];

?

Copy link
Member Author

Choose a reason for hiding this comment

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

I made a change: I still spell out DoFHandler<dim>, but I got rid of the weird pointer dereferencing (&*) by using a reference instead.

@peterrum peterrum merged commit e9f690f into dealii:master Jun 29, 2022
@kronbichler kronbichler deleted the simplify_some_code branch September 5, 2022 12:09
mkghadban pushed a commit to OpenFCST/dealii that referenced this pull request Sep 8, 2022
MatrixFree: Simplify some code in initialization of DoF indices
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

2 participants