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

Convert CreateDescriptionFromTriangulationHelper into a function. #16374

Merged
merged 2 commits into from Jan 1, 2024

Conversation

bangerth
Copy link
Member

In tria_description.cc, there is a class called CreateDescriptionFromTriangulationHelper that in essence consists of a constructor that sets a bunch of member variables, and a single public member function that takes some more arguments and then does something. This all can be handled in a more traditional way by just having a single free function that does the same thing -- it is easier to reason about where which data lives and who changes it.

This patch does this kind of conversion. The only marginal difficulty (other than the fact that the patch is likely hard to read because everything moves around) is that the constructor of the class calls a GridTools function to initialize two expensive members that can then be re-used over multiple calls to the one function in a loop. I handled that by moving this call to GridTools out to the calling sites, and letting them pass the result as an additional argument to the now free function.

The patch might be easiest to read without showing whitespace changes.

@bangerth
Copy link
Member Author

Ping?

1 similar comment
@bangerth
Copy link
Member Author

Ping?

@masterleinad masterleinad merged commit e823506 into dealii:master Jan 1, 2024
15 checks passed
@bangerth bangerth deleted the dev-1 branch January 2, 2024 01:26
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