-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Move GeosBlockMerge to geos-processing #163
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: Move GeosBlockMerge to geos-processing #163
Conversation
…github.com/GEOS-DEV/geosPythonPackages into pmartinez/refactor/moveSurfaceGeomechanics
Update to the last version of the main
geos-processing/src/geos/processing/post_processing/GeosBlockMerge.py
Outdated
Show resolved
Hide resolved
geos-processing/src/geos/processing/post_processing/GeosBlockMerge.py
Outdated
Show resolved
Hide resolved
geos-processing/src/geos/processing/post_processing/GeosBlockMerge.py
Outdated
Show resolved
Hide resolved
| for all the composite blocks of the input mesh: | ||
| - Ranks are merged | ||
| - "Rock" attributes are renamed | ||
| - Volume mesh are convert to surface if needed |
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.
| for all the composite blocks of the input mesh: | |
| - Ranks are merged | |
| - "Rock" attributes are renamed | |
| - Volume mesh are convert to surface if needed | |
| For each composite block of the input mesh: | |
| - Ranks are merged. | |
| - "Rock" attributes are renamed. | |
| - Volume meshes are converted to surface if requested. |
geos-processing/src/geos/processing/post_processing/GeosBlockMerge.py
Outdated
Show resolved
Hide resolved
geos-processing/src/geos/processing/post_processing/GeosBlockMerge.py
Outdated
Show resolved
Hide resolved
| surfaceMesh: vtkPolyData = self.convertBlockToSurface( volumeMesh ) | ||
| assert surfaceMesh is not None, "Surface extraction from block failed." | ||
| surfaceMesh.ShallowCopy( computeNormals( surfaceMesh, logger=self.logger ) ) | ||
| assert surfaceMesh is not None, "Normal calculation failed." | ||
| surfaceMesh.ShallowCopy( computeTangents( surfaceMesh, logger=self.logger ) ) | ||
| assert surfaceMesh is not None, "Tangent calculation failed." |
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.
These three assert can be handled in the except.
geos-processing/src/geos/processing/post_processing/GeosBlockMerge.py
Outdated
Show resolved
Hide resolved
Co-authored-by: paloma-martinez <[email protected]>
jafranc
left a comment
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.
Looks good ! Looking forward for upcoming refactor PR, feel free to comment this one with their numbers if opened.
| PHASE_DENSITY_SUFFIX = "_density" | ||
| PHASE_MASS_DENSITY_SUFFIX = "_phaseMassDensity" | ||
| PHASE_VISCOSITY_SUFFIX = "_phaseViscosity" | ||
| PHASE_VISCOSITY_SUFFIX = "_viscosity" | ||
| PHASE_FRACTION_SUFFIX = "_phaseFraction" | ||
|
|
||
| # surface attribute transfer suffix |
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.
Would worth its own PR to set the strategy here
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.
At first I thought that the names just changed, that why I just modified it, but I figure out that names were case dependent. In this pr I just change the names to be coherent with single phase flow simulation, in the pr #169 I add the names for multi phase flow simulation. An pr need to be done to check this name indeed.
| from geos.processing.post_processing.GeosBlockMerge import GeosBlockMerge | ||
| # Filter inputs. | ||
| inputMesh: vtkMultiBlockDataSet | ||
| # Optional inputs. | ||
| convertFaultToSurface: bool # Defaults to False | ||
| speHandler: bool # Defaults to False | ||
| # Instantiate the filter | ||
| mergeBlockFilter: GeosBlockMerge = GeosBlockMerge( inputMesh, convertFaultToSurface, speHandler ) | ||
| # Set the handler of yours (only if speHandler is True). | ||
| yourHandler: logging.Handler | ||
| mergeBlockFilter.setLoggerHandler( yourHandler ) | ||
| # Do calculations | ||
| mergeBlockFilter.applyFilter() | ||
| # Get the multiBlockDataSet with one dataSet per region | ||
| outputMesh: vtkMultiBlockDataSet = mergeBlockFilter.getOutput() | ||
| """ |
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.
why not providing an example using GeosBlockExtractor as it sounds mandatory
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.
It is not mandatory to use GeosBlockExtractor before using this filter. This filter can be use to merge any type of mesh as long as it is a multiBlockDataSet with composite block to process. If you don't use GeosBlockExtractor or a mesh from a GEOS simulation only the renaming of attributes can be skiped but the filter will merge the mesh.
This pr aims to:
The implementation of the tests for GeosBlockMerge will be make later with a clean of all the tests and the data. See more clean test