1. petsc
  2. PETSc
  3. petsc
  4. Issues
Issue #32 new

Mixing real and complex computations

created an issue

Add support for mixing computations with PETSc objects that use real numbers and others that use complex

Comments (3)

  1. Jed Brown

    One approach would be to duplicate all scalar data arrays and always use typed accessors. XXGetArrayComplex() would allocate the complex array (if needed) and copy from the real side if it was not current. Copying in the other direction might also check whether the imaginary part was indeed essentially zero. Users (though sometimes not other libraries) needing array access know whether they are accessing real or complex data so they can easily call the correct accessor. The challenge of actually compiling the variations remains, but at least whatever hackery used there (macros, templates, code-generation) would not be visible to users. It's a big project however you shake it.

  2. Log in to comment