Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion geos-geomechanics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
]
dependencies=[
"geos-utils",
"vtk >= 9.3",
"vtk >= 9.6",
"numpy >= 2.2",
"pandas >= 2.2",
"typing_extensions >= 4.12",
Expand Down
2 changes: 1 addition & 1 deletion geos-mesh/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers = [
requires-python = ">=3.10"

dependencies = [
"vtk >= 9.3",
"vtk >= 9.6",
"networkx >= 2.4",
"tqdm >= 4.67",
"numpy >= 2.2",
Expand Down
10 changes: 5 additions & 5 deletions geos-mesh/src/geos/mesh/model/CellTypeCounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
import numpy.typing as npt
from typing_extensions import Self
from vtkmodules.vtkCommonDataModel import ( vtkCellTypes, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_VERTEX, VTK_POLYHEDRON,
from vtkmodules.vtkCommonDataModel import ( vtkCellTypeUtilities, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_VERTEX, VTK_POLYHEDRON,
VTK_POLYGON, VTK_PYRAMID, VTK_HEXAHEDRON, VTK_WEDGE,
VTK_NUMBER_OF_CELL_TYPES )

Expand Down Expand Up @@ -116,9 +116,9 @@ def _updateGeneralCounts( self: Self, cellType: int, count: int ) -> None:
cellType (int): cell type
count (int): count increment
"""
if ( cellType != VTK_POLYGON ) and ( vtkCellTypes.GetDimension( cellType ) == 2 ):
if ( cellType != VTK_POLYGON ) and ( vtkCellTypeUtilities.GetDimension( cellType ) == 2 ):
self._counts[ VTK_POLYGON ] += count
if ( cellType != VTK_POLYHEDRON ) and ( vtkCellTypes.GetDimension( cellType ) == 3 ):
if ( cellType != VTK_POLYHEDRON ) and ( vtkCellTypeUtilities.GetDimension( cellType ) == 3 ):
self._counts[ VTK_POLYHEDRON ] += count

def print( self: Self ) -> str:
Expand All @@ -136,7 +136,7 @@ def print( self: Self ) -> str:
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"
card += f"| **Total Number of {vtkCellTypeUtilities.GetClassNameFromTypeId(cellType):<13}** | {int(self._counts[cellType]):12} |\n"
for cellType in ( VTK_TETRA, VTK_PYRAMID, VTK_WEDGE, VTK_HEXAHEDRON ):
card += f"| **Total Number of {vtkCellTypes.GetClassNameFromTypeId(cellType):<13}** | {int(self._counts[cellType]):12} |\n"
card += f"| **Total Number of {vtkCellTypeUtilities.GetClassNameFromTypeId(cellType):<13}** | {int(self._counts[cellType]):12} |\n"
return card
4 changes: 2 additions & 2 deletions geos-mesh/src/geos/mesh/model/QualityMetricSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from matplotlib.axes import Axes
from matplotlib.lines import Line2D
from matplotlib.patches import Patch
from vtkmodules.vtkCommonDataModel import ( vtkCellTypes, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_PYRAMID,
from vtkmodules.vtkCommonDataModel import ( vtkCellTypeUtilities, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_PYRAMID,
VTK_HEXAHEDRON, VTK_WEDGE, VTK_POLYGON, VTK_POLYHEDRON )
from geos.mesh.stats.meshQualityMetricHelpers import ( QUALITY_METRIC_OTHER_START_INDEX, getAllCellTypesExtended,
getQualityMeasureNameFromIndex, getQualityMetricFromIndex,
Expand Down Expand Up @@ -149,7 +149,7 @@ class QualityMetricSummary():
_CELL_TYPES_PLOT: tuple[ int, ...] = ( VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_PYRAMID, VTK_WEDGE, VTK_HEXAHEDRON,
VTK_POLYGON, VTK_POLYHEDRON )
_CELL_TYPES_NAME: list[ str ] = [
vtkCellTypes.GetClassNameFromTypeId( cellType ).removeprefix( "vtk" ) for cellType in _CELL_TYPES_PLOT
vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ).removeprefix( "vtk" ) for cellType in _CELL_TYPES_PLOT
]

def __init__( self: Self ) -> None:
Expand Down
2 changes: 2 additions & 0 deletions geos-mesh/src/geos/mesh/stats/meshQualityMetricHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ class VtkCellQualityMetricEnum( CellQualityMetricEnum ):
( False, False, True, True, True, True ), ( None, None,
QualityRange( ( 0.0, 0.3 ), ( 0.0, 0.9 ),
( 0.0, 1.0 ) ), None, None, None ) )
#: the radius of the largest sphere that fits snugly inside it
INRADIUS = ( vtkMeshQuality.QualityMeasureTypes.INRADIUS, "Inradius", ( False, False, True, False, False, False ), ( None, None, None, None, None, None ) )
#: no metric
NONE = ( vtkMeshQuality.QualityMeasureTypes.NONE, "None", ( False, False, False, False, False, False ),
( None, None, None, None, None, None ) )
Expand Down
2 changes: 1 addition & 1 deletion geos-mesh/src/geos/mesh/utils/genericHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def isTriangulate( dataSet: vtkUnstructuredGrid ) -> bool:
bool: True if the mesh is triangulate only, False otherwise.
"""
cellTypes: vtkCellTypes = vtkCellTypes()
dataSet.GetCellTypes( cellTypes )
dataSet.GetDistinctCellTypes( cellTypes )

return all( cellTypes.GetCellType( cell ) == VTK_TRIANGLE for cell in range( cellTypes.GetNumberOfTypes() ) )

Expand Down
6 changes: 3 additions & 3 deletions geos-mesh/tests/test_CellTypeCounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from geos.mesh.model.CellTypeCounts import CellTypeCounts

from vtkmodules.vtkCommonDataModel import ( vtkCellTypes, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_PYRAMID,
from vtkmodules.vtkCommonDataModel import ( vtkCellTypeUtilities, VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_PYRAMID,
VTK_HEXAHEDRON, VTK_WEDGE, VTK_VERTEX )

# inputs
Expand Down Expand Up @@ -77,10 +77,10 @@ def __get_expected_counts(
nbTri,
nbQuad,
), strict=True ):
countsExp += f"| **Total Number of {vtkCellTypes.GetClassNameFromTypeId(cellType):<13}** | {int(nb):12} |\n"
countsExp += f"| **Total Number of {vtkCellTypeUtilities.GetClassNameFromTypeId(cellType):<13}** | {int(nb):12} |\n"
for cellType, nb in zip( ( VTK_TETRA, VTK_PYRAMID, VTK_WEDGE, VTK_HEXAHEDRON ), ( nbTetra, nbPyr, nbWed, nbHexa ),
strict=True ):
countsExp += f"| **Total Number of {vtkCellTypes.GetClassNameFromTypeId(cellType):<13}** | {int(nb):12} |\n"
countsExp += f"| **Total Number of {vtkCellTypeUtilities.GetClassNameFromTypeId(cellType):<13}** | {int(nb):12} |\n"
return countsExp


Expand Down
2 changes: 1 addition & 1 deletion geos-mesh/tests/test_QualityMetricSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_QualityMetricSummary_init() -> None:
stats: QualityMetricSummary = QualityMetricSummary()
assert stats.getAllCellStats() is not None, "Stats member is undefined."
assert ( stats.getAllCellStats().shape[ 0 ]
== 5 ) and stats.getAllCellStats().shape[ 1 ] == 122, "Stats shape is wrong."
== 5 ) and stats.getAllCellStats().shape[ 1 ] == 123, "Stats shape is wrong."


@pytest.mark.parametrize( "test_case", __generate_failed_test_data() )
Expand Down
2 changes: 1 addition & 1 deletion geos-mesh/tests/test_genericHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_createMultiCellMesh( test_case: TestCase ) -> None:

# check cell types
types: vtkCellTypes = vtkCellTypes()
output.GetCellTypes( types )
output.GetDistinctCellTypes( types )
assert types is not None, "Cell types must be defined"
typesArray: npt.NDArray[ np.int64 ] = vtk_to_numpy( types.GetCellTypesArray() )
assert ( typesArray.size == 1 ) and ( typesArray[ 0 ] == test_case.cellTypes[ 0 ] ), "Cell types are wrong"
Expand Down
8 changes: 4 additions & 4 deletions geos-mesh/tests/test_genericHelpers_createSingleCellMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from vtkmodules.util.numpy_support import vtk_to_numpy

from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellTypes, VTK_TRIANGLE, VTK_QUAD,
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellTypeUtilities, vtkCellTypes, VTK_TRIANGLE, VTK_QUAD,
VTK_TETRA, VTK_HEXAHEDRON, VTK_PYRAMID )

from vtkmodules.vtkCommonCore import (
Expand Down Expand Up @@ -50,7 +50,7 @@ def __generate_test_data() -> Iterator[ TestCase ]:
yield TestCase( cellType, cell )


ids: list[ str ] = [ vtkCellTypes.GetClassNameFromTypeId( cellType ) for cellType in cell_type_all ]
ids: list[ str ] = [ vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ) for cellType in cell_type_all ]


@pytest.mark.parametrize( "test_case", __generate_test_data(), ids=ids )
Expand All @@ -60,7 +60,7 @@ def test_createSingleCellMesh( test_case: TestCase ) -> None:
Args:
test_case (TestCase): test case
"""
cellTypeName: str = vtkCellTypes.GetClassNameFromTypeId( test_case.cellType )
cellTypeName: str = vtkCellTypeUtilities.GetClassNameFromTypeId( test_case.cellType )
output: vtkUnstructuredGrid = createSingleCellMesh( test_case.cellType, test_case.cellPoints )

assert output is not None, "Output mesh is undefined."
Expand All @@ -78,7 +78,7 @@ def test_createSingleCellMesh( test_case: TestCase ) -> None:
assert cellsOut.GetNumberOfCells() == 1, "Number of cells is expected to be 1."
# check cell types
types: vtkCellTypes = vtkCellTypes()
output.GetCellTypes( types )
output.GetDistinctCellTypes( types )
assert types is not None, "Cell types must be defined"
typesArray: npt.NDArray[ np.int64 ] = vtk_to_numpy( types.GetCellTypesArray() )

Expand Down
2 changes: 2 additions & 0 deletions geos-mesh/tests/test_meshQualityHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
vtkMeshQuality.QualityMeasureTypes.EDGE_RATIO,
vtkMeshQuality.QualityMeasureTypes.EQUIANGLE_SKEW,
vtkMeshQuality.QualityMeasureTypes.EQUIVOLUME_SKEW,
vtkMeshQuality.QualityMeasureTypes.INRADIUS,
vtkMeshQuality.QualityMeasureTypes.JACOBIAN,
vtkMeshQuality.QualityMeasureTypes.MEAN_RATIO,
vtkMeshQuality.QualityMeasureTypes.MIN_ANGLE,
Expand Down Expand Up @@ -167,6 +168,7 @@ def __generate_test_data() -> Iterator[ TestCase ]:
def test_CellQualityMetricEnum_Order() -> None:
"""Test VtkCellQualityMetricEnum ordering is correct."""
for i, metric in enumerate( list( VtkCellQualityMetricEnum ) ):
print(metric.metricIndex)
assert metric.metricIndex == i


Expand Down
2 changes: 1 addition & 1 deletion geos-processing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"geos-geomechanics",
"geos-utils",
"geos-mesh",
"vtk >= 9.3",
"vtk >= 9.6",
"numpy >= 2.2",
"typing_extensions >= 4.12",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing_extensions import Self

from vtkmodules.vtkCommonCore import vtkPoints, vtkIdTypeArray, vtkDataArray
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellData, vtkCell, vtkCellTypes,
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellData, vtkCell, vtkCellTypeUtilities,
VTK_TRIANGLE, VTK_QUAD, VTK_TETRA, VTK_HEXAHEDRON, VTK_PYRAMID, VTK_WEDGE,
VTK_POLYHEDRON, VTK_POLYGON )
from vtkmodules.util.numpy_support import numpy_to_vtk, vtk_to_numpy
Expand Down Expand Up @@ -156,7 +156,7 @@ def applyFilter( self: Self ) -> None:
if splitMethod is not None:
splitMethod( cell, c )
else:
raise TypeError( f"Cell type { vtkCellTypes.GetClassNameFromTypeId( cellType ) } is not supported." )
raise TypeError( f"Cell type { vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ) } is not supported." )

# Add points and cells
self.outputMesh.SetPoints( self.points )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing_extensions import Self
from vtkmodules.vtkCommonCore import vtkIntArray
from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid, vtkCell, vtkTable, vtkCellTypes, VTK_VERTEX
from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid, vtkCell, vtkTable, vtkCellTypeUtilities, VTK_VERTEX

from geos.mesh.model.CellTypeCounts import CellTypeCounts
from geos.mesh.stats.meshQualityMetricHelpers import getAllCellTypes
Expand Down Expand Up @@ -116,7 +116,7 @@ def applyFilter( self: Self ) -> None:
# Create columns per types
for cellType in getAllCellTypes():
array: vtkIntArray = vtkIntArray()
array.SetName( vtkCellTypes.GetClassNameFromTypeId( cellType ) )
array.SetName( vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ) )
array.SetNumberOfComponents( 1 )
array.SetNumberOfValues( 1 )
array.SetValue( 0, self._counts.getTypeCount( cellType ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from vtkmodules.vtkCommonCore import ( vtkIdList, vtkPoints, vtkDataArray, vtkIntArray, vtkDoubleArray, vtkIdTypeArray,
vtkMath )
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkPolyData, vtkCellData, vtkPointData, vtkFieldData,
vtkCell, vtkCell3D, vtkTetra, vtkCellTypes, vtkPolygon, VTK_TRIANGLE,
vtkCell, vtkCell3D, vtkTetra, vtkCellTypeUtilities, vtkPolygon, VTK_TRIANGLE,
VTK_QUAD, VTK_TETRA, VTK_PYRAMID, VTK_HEXAHEDRON, VTK_WEDGE, VTK_POLYGON,
VTK_POLYHEDRON )
from vtkmodules.util.numpy_support import vtk_to_numpy, numpy_to_vtk
Expand Down Expand Up @@ -605,7 +605,7 @@ def _createFieldDataStatsSummary( self: Self ) -> None:
count: int = self._qualityMetricSummary.getCellTypeCountsOfCellType( cellType )
metrics: Optional[ set[ int ] ] = self.getComputedMetricsFromCellType( cellType )
# Create count array
name = "_".join( ( vtkCellTypes.GetClassNameFromTypeId( cellType ), StatTypes.COUNT.getString() ) )
name = "_".join( ( vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ), StatTypes.COUNT.getString() ) )
countArray: vtkIntArray = vtkIntArray()
countArray.SetName( name )
countArray.SetNumberOfValues( 1 )
Expand Down Expand Up @@ -641,7 +641,7 @@ def _createArrayName( self: Self, cellType: int, metricIndex: int, statType: Sta
Returns:
str: Array name
"""
return "_".join( ( vtkCellTypes.GetClassNameFromTypeId( cellType ),
return "_".join( ( vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ),
getQualityMeasureNameFromIndex( metricIndex ).replace( " ", "" ), statType.getString() ) )

def _computeAdditionalMetricsCell( self: Self, metricIndex: int, cell: vtkCell ) -> float:
Expand Down
8 changes: 4 additions & 4 deletions geos-processing/tests/test_CellTypeCounterEnhanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from geos.processing.pre_processing.CellTypeCounterEnhanced import CellTypeCounterEnhanced
from geos.mesh.model.CellTypeCounts import CellTypeCounts

from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellTypes, vtkCell, VTK_TRIANGLE, VTK_QUAD,
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellTypeUtilities, vtkCell, VTK_TRIANGLE, VTK_QUAD,
VTK_TETRA, VTK_VERTEX, VTK_POLYHEDRON, VTK_POLYGON, VTK_PYRAMID,
VTK_HEXAHEDRON, VTK_WEDGE )

Expand Down Expand Up @@ -49,7 +49,7 @@ def __generate_test_data_single_cell() -> Iterator[ TestCase ]:
yield TestCase( mesh )


ids: list[ str ] = [ vtkCellTypes.GetClassNameFromTypeId( cellType ) for cellType in cellType_all ]
ids: list[ str ] = [ vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ) for cellType in cellType_all ]


@pytest.mark.parametrize( "test_case", __generate_test_data_single_cell(), ids=ids )
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_CellTypeCounterEnhanced_single( test_case: TestCase ) -> None:
for i, elementType in enumerate( elementTypes ):
assert int(
countsObs.getTypeCount( elementType )
) == counts[ i ], f"The number of {vtkCellTypes.GetClassNameFromTypeId(elementType)} should be {counts[i]}."
) == counts[ i ], f"The number of {vtkCellTypeUtilities.GetClassNameFromTypeId(elementType)} should be {counts[i]}."

