dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

ADIOS2-based writers don't support single precision functions

Open IgorBaratta opened this issue 3 years ago • 1 comments

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.

IgorBaratta avatar Sep 23 '22 12:09 IgorBaratta

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.

garth-wells avatar Sep 23 '22 14:09 garth-wells