Matthew Knepley writes:
>> What do you mean? How to let mumps solve with a real matrix and a complex
>> rhs?
>>
>
> Two solves.
It can be one solve with two right-hand sides, which should cost about the same
as a solve with one right-hand side (because solves are memory
bandwidth-limited on t
;>>>>>>> explain below.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> I still need to understand how MatRealPart works. Does it
>>>>>>>&g
t;>>>>>>> allocate and store them. Thus you cannot talk about just the
>>>>>>>>>>>> memory to
>>>>>>>>>>>> store imaginar
>>>>> image memory?
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> When we have complex values, we use the "complex" type to
>>>>>>>>>>>>
parts of all the matrix elements
>>>>>>>>>>> to zero.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> If my input matrix A is real, how do I create a shell matrix to
>>>&g
to
>>>>>>>>>>> matrix -vector multiplication y=A*x where A is real, PestcScalar =
>>>>>>>>>>> complex,
>>>>>>>>>>> x and y are Vec? I notice there is a VecRealPart but it seems it
>>>>>>>>>>> just zeros
>>>>>>
>>>>>>>>>> you comment on it?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> What you suggest would mean rewriting the matrix multiplication
>>>>>>>>> algorit
e. real
> and imaginary part)
>
>
>> On May 26, 2020, at 11:28 PM, Sam Guo > <mailto:sam@cd-adapco.com>> wrote:
>>
>> complex version is needed since matrix sometimes is real and sometimes is
>> complex. I want to solve real matrix with
y really your
>>>>>>>> limiting factor? Even if you tried to do this with templates, the
>>>>>>>> memory
>>>>>>>> from temporaries would be very hard to control.
>>&
rix multiplication
>>>>>>>> algorithm by hand after extracting the values. I am not sure if this
>>>>>>>> is really what you want to do. Is the matrix memory really your
>>>>>>>> limiting factor? Even if you tried to do this with templates, the
>>>>>>>> memory
>>&g
t;>>>>
>>>>>>>> Thanks,
>>>>>>>> Sam
>>>>>>>>
>>>>>>>> PetscScalar *px = nullptr;
>>>>>>>> VecGetArrayRead(x, &px);
>>>>
localSize);
>>>>>>> std::vector realX(localSize); // I am using c++ to call
>>>>>>> PETSc
>>>>>>>
>>>>>>> //retrieve real part
>>>>>>> for(int i = 0; i < localSize; i++) realX[i] = PetscRealPa
gt;>>>>>
>>>>>> //retrieve real part
>>>>>> for(int i = 0; i < localSize; i++) realX[i] = PetscRealPart(px[i]);
>>>>>>
>>>>>> // do real matrix-vector multiplication
>>>>>> // realY=A*realX
&
;py);
>>>>>
>>>>> On Tue, May 26, 2020 at 1:49 PM Sam Guo wrote:
>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> On Tuesday, May 26, 2020, Stefano Zampini
>>>>>> wrote:
>>>>>&g
ry
>> part((except eigen pairs).
>>
>> On Tuesday, May 26, 2020, Zhang, Hong > <mailto:hzh...@mcs.anl.gov>> wrote:
>> You can build PETSc with complex version, and declare some variables as
>> 'PETSC_REAL'.
>> Hong
>>
>> From:
ay 26, 2020, Stefano Zampini
>>>>> 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
>>
;>>> On Tuesday, May 26, 2020, Stefano Zampini
>>>>> wrote:
>>>>>
>>>>>> All the solvers/matrices/vectors works for PetscScalar types (i.e. in
>>>>>> your case complex)
>>>>>> If you need to solve for the re
e 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
d 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 wrote:
>>>>
>>>> complex version is needed since matrix sometimes is real and sometim
ometimes
>>> is complex. I want to solve real matrix without allocating memory for
>>> imaginary part((except eigen pairs).
>>>
>>> On Tuesday, May 26, 2020, Zhang, Hong wrote:
>>>
>>>> You can build PETSc with complex version, and declare some variables
>>>> as &
ry part((except eigen pairs).
>>
>> On Tuesday, May 26, 2020, Zhang, Hong wrote:
>>
>>> You can build PETSc with complex version, and declare some variables as
>>> 'PETSC_REAL'.
>>> Hong
>>>
>>> ------
gt; Hong
>>
>> --
>> *From:* petsc-users on behalf of Sam
>> Guo
>> *Sent:* Tuesday, May 26, 2020 1:00 PM
>> *To:* PETSc
>> *Subject:* [petsc-users] using real and complex together
>>
>> Dear PETSc dev team,
>>Can I use both real and complex versions together?
>>
>> Thanks,
>> Sam
>>
>
>
..@mcs.anl.gov>> on behalf of Sam Guo
> mailto:sam@cd-adapco.com>>
> Sent: Tuesday, May 26, 2020 1:00 PM
> To: PETSc mailto:petsc-users@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
gt;
> From: petsc-users <mailto:petsc-users-boun...@mcs.anl.gov>> on behalf of Sam Guo
> mailto:sam@cd-adapco.com>>
> Sent: Tuesday, May 26, 2020 1:00 PM
> To: PETSc mailto:petsc-users@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
les as
> 'PETSC_REAL'.
> Hong
>
> --
> *From:* petsc-users on behalf of Sam
> Guo
> *Sent:* Tuesday, May 26, 2020 1:00 PM
> *To:* PETSc
> *Subject:* [petsc-users] using real and complex together
>
> Dear PETSc dev team,
>
You can build PETSc with complex version, and declare some variables as
'PETSC_REAL'.
Hong
From: petsc-users on behalf of Sam Guo
Sent: Tuesday, May 26, 2020 1:00 PM
To: PETSc
Subject: [petsc-users] using real and complex together
Dear PETSc dev te
Dear PETSc dev team,
Can I use both real and complex versions together?
Thanks,
Sam
27 matches
Mail list logo