nbPolygon: int = counts[ 0 ] + counts[ 1 ]
nbPolyhedra: int = np.sum( counts[ 2: ], dtype=int )
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_CellTypeCounterEnhanced_multi( test_case: TestCase ) -> None:
for i, elementType in enumerate( elementTypes ):
assert int(
countsObs.getTypeCount( elementType )
) == counts[ i ], f"The number of {vtkCellTypes.GetClassNameFromTypeId(elementType)} should be {counts[i]}."
) == counts[ i ], f"The number of {vtkCellTypeUtilities.GetClassNameFromTypeId(elementType)} should be {counts[i]}."

nbPolygon: int = counts[ 0 ] + counts[ 1 ]
nbPolyhedra: int = np.sum( counts[ 2: ], dtype=int )
Expand Down
6 changes: 3 additions & 3 deletions geos-processing/tests/test_MeshQualityEnhanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from geos.mesh.model.QualityMetricSummary import QualityMetricSummary

from vtkmodules.vtkFiltersVerdict import vtkMeshQuality
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellData, vtkFieldData, vtkCellTypes, VTK_TRIANGLE,
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellData, vtkFieldData, vtkCellTypeUtilities, VTK_TRIANGLE,
VTK_QUAD, VTK_TETRA, VTK_PYRAMID, VTK_WEDGE, VTK_HEXAHEDRON )
from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridReader

Expand Down Expand Up @@ -148,7 +148,7 @@ def test_MeshQualityEnhanced( test_case: TestCase ) -> None:
for i, cellType in enumerate( getAllCellTypesExtended() ):
metrics: Optional[ set[ int ] ] = meshQualityEnhancedFilter.getComputedMetricsFromCellType( cellType )
if test_case.cellTypeCounts[ i ] > 0:
assert metrics is not None, f"Metrics from {vtkCellTypes.GetClassNameFromTypeId(cellType)} cells is undefined."
assert metrics is not None, f"Metrics from {vtkCellTypeUtilities.GetClassNameFromTypeId(cellType)} cells is undefined."

# test attributes
outputMesh: vtkUnstructuredGrid = meshQualityEnhancedFilter.getOutput()
Expand Down Expand Up @@ -176,7 +176,7 @@ def test_MeshQualityEnhanced( test_case: TestCase ) -> None:
for i, cellType in enumerate( getAllCellTypesExtended() ):
# test Counts
assert stats.getCellTypeCountsOfCellType( cellType ) == test_case.cellTypeCounts[
i ], f"Number of {vtkCellTypes.GetClassNameFromTypeId(cellType)} cells is expected to be {test_case.cellTypeCounts[i]}"
i ], f"Number of {vtkCellTypeUtilities.GetClassNameFromTypeId(cellType)} cells is expected to be {test_case.cellTypeCounts[i]}"
if stats.getCellTypeCountsOfCellType( cellType ) == 0:
continue

