Skip to content

VtkData has_cell_data function uses wrong function to get the number of arrays #520

@javijv4

Description

@javijv4

Description

The function VtkVtpData::has_cell_data and VtkVtuData::has_cell_data (lines 801 and 1060 in VtkData.cpp) define the number of arrays as:

int num_arrays = impl->vtk_ugrid->GetPointData()->GetNumberOfArrays();

when it should be

int num_arrays = impl->vtk_polydata->GetCellData()->GetNumberOfArrays();

Reproduction

There is currently no test that checks the implementation. These functions are called when a domain is specified using a .vtu or .vtp file.

Expected behavior

Change the code in VtkData.cpp to use GetCellData().
Should we add a test? Maybe the one @msbazzi sent in #363. I can modify the one I added in #504 to use .vtu. That way, we would have a solid and EP test of this.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions