dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

Support Meshtag IO for more types (only `int32_t` is supported at present)

Open jorgensd opened this issue 4 years ago • 8 comments

The meshtag IO is limited to int32, while the meshtags support int8, int32, int64 and double. Is there a particular reason for this?

jorgensd avatar Dec 13 '20 16:12 jorgensd

I do not see any. Just XDMFFile::write_meshtags must be made templated and header-only then. With proper write_meshtags_int32, write_meshtags_int8, etc generated in pybind and automatically dispatched based on datatype in python public interface.

michalhabera avatar Dec 13 '20 16:12 michalhabera

Simplicity. Is there a compelling reason/need to support int8_t and int64_t in IO?

Is there a current use case for double?

garth-wells avatar Dec 14 '20 18:12 garth-wells

Simplicity. Is there a compelling reason/need to support int8_t and int64_t in IO?

Is there a current use case for double?

I was currently planning to use the double one as a workaround for visualizing DG 0 functions, as we are lacking this functionality.

jorgensd avatar Dec 14 '20 18:12 jorgensd

@jorgensd do we have this now?

garth-wells avatar Jul 13 '22 17:07 garth-wells

@garth-wells we do not

jorgensd avatar Jul 13 '22 18:07 jorgensd

Is this still needed? It would be fairly easy to add more types (which? just double?)

chrisrichardson avatar Jul 21 '23 10:07 chrisrichardson

We should at least support float/double, as some use-cases read material parameters from the mesh .

Ref:

https://fenicsproject.discourse.group/t/i-o-from-xdmf-hdf5-files-in-dolfin-x/3122/48?u=dokken

Where scalar data is actually a meshtag double object.

jorgensd avatar Jul 21 '23 10:07 jorgensd

We should add support for more types, but need to clean up the HDF5 interface first to better handle different types.

garth-wells avatar Jul 21 '23 10:07 garth-wells