Expand Down
8 changes: 4 additions & 4 deletions geos-processing/tests/test_SplitMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest
from typing import Iterator
from vtkmodules.util.numpy_support import vtk_to_numpy
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellData, vtkCellTypes, VTK_TRIANGLE,
from vtkmodules.vtkCommonDataModel import ( vtkUnstructuredGrid, vtkCellArray, vtkCellData, vtkCellTypes, vtkCellTypeUtilities, VTK_TRIANGLE,
VTK_QUAD, VTK_TETRA, VTK_HEXAHEDRON, VTK_PYRAMID )
from vtkmodules.vtkCommonCore import vtkPoints, vtkIdList, vtkDataArray
from geos.mesh.io.vtkIO import readUnstructuredGrid
Expand Down Expand Up @@ -131,7 +131,7 @@ def __generate_split_mesh_test_data() -> Iterator[ TestCase ]:
yield TestCase( cellType, mesh, pointsExp, cellsExp )


ids = [ vtkCellTypes.GetClassNameFromTypeId( cellType ) for cellType in cell_types_all ]
ids = [ vtkCellTypeUtilities.GetClassNameFromTypeId( cellType ) for cellType in cell_types_all ]


@pytest.mark.parametrize( "test_case", __generate_split_mesh_test_data(), ids=ids )
Expand All @@ -141,7 +141,7 @@ def test_single_cell_split( test_case: TestCase ) -> None:
Args:
test_case (TestCase): test case
"""
cellTypeName: str = vtkCellTypes.GetClassNameFromTypeId( test_case.cellType )
cellTypeName: str = vtkCellTypeUtilities.GetClassNameFromTypeId( test_case.cellType )
splitMeshFilter: SplitMesh = SplitMesh( test_case.mesh )
splitMeshFilter.applyFilter()
output: vtkUnstructuredGrid = splitMeshFilter.getOutput()
Expand All @@ -160,7 +160,7 @@ def test_single_cell_split( test_case: TestCase ) -> None:
test_case.cellsExp ), f"Number of cells is expected to be {len(test_case.cellsExp)}."
# check cell types
types: vtkCellTypes = vtkCellTypes()
output.GetCellTypes( types )
output.GetDistinctCellTypes( types )
assert types is not None, "Cell types must be defined"
typesArray: npt.NDArray[ np.int64 ] = vtk_to_numpy( types.GetCellTypesArray() )

Expand Down
Loading