Feature: [vtk][reader] Support polylines#307
Conversation
|
The following performance differences (this branch vs target branch) have been measured: |
023e3d4 to
f967893
Compare
|
The following performance differences (this branch vs target branch) have been measured: |
|
Thanks a lot for this contribution @timokoch! I am wondering though, after introducing a new cell type, I should probably also adapt the EDIT: yes I just checked the writer, it should throw an exception when polylines exist in the grid. |
So I think the dune traits are currently the only ones that provide something for reading in grids, the other traits only provide adapters for writing, and no writers support polylines so far (see #309). So this should be fine.
Interesting, I would have thought the
Do you think it makes sense to put this change into the dune grid factory provided with the |
I have a custom Factory adapter. That one is very slim. But the factory does not affect the way data fields are read. So I got a segfault because sizes don’t match up. For the fields I implemented the custom reader (essentially modifies ‘_num_cells()’ and ‘_get_cell_field(…)’). Is there a better way? |
I think on the reader side, it is fine to leave it as is, because the cells are polylines, so according to the grid file and the specified cell type, that is the number of cells, right? For instance, for cell fields, VTK would render all subsegments in the polyline with the same color right (i.e. the cell values are the same for each subsegment). But we could add an option to |
f6d4132 to
f967893
Compare
|
The following performance differences (this branch vs target branch) have been measured: |
|
The following performance differences (this branch vs target branch) have been measured: |
Add basic support for VTK polylines in the reader. Polylines with two corners are converted to a segment, so there should be no change in behavior. This does not propose yet to actually handle polylines in any of the implemented adapters. The change in the Dune traits deals with an error from the CI test suite because not all enum states are handled in a switch statement (I guess that's because of the pedantic settings in the CI?).
Based on this PR I was able to write a custom reader that handles polylines and data by splitting polylines into segments.