Mesh stats tools
The stats module of geos-mesh package contains filter to compute statistics on meshes.
geos.mesh.stats.CellTypeCounterEnhanced filter
CellTypeCounterEnhanced module is a vtk filter that computes cell type counts.
Filter input is a vtkUnstructuredGrid, output is a vtkTable
To use the filter:
from geos.mesh.stats.CellTypeCounterEnhanced import CellTypeCounterEnhanced
# filter inputs
input :vtkUnstructuredGrid
# instantiate the filter
filter :CellTypeCounterEnhanced = CellTypeCounterEnhanced()
# set input data object
filter.SetInputDataObject(input)
# do calculations
filter.Update()
# get counts
counts :CellTypeCounts = filter.GetCellTypeCountsObject()
- class geos.mesh.stats.CellTypeCounterEnhanced.CellTypeCounterEnhanced[source]
Bases:
VTKPythonAlgorithmBase
CellTypeCounterEnhanced filter computes mesh stats.
- FillInputPortInformation(port, info)[source]
Inherited from VTKPythonAlgorithmBase::RequestInformation.
- Parameters:
port (int) – Input port
info (vtkInformationVector) – Info
- Returns:
1 if calculation successfully ended, 0 otherwise.
- Return type:
int
- GetCellTypeCountsObject()[source]
Get CellTypeCounts object.
- Returns:
CellTypeCounts object.
- Return type:
- RequestData(request, inInfoVec, outInfoVec)[source]
Inherited from VTKPythonAlgorithmBase::RequestData.
- Parameters:
request (vtkInformation) – Request
inInfoVec (list[vtkInformationVector]) – Input objects
outInfoVec (vtkInformationVector) – Output objects
- Returns:
1 if calculation successfully ended, 0 otherwise.
- Return type:
int
geos.mesh.stats.MeshQualityEnhanced filter
MeshQualityEnhanced module is a vtk filter that computes mesh quality stats.
Mesh quality stats include those from vtkMeshQuality as well as .
Filter input is a vtkUnstructuredGrid.
To use the filter:
from geos.mesh.stats.MeshQualityEnhanced import MeshQualityEnhanced
# Filter inputs
input :vtkUnstructuredGrid
# Instanciate the filter
filter :MeshQualityEnhanced = MeshQualityEnhanced()
# Set input data object
filter.SetInputDataObject(input)
# Set metrics to use
filter.SetTriangleMetrics(triangleQualityMetrics)
filter.SetQuadMetrics(quadQualityMetrics)
filter.SetTetraMetrics(tetraQualityMetrics)
filter.SetPyramidMetrics(pyramidQualityMetrics)
filter.SetWedgeMetrics(wedgeQualityMetrics)
filter.SetHexaMetrics(hexaQualityMetrics)
filter.SetOtherMeshQualityMetrics(otherQualityMetrics)
# Do calculations
filter.Update()
# Get output mesh quality report
outputMesh: vtkUnstructuredGrid = filter.GetOutputDataObject(0)
outputStats: QualityMetricSummary = filter.GetQualityMetricSummary()
- class geos.mesh.stats.MeshQualityEnhanced.MeshQualityEnhanced[source]
Bases:
VTKPythonAlgorithmBase
Enhanced vtkMeshQuality filter.
- FillInputPortInformation(port, info)[source]
Inherited from VTKPythonAlgorithmBase::RequestInformation.
- Parameters:
port (int) – Input port
info (vtkInformationVector) – Info
- Returns:
1 if calculation successfully ended, 0 otherwise.
- Return type:
int
- GetQualityMetricSummary()[source]
Get QualityMetricSummary object.
- Returns:
QualityMetricSummary object
- Return type:
- RequestData(request, inInfoVec, outInfoVec)[source]
Inherited from VTKPythonAlgorithmBase::RequestData.
- Parameters:
request (vtkInformation) – Request
inInfoVec (list[vtkInformationVector]) – Input objects
outInfoVec (vtkInformationVector) – Output objects
- Returns:
1 if calculation successfully ended, 0 otherwise.
- Return type:
int
- RequestDataObject(request, inInfoVec, outInfoVec)[source]
Inherited from VTKPythonAlgorithmBase::RequestDataObject.
- Parameters:
request (vtkInformation) – Request
inInfoVec (list[vtkInformationVector]) – Input objects
outInfoVec (vtkInformationVector) – Output objects
- Returns:
1 if calculation successfully ended, 0 otherwise.
- Return type:
int
- SetCellQualityMetrics(triangleMetrics=None, quadMetrics=None, tetraMetrics=None, pyramidMetrics=None, wedgeMetrics=None, hexaMetrics=None)[source]
Set all quality metrics to compute.
- Parameters:
triangleMetrics (Iterable[int]) –
Triangle metrics to compute.
Defaults to [vtkMeshQuality.QualityMeasureTypes.NONE,].
quadMetrics (Iterable[int]) –
Quad metrics to compute.
Defaults to [vtkMeshQuality.QualityMeasureTypes.NONE,].
tetraMetrics (Iterable[int]) –
Tetrahedron metrics to compute.
Defaults to [vtkMeshQuality.QualityMeasureTypes.NONE,].
pyramidMetrics (Iterable[int]) –
Pyramid metrics to compute.
Defaults to [vtkMeshQuality.QualityMeasureTypes.NONE,].
wedgeMetrics (Iterable[int]) –
Wedge metrics to compute.
Defaults to [vtkMeshQuality.QualityMeasureTypes.NONE,].
hexaMetrics (Iterable[int]) –
Hexahedron metrics to compute.
Defaults to [vtkMeshQuality.QualityMeasureTypes.NONE,].
- SetHexaMetrics(metrics=None)[source]
Set triangle quality metrics to compute.
- Parameters:
metrics (Iterable[int]) – Metrics to compute
- SetOtherMeshQualityMetrics(metrics)[source]
Set additional metrics unrelated to cell types.
- Parameters:
metrics (set[QualityMetricOtherEnum]) – Set of QualityMetricOtherEnum
- SetPyramidMetrics(metrics=None)[source]
Set triangle quality metrics to compute.
- Parameters:
metrics (Iterable[int]) – Metrics to compute
- SetQuadMetrics(metrics=None)[source]
Set triangle quality metrics to compute.
- Parameters:
metrics (Iterable[int]) – Metrics to compute
- SetTetraMetrics(metrics=None)[source]
Set triangle quality metrics to compute.
- Parameters:
metrics (Iterable[int]) – Metrics to compute
- SetTriangleMetrics(metrics)[source]
Set triangle quality metrics to compute.
- Parameters:
metrics (Iterable[int]) – Metrics to compute
- geos.mesh.stats.MeshQualityEnhanced.QUALITY_ARRAY_NAME = 'Quality'
name of output quality array from vtkMeshQuality filter