Skip to content

feat: Add mesh statistic tools #95

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

Open
wants to merge 97 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
6968e2c
Move vtkUtils and multiblockInspectorTreeFunctions + update dependencies
paloma-martinez Apr 4, 2025
605d0f3
Merge branch 'main' into pmartinez/refactor/MoveMultiblockInspectorAn…
paloma-martinez Apr 7, 2025
14b0c14
Merge branch 'main' into pmartinez/refactor/MoveMultiblockInspectorAn…
paloma-martinez Apr 8, 2025
b2d635d
Update dependencies and correct typo in name
paloma-martinez Apr 8, 2025
21ae37e
Add SplitMesh and MergeColocatedPoints filters
mlemayTTE Apr 9, 2025
5d42638
Add array transfer from parent to child mesh and tests
mlemayTTE Apr 10, 2025
6ec82d2
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE Apr 11, 2025
c2286b5
add helpers to create mesh with multiple cells
mlemayTTE Apr 11, 2025
fb5f274
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE Apr 14, 2025
5544b5f
fix and add tests to MergeColocatedPoints
mlemayTTE Apr 14, 2025
606379b
add MeshIdCard class and tests + linting
mlemayTTE Apr 15, 2025
4c68085
create vtk filters to compute mesh stats
mlemayTTE Apr 15, 2025
b6b05ee
create Paraview plugins to wrap vtk filters
mlemayTTE Apr 15, 2025
9979dcf
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE Apr 16, 2025
465622b
First tests implementation
paloma-martinez Apr 16, 2025
954270e
Merge branch 'main' into pmartinez/refactor/MoveMultiblockInspectorAn…
paloma-martinez Apr 16, 2025
072cd8e
remove empty folder
paloma-martinez Apr 16, 2025
b0f06e1
upgrade github actions
paloma-martinez Apr 16, 2025
28ae96f
Linting and typing
paloma-martinez Apr 16, 2025
996bc17
Remove useless comment
paloma-martinez Apr 16, 2025
fec1bf2
Fix dependencies
paloma-martinez Apr 16, 2025
c5ade9e
rename MeshIdCard and associated filters by CellTypeCounts
mlemayTTE Apr 16, 2025
261793d
Add data for test and modify useless functions
paloma-martinez Apr 17, 2025
2f54610
typo
paloma-martinez Apr 17, 2025
9282283
linting
paloma-martinez Apr 17, 2025
416ca06
Update data test path
paloma-martinez Apr 17, 2025
7adc08b
add tests and update cellTypeCounter filter
mlemayTTE Apr 23, 2025
a35eb2c
ci fix
mlemayTTE Apr 23, 2025
1574799
fix test
mlemayTTE Apr 24, 2025
f1b0c99
add missing dependency
mlemayTTE Apr 24, 2025
95191fc
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE Apr 29, 2025
ed9f0a5
add comment
paloma-martinez Apr 29, 2025
c77a4c5
Merge helpers
mlemayTTE Apr 29, 2025
7fb8e79
Linting, formating, typing
mlemayTTE Apr 29, 2025
9af63b0
linting
mlemayTTE Apr 29, 2025
15d9df9
fix tests
mlemayTTE Apr 29, 2025
25b25ea
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
mlemayTTE Apr 29, 2025
04cccd6
Merge branch 'lemay/feature/add_tte_meshing_tools' into lemay/feature…
mlemayTTE Apr 29, 2025
0575b1e
Addition of data for tests
paloma-martinez Apr 30, 2025
0ef062e
Comment and fix typos
paloma-martinez Apr 30, 2025
31271ba
vtkUtils tests implemented
paloma-martinez Apr 30, 2025
7ba4de3
create wrapper of vtkMeshQuality and PV filter for surfaces
mlemayTTE Apr 30, 2025
1c21a71
Remove comments - linting - typo
mlemayTTE Apr 30, 2025
c10edba
Typing & linting
paloma-martinez May 5, 2025
d6b1ae1
Linting
paloma-martinez May 5, 2025
bed516c
Fix import path
paloma-martinez May 5, 2025
34574ef
Merge branch 'main' into pmartinez/refactor/MoveMultiblockInspectorAn…
paloma-martinez May 5, 2025
2f7339e
Refactoring
paloma-martinez May 12, 2025
8614bef
Updating documentation
paloma-martinez May 12, 2025
6b7eb09
Typo when refactoring
paloma-martinez May 12, 2025
60374be
Fix documentation
paloma-martinez May 12, 2025
50d90c8
Yapf
paloma-martinez May 12, 2025
f23f8cd
Yapf again
paloma-martinez May 13, 2025
816701d
Add export stats plot and tests
mlemayTTE May 13, 2025
cbaf414
Remove MergeColocatedPoints and replace with CellTypeCounts
mlemayTTE May 13, 2025
8f31c51
yapf fix
mlemayTTE May 13, 2025
e9d11ea
fix tests
mlemayTTE May 13, 2025
db70150
Merge branch 'lemay/feature/add_tte_meshing_tools' into lemay/feature…
mlemayTTE May 13, 2025
efaf0be
Reorganize utilities & update paths accordingly
paloma-martinez May 19, 2025
59ea65a
add PV volume mesh quality plugin
mlemayTTE May 19, 2025
b9dfb8f
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE May 19, 2025
8fba301
Merge branch 'lemay/feature/add_tte_meshing_tools' into lemay/feature…
mlemayTTE May 19, 2025
29d3f4f
Documentation
paloma-martinez May 19, 2025
2486847
Merge branch 'main' into pmartinez/refactor/MoveMultiblockInspectorAn…
paloma-martinez May 19, 2025
c70f353
Fix doc and yapf for ci
paloma-martinez May 19, 2025
32af612
Documentation and formating
alexbenedicto May 19, 2025
923897f
Fix import errors
alexbenedicto May 20, 2025
c22f4b4
Merge branch 'main' into pmartinez/refactor/MoveMultiblockInspectorAn…
paloma-martinez May 20, 2025
aaf7560
typing, linting and formating
mlemayTTE May 21, 2025
efb92a8
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE May 21, 2025
8c9d934
typo
mlemayTTE May 21, 2025
df914ac
Merge branch 'pmartinez/refactor/MoveMultiblockInspectorAndVtkUtils' …
mlemayTTE May 21, 2025
24582d1
Merge branch 'pmartinez/refactor/MoveMultiblockInspectorAndVtkUtils' …
mlemayTTE May 21, 2025
7e65787
Adding more documentation
paloma-martinez May 21, 2025
2ff6fda
documentation + typing, liniting, formating
mlemayTTE May 21, 2025
7775fbb
Merge branch 'pmartinez/refactor/MoveMultiblockInspectorAndVtkUtils' …
mlemayTTE May 21, 2025
effe053
Merge branch 'lemay/feature/add_tte_meshing_tools' into lemay/feature…
mlemayTTE May 21, 2025
e55e6a3
fix bugs and tests
mlemayTTE May 21, 2025
9c0d60b
bugs and tests fix
mlemayTTE May 21, 2025
264c72b
fix merge + fix tests
mlemayTTE May 21, 2025
8a3c4ab
Fix merge and tests
mlemayTTE May 21, 2025
2318b7e
yapf fix
mlemayTTE May 21, 2025
807be0c
Merge branch 'lemay/feature/add_tte_meshing_tools' into lemay/feature…
mlemayTTE May 21, 2025
35cf05c
fix bugs and add doc
mlemayTTE May 21, 2025
bceb4bb
ci fix
mlemayTTE May 21, 2025
66d1bb5
linting + fix docs
mlemayTTE May 21, 2025
7d34a95
Restore geos-utils dependency
mlemayTTE May 22, 2025
1bc1631
Merge branch 'main' into lemay/feature/add_tte_meshing_tools
mlemayTTE May 22, 2025
4b54e48
linting fix
mlemayTTE May 22, 2025
bedaec7
Merge branch 'lemay/feature/add_tte_meshing_tools' into lemay/feature…
mlemayTTE May 22, 2025
995cc97
fix tests
mlemayTTE May 22, 2025
6f0757f
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
mlemayTTE May 23, 2025
78d13de
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
paloma-martinez Jun 3, 2025
30ccc10
Mark tests as to be fixed
paloma-martinez Jun 4, 2025
72c7337
Formatting
paloma-martinez Jun 4, 2025
aec3d73
Yapf
paloma-martinez Jun 4, 2025
268a5b6
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
alexbenedicto Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ If you would like to contribute to GEOS Python packages, please respect the foll

