[petsc-users] using real and complex together

Sam Guo sam.guo at cd-adapco.com
Tue May 26 15:49:18 CDT 2020


Thanks

On Tuesday, May 26, 2020, Stefano Zampini <stefano.zampini at gmail.com> wrote:

> All the solvers/matrices/vectors works for PetscScalar types (i.e. in your
> case complex)
> If you need to solve for the real part only, you can duplicate the matrix
> and call MatRealPart to zero out the imaginary part. But the solve will
> always run in the complex space
> You should not be worried about doubling the memory for a matrix (i.e.
> real and imaginary part)
>
>
> On May 26, 2020, at 11:28 PM, Sam Guo <sam.guo at cd-adapco.com> wrote:
>
> complex version is needed since matrix sometimes is real and sometimes is
> complex. I want to solve real matrix without allocating memory for
> imaginary part((except eigen pairs).
>
> On Tuesday, May 26, 2020, Zhang, Hong <hzhang at mcs.anl.gov> wrote:
>
>> You can build PETSc with complex version, and declare some variables as
>> 'PETSC_REAL'.
>> Hong
>>
>> ------------------------------
>> *From:* petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Sam
>> Guo <sam.guo at cd-adapco.com>
>> *Sent:* Tuesday, May 26, 2020 1:00 PM
>> *To:* PETSc <petsc-users at mcs.anl.gov>
>> *Subject:* [petsc-users] using real and complex together
>>
>> Dear PETSc dev team,
>>    Can I use both real and complex versions together?
>>
>> Thanks,
>> Sam
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200526/75f6272f/attachment.html>


More information about the petsc-users mailing list