Skip to content

Use dedicated OpenFOAM solver clang format to make solver compile again#499

Merged
davidscn merged 4 commits intoprecice:developfrom
davidscn:fix-heat-solver
Mar 25, 2024
Merged

Use dedicated OpenFOAM solver clang format to make solver compile again#499
davidscn merged 4 commits intoprecice:developfrom
davidscn:fix-heat-solver

Conversation

@davidscn
Copy link
Copy Markdown
Member

Takes over the clang format we have in the adapter. The default clang-format is not compatible with the way OpenFOAM code looks like. The adapter style guide is also more readable (compare e.g. the while loop, where the physics are solved).

@davidscn davidscn requested a review from MakisH March 25, 2024 10:11
Copy link
Copy Markdown
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

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

The code compiles, but let's also upgrade the pre-commit hook.

AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
# Align operands after operators (+,*,<<) (see BreakBeforeBinaryOperators)
AlignOperands: AlignAfterOperator
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to be failing for the pre-commit, which uses clang-format 8.
Let's maybe update to 11, used by the OpenFOAM adapter?

https://github.com/precice/openfoam-adapter/blob/develop/.github/workflows/check-format.yml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can certainly do that (8 is anyway a bit old). This will, however, trigger various changes in other subdirectories. In the next month, the new ubuntu LTS will be released, such that we could consider moving immediately to 14.0.0, which is the default on 22.04. Should I upgrade in a separate PR or here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should make the CI succeed before merging, otherwise it will show as failing forever, until we merge again into master.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Updating to 14.0.0 is fine, and touching more files in this PR is also fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

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

I have not checked if all code compiles. Feel free to merge once you are confident about that.

@davidscn davidscn merged commit 7396f3d into precice:develop Mar 25, 2024
@davidscn davidscn deleted the fix-heat-solver branch March 25, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants