-
Notifications
You must be signed in to change notification settings - Fork 441
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 POpenFOAMReader #2676
Add POpenFOAMReader #2676
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2676 +/- ##
==========================================
+ Coverage 93.76% 93.78% +0.02%
==========================================
Files 75 76 +1
Lines 16148 16213 +65
==========================================
+ Hits 15141 15206 +65
Misses 1007 1007 |
When I test this out using Setting |
I added a small workaround following instructions given in the vtk issue. Now it seems to be working for me. We can see the separation on the mesh. With With |
This is great work!
You need to add to |
I was also able to switch the existing tests that use a non parallel data set to use For testing decomposed datasets in a non adhoc way, we'd need to find a dataset that has a permissive license. |
For testing I have the following file: windAroundBuildings.zip |
The tutorial data directly from OpenFOAM might be considered licensed the same, i.e. GPL licensed. This would be a problem if so. |
Ok I understand. You are right, this example is GPL licensed so it won't work. I'm trying to find another file. |
If we cannot find a suitable testing dataset, then we could at least test that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me. I won't be able to do an ad hoc test, i.e an outside the testing suite test of this for at least a week.
We should push users to use this class in the documentation as it is more general. Here is one such place:
reader = pyvista.OpenFOAMReader(filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this ad hoc on a closed source decomposed dataset and it works great. It also passes all tests with the reconstructed or serial generated dataset that is available. I only have one last optional suggestion.
Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
I see 2/3 tasks complete, but approved. I'm starting to pare down the number of active PRs in preparation for a minor release sometime this month. There's a scipy tutorial next month that we're working on preparing for; will need a release likely for that. |
The last task was to add a decomposed dataset for testing. I do not have an open source one to add. I tested on a closed source dataset. I'm not sure if @Failxxx is still planning on adding one. |
I am planning to add one but I can't for the moment. Do you think we can finish this PR before I add it? I am expecting to have one in the 2 next weeks but not 100% sure. |
I'd prefer merging this PR and creating a second one with the additional dataset. If it's a large dataset, let's create an example. If small, just a unit test. For those of you who are wondering why I'm hell bent on getting PRs merged in short time, it's all about Short Lived Feature Branches in keeping with Trunk Based Development. There it's stated:
Since we're an open source, distributed community with no genuine deadlines other than the one we impose upon ourselves, I'm fine with lengthening the lifetime of active PRs to as long as they need to be fully reviewed. That being said, I'd still prefer short lived feature or bug fix branches and PRs. If additional features need to be added or additional refactoring needs to be done, it's best to split into multiple PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good to go as-is.
Given multiple approvals over multiple days, I'm going to merge this now. Thanks @Failxxx! |
Overview
We would like to be able to import and manipulate OpenFOAM files which are produced from a parallel computation. Thus, we need to expose the vtkPOpenFOAMReader (class definition).
It has been discussed here: #924
This PR resolves #2590
Details
A first idea was to replace the reader in the current OpenFOAMReader because vtkPOpenFOAMReader inherits from vtkOpenFOAMReader in vtk. Thus we would just need to add the
CaseType
property to allow users to chose whether reconstructed mesh or decomposed mesh should be read.However since we are not 100% sure vtkPOpenFOAMReader can propose the exact same services as the vtkOpenFOAMReader we decided to create a class (
POpenFOAMReader
) which inherits from OpenFOAMReader with a new property (case_type
).Work to be done