1. Create a new branch named from this template: `[CONTRIBUTOR]/[TYPE]/[TITLE]` where CONTRIBUTOR is the name of the contributor, TYPE is the type of contribution among 'feature', 'refactor', 'doc', 'ci', TITLE is a short title for the branch.
2. Add your code trying to integrate into the current code architecture.
3. Push the branch, open a new PR respecting naming [semantics](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716), and add reviewers
3. Run mypy, ruff and yapf in this order
```
python -m pip install --upgrade mypy ruff yapf
python -m mypy --config-file ./.mypy.ini --check-untyped-defs ./<PACKAGE_NAME>
python -m ruff check --fix --config .ruff.toml ./<PACKAGE_NAME>
python -m yapf -r -i --style .style.yapf ./<PACKAGE_NAME>
```
4. Push the branch, open a new PR respecting naming [semantics](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716), and add reviewers

If you do not have the rights to push the code and open new PRs, consider opening a new issue to explain what you want to do and ask for the dev rights.

Expand Down
10 changes: 9 additions & 1 deletion docs/geos_mesh_docs/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ Model
The `model` module of `geos-mesh` package contains data model.


geos.mesh.model.CellTypeCounts filter
geos.mesh.model.CellTypeCounts module
--------------------------------------

.. automodule:: geos.mesh.model.CellTypeCounts
:members:
:undoc-members:
:show-inheritance:

geos.mesh.model.QualityMetricSummary module
--------------------------------------------

.. automodule:: geos.mesh.model.QualityMetricSummary
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/geos_mesh_docs/processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Processing filters
The `processing` module of `geos-mesh` package contains filters to process meshes.


geos.mesh.processing.meshQualityMetricHelpers module
-----------------------------------------------------

.. automodule:: geos.mesh.processing.meshQualityMetricHelpers
:members:
:undoc-members:
:show-inheritance:

geos.mesh.processing.SplitMesh filter
--------------------------------------

Expand Down
14 changes: 11 additions & 3 deletions docs/geos_mesh_docs/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ Mesh stats tools
The `stats` module of `geos-mesh` package contains filter to compute statistics on meshes.


geos.mesh.stats.CellTypeCounter filter
--------------------------------------
geos.mesh.stats.CellTypeCounterEnhanced filter
-----------------------------------------------

.. automodule:: geos.mesh.stats.CellTypeCounter
.. automodule:: geos.mesh.stats.CellTypeCounterEnhanced
:members:
:undoc-members:
:show-inheritance:

geos.mesh.stats.MeshQualityEnhanced filter
-------------------------------------------

.. automodule:: geos.mesh.stats.MeshQualityEnhanced
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions geos-mesh/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies = [
"pandas >= 2.2",
"meshio >= 5.3",
"typing_extensions >= 4.12",
"geos-utils @ file:./geos-utils",
]

[project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion geos-mesh/src/geos/mesh/doctor/checks/collocated_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Result:


def __check( mesh, options: Options ) -> Result:
points = mesh.GetPoints()
points: vtkPoints = mesh.GetPoints()

locator = vtkIncrementalOctreePointLocator()
locator.SetTolerance( options.tolerance )
Expand Down
27 changes: 27 additions & 0 deletions geos-mesh/src/geos/mesh/model/CellTypeCounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@

__doc__ = """
CellTypeCounts stores the number of elements of each type.

To use the filter:

.. code-block:: python

from geos.mesh.model.CellTypeCounts import CellTypeCounts

counts: CellTypeCounts = CellTypeCounts()

# set data
counts.addType( cellType )
counts.setTypeCount( cellType, count )

# get data
count: int counts.getTypeCount( cellType )
"""


Expand Down Expand Up @@ -43,6 +58,14 @@ def __add__( self: Self, other: Self ) -> 'CellTypeCounts':
newCounts._counts = self._counts + other._counts
return newCounts

def getCounts( self: Self ) -> npt.NDArray[ np.int64 ]:
"""Get all counts.

Returns:
npt.NDArray[ np.int64 ]: counts
"""
return self._counts

def addType( self: Self, cellType: int ) -> None:
"""Increment the number of cell of input type.

Expand Down Expand Up @@ -74,6 +97,10 @@ def getTypeCount( self: Self, cellType: int ) -> int:
"""
return int( self._counts[ cellType ] )

def reset( self: Self ) -> None:
"""Reset counts."""
self._counts = np.zeros( VTK_NUMBER_OF_CELL_TYPES, dtype=float )

def _updateGeneralCounts( self: Self, cellType: int, count: int ) -> None:
"""Update generic type counters.

Expand Down
Loading