Issue #32 new

Mixing real and complex computations

BarryFSmith avatarBarryFSmith created an issue

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

Comments (1)

  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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.