dolfinx
dolfinx copied to clipboard
ADIOS2-based writers don't support single precision functions
The precision of functions (be it real or complex) is fixed:
class ADIOS2Writer
{
public:
/// Typedefs
using Fdr = fem::Function<double>;
/// Typedefs
using Fdc = fem::Function<std::complex<double>>;
/// Typedefs
using U = std::vector<
std::variant<std::shared_ptr<const Fdr>, std::shared_ptr<const Fdc>>>;
...
We can modify ADIOS2Writer to be have the scalar type as its template parameter.
Could we just add float and std::complex<float> to the variant types? Obvious approach is the template, over the Function, but then all the code goes into the header file and we loose the visitor pattern from 'expands' the complex case into real and imaginary parts.