Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 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
9e3f434
Update dependencies in toml to prevent packages build conflicts
paloma-martinez Jun 11, 2025
37babe4
Remove duplicate due to bad merge
paloma-martinez Jun 20, 2025
c2043fa
Change plugin name in paraview to prevent mix with original filter
paloma-martinez Jul 18, 2025
09e9b55
Fix wrong metrics setup
paloma-martinez Jul 18, 2025
d287ce3
Fix typo and linting issue
paloma-martinez Jul 18, 2025
ce7f883
Linting
paloma-martinez Jul 21, 2025
73a2e0e
Update method
paloma-martinez Jul 22, 2025
ec99a78
Fix bug in metric setup for cell quality
paloma-martinez Jul 22, 2025
8007f4c
Remove tetraVolume.vtu test file and fix tests results due to bug in …
paloma-martinez Jul 23, 2025
03b1985
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
paloma-martinez Jul 23, 2025
fa7517b
yapf
paloma-martinez Jul 23, 2025
2db309c
Yapf again
paloma-martinez Jul 23, 2025
2560a19
Moving PVplugins for a cleaner achitecture
paloma-martinez Jul 28, 2025
3ab1fa8
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
paloma-martinez Jul 28, 2025
7f2a299
Fix path
paloma-martinez Jul 29, 2025
fb67a50
Merge surface and volume mesh quality plugins into one
paloma-martinez Jul 29, 2025
6cb4a43
Quick fix
paloma-martinez Aug 1, 2025
3568fee
Fix function to account for 3D case
paloma-martinez Aug 8, 2025
dcab0e7
Display modification
paloma-martinez Aug 8, 2025
8cea10c
Cleaning and linting
paloma-martinez Aug 8, 2025
42bddd7
Documentation
paloma-martinez Aug 8, 2025
49fa33f
Linting
paloma-martinez Aug 8, 2025
de1d666
Merge branch 'main' into lemay/feature/add_tte_mesh_stats
paloma-martinez Aug 8, 2025
c0359b2
Update maintainers
paloma-martinez Aug 8, 2025
e57104a
linting
paloma-martinez Aug 8, 2025
7c60ff0
Missing linting
paloma-martinez Aug 8, 2025
11f44da
Update testGeometryFunctions to avoid skips
alexbenedicto Aug 11, 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
13 changes: 7 additions & 6 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Exclude a variety of commonly ignored directories.
extend-exclude = ["tests/data"]
extend-exclude = ["tests/data", "geos-mesh/src/geos/mesh/model/_bar_label.py"]


line-length = 120
indent-width = 4
Expand All @@ -21,12 +22,12 @@ select = [
"W", # pycodestyle warnings
"F", # pyflakes
# "UP", # pyupgrade deactivate since python39
"B", # flake8-bugbear
"SIM", # flake8-simplify
"ANN", # flake8-annotations
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"SIM", # flake8-simplify
"ANN", # flake8-annotations
"C4", # flake8-comprehensions
# "I", # isort - manage by yapf
"D", # pydocstyle
"D", # pydocstyle
]

ignore = [
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Package summary
* `geos-ats` package includes tools for managing integrated tests for GEOS.
* `pygeos-tools` package adds a variety of tools for working with *pygeosx* objects.

The next packages are dedicated to pre- and post-process GEOS inputs/outputs.
The next packages are dedicated to pre- and post-process GEOS inputs/outputs.

The following packages contain basic utilities used by the other ones:

Expand Down Expand Up @@ -110,7 +110,7 @@ Installation

* *Manual installation:*

GEOS Python packages can be manually installed with pip using `python` >= 3.10.
GEOS Python packages can be manually installed with pip using `python` >= 3.10.

To install any package, run the following commands from the geosPythonPackage directory:

Expand All @@ -131,21 +131,28 @@ Installation
[!WARNING]
Due to local package conflicts with `pip install`, it is recommended to use the `--upgrade` option when building packages, or to use the script `install_packages.sh` located at the root of the repository.
[!NOTE]
geos-pv package cannot be build alone, but together with Paraview ([see Paraview compilation guide](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md)). It is recommended to use Paraview v5.12+, which is based on python 3.10+. Alternatively, plugins from geos-pv/PVplugins can be manually loaded into Paraview ([see documentation](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html#python-algorithm)).
geos-pv package cannot be build alone, but together with Paraview ([see Paraview compilation guide](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md)). It is recommended to use Paraview v5.12+, which is based on python 3.10+. Alternatively, plugins from `geos-pv/src/geos/pv/plugins` can be manually loaded into Paraview ([see documentation](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html#python-algorithm)).


Contributions
-------------

GEOS Python packages repository gathers python scripts from any GEOS developpers and users. Feel free to share any scripts that may benefit to the GEOS community.

If you would like to report a bug, please submit an [issue](https://github.com/GEOS-DEV/geosPythonPackages/issues/new).
If you would like to report a bug, please submit an [issue](https://github.com/GEOS-DEV/geosPythonPackages/issues/new).

If you would like to contribute to GEOS Python packages, please respect the following guidelines:

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
8 changes: 6 additions & 2 deletions docs/geos-pv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ GEOS Paraview plugins

./geos_pv_docs/home.rst

./geos_pv_docs/modules.rst
./geos_pv_docs/utilities.rst

./geos_pv_docs/readers.rst
./geos_pv_docs/readers.rst

./geos_pv_docs/meshQuality.rst

./geos_pv_docs/processing.rst
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:
12 changes: 6 additions & 6 deletions docs/geos_pv_docs/geosLogReaderUtils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@ GeosLogReaderUtils functions
This package define functions dedicated to the GeosLogReader.


geos.pv.geosLogReaderUtils.GeosLogReaderAquifers module
GeosLogReaderAquifers module
-------------------------------------------------------------------

.. automodule:: geos.pv.geosLogReaderUtils.GeosLogReaderAquifers
:members:
:undoc-members:
:show-inheritance:

geos.pv.geosLogReaderUtils.geosLogReaderConvergence module
geosLogReaderConvergence module
---------------------------------------------------------------------

.. automodule:: geos.pv.geosLogReaderUtils.GeosLogReaderConvergence
:members:
:undoc-members:
:show-inheritance:

geos.pv.geosLogReaderUtils.GeosLogReaderFlow module
GeosLogReaderFlow module
---------------------------------------------------------------

.. automodule:: geos.pv.geosLogReaderUtils.GeosLogReaderFlow
:members:
:undoc-members:
:show-inheritance:

geos.pv.geosLogReaderUtils.GeosLogReaderFunctions module
GeosLogReaderFunctions module
--------------------------------------------------------------------

.. automodule:: geos.pv.geosLogReaderUtils.geosLogReaderFunctions
:members:
:undoc-members:
:show-inheritance:

geos.pv.geosLogReaderUtils.GeosLogReaderWells module
GeosLogReaderWells module
--------------------------------------------------------------------

.. automodule:: geos.pv.geosLogReaderUtils.GeosLogReaderWells
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:
15 changes: 9 additions & 6 deletions docs/geos_pv_docs/home.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
Home
====

**geos-pv** is a Python package that gathers `Paraview <https://www.paraview.org/>`_ plugins of GEOS python tools.
**geos-pv** is a Python package that gathers `Paraview <https://www.paraview.org/>`_ plugins of GEOS python tools.

It includes:

* Paraview readers allowing to load data;
* generic tools to processes meshes;
* generic tools to process meshes;
* GEOS pre-processing tools to clean and check GEOS input mesh;
* GEOS post-processing tools to clean GEOS output mesh, compute additional properties, or create specific plots such as Mohr's circle plot.

The packages can be loaded into Paraview using the Plugin Manager from `Tools > Plugin Manager`. On success, you will
see the selected plugin in the `Filters`` menu (see `Paraview documentation <https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html>`.
The packages can be loaded into Paraview using the Plugin Manager from `Tools > Plugin Manager`. On success, you will
see the selected plugin in the `Filters`` menu (see `Paraview documentation <https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html>`_).

Alternatively, geos-pv package can be build together with Paraview ([see Paraview compilation guide](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md)).
Alternatively, geos-pv package can be build together with Paraview (see `Paraview compilation guide <https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md>`_).
It is recommended to use Paraview v5.12+, which is based on python 3.10+. If you need to build geos-pv package with the paraview dependency, use the command:
`pip install Path/To/geosPythonPackages/geos-pv[paraview]`

.. code-block:: bash

pip install path/to/geosPythonPackages/geos-pv[paraview]
13 changes: 13 additions & 0 deletions docs/geos_pv_docs/meshQuality.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Mesh Quality
================


PVCellTypeCounterEnhanced
----------------------------------

.. automodule:: geos.pv.plugins.PVCellTypeCounterEnhanced

PVMeshQualityEnhanced
---------------------------

.. automodule:: geos.pv.plugins.PVMeshQualityEnhanced
7 changes: 7 additions & 0 deletions docs/geos_pv_docs/processing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Post-/Pre-processing
=========================

PVSplitMesh
----------------------------------

.. automodule:: geos.pv.plugins.PVSplitMesh
10 changes: 5 additions & 5 deletions docs/geos_pv_docs/readers.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Paraview readers
================
Readers
=============

readers.PVGeosLogReader module
----------------------------------
PVGeosLogReader
--------------------

.. automodule:: readers.PVGeosLogReader
.. automodule:: geos.pv.plugins.PVGeosLogReader
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Processing
Utilities
==========

.. toctree::
Expand All @@ -8,4 +8,4 @@ Processing

pyplotUtils

utils
utils
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",
]

[project.scripts]
Expand Down
37 changes: 36 additions & 1 deletion 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,22 @@ 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 getTotalCount( self: Self ) -> int:
"""Get the total number of cells.

Returns:
int: Total number of cells
"""
return self._counts[ VTK_POLYHEDRON ] + self._counts[ VTK_POLYGON ]

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

Expand Down Expand Up @@ -74,6 +105,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 All @@ -98,7 +133,7 @@ def print( self: Self ) -> str:
card += f"| **Total Number of Vertices** | {int(self._counts[VTK_VERTEX]):12} |\n"
card += f"| **Total Number of Polygon** | {int(self._counts[VTK_POLYGON]):12} |\n"
card += f"| **Total Number of Polyhedron** | {int(self._counts[VTK_POLYHEDRON]):12} |\n"
card += f"| **Total Number of Cells** | {int(self._counts[VTK_POLYHEDRON]+self._counts[VTK_POLYGON]):12} |\n"
card += f"| **Total Number of Cells** | {int(self.getTotalCount()):12} |\n"
card += "| - | - |\n"
for cellType in ( VTK_TRIANGLE, VTK_QUAD ):
card += f"| **Total Number of {vtkCellTypes.GetClassNameFromTypeId(cellType):<13}** | {int(self._counts[cellType]):12} |\n"
Expand Down
Loading