[petsc-users] real and complex numbers

Matthew Knepley knepley at gmail.com
Sun Mar 18 10:17:02 CDT 2012


On Sun, Mar 18, 2012 at 9:43 AM, Xavier Garnaud <
xavier.garnaud at ladhyx.polytechnique.fr> wrote:

> Dear PETSc team,
>
> I am performing nonlinear and linearized computations. Nonlinear
> computations are performed using real numbers (it would be approximately
> twice slower to use complex numbers instead). For linearized computations
> however, it is much more convenient to use complex numbers. These two types
> of computations are performed separately: first a run a nonlinear
> simulation, I save the result on the disk, and then I load it in a
> different code to perform linear operations.
> I would therefore like to be able to use VecView using a  version of PETSc
> compiled with real numbers and VecLoad using a version compiled for complex
> numbers. I would like to do this using binary or HDF5 format. I tried to
> create a real vector with twice the size of my non-linear result and fill
> every other element with a 0, but it does not work. Is there a way to do
> this using existing functions?
> Thank you very much,
>

I think the easiest thing to do here is write a custom viewer (start with
binary) to writes complex numbers.

   Matt


> Sincerely,
>
> Xavier
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120318/1513c27c/attachment.htm>


More information about the petsc-users mailing list