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

Refactor Force based data sets #148

Merged
merged 5 commits into from
Jan 18, 2021
Merged

Conversation

davidscn
Copy link
Member

I took the opportunity to clean-up the Force based data classes and split the common functionality in a base class. The PR reverts a crime introduced in #134 and partially #125, reduces code duplication and makes the whole data set much easier to maintain. Closes #139.

I hope we can run the tests on this PR.

@davidscn davidscn added dev Not directly affecting users, but helping future development FSI Fluid-structure interaction labels Dec 16, 2020
@davidscn davidscn requested a review from MakisH December 16, 2020 08:14
@davidscn davidscn self-assigned this Dec 16, 2020
FSI/Stress.C Outdated Show resolved Hide resolved
Copy link
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.

Looking at the code, I like this refactoring. 👍

  • Before we had Force and Stress : public Force.
  • Now we have a ForceBase with most functionality, and Force and Stress essentially changing the normal vectors they are using, overriding the following virtual function:
Foam::vectorField getFaceVectors(const unsigned int patchID) const override;

In the case of Force:

  // Normal vectors multiplied by face area
  return mesh_.boundary()[patchID].Sf();

In the case of Stress:

return mesh_.boundary()[patchID].nf();

This PR removes more code than adds, so this is highly encouraging! I have not tried to build or test the code, but if you already checked 1-2 cases, it should be fine.

@davidscn
Copy link
Member Author

This PR removes more code than adds, so this is highly encouraging! I have not tried to build or test the code, but if you already checked 1-2 cases, it should be fine.

Yes. Considering that there is now more 'c++ structure' code, it removes even more code tom maintain than shown in the overview. Let me address your comment and check the result again.

@davidscn davidscn linked an issue Jan 18, 2021 that may be closed by this pull request
@davidscn davidscn merged commit 0898346 into precice:develop Jan 18, 2021
@davidscn davidscn deleted the refactor-forces branch January 18, 2021 13:40
@MakisH MakisH mentioned this pull request Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Not directly affecting users, but helping future development FSI Fluid-structure interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor FSI Stress/Force
2 participants