[petsc-users] Complex Number - VecScale

Matthew Knepley knepley at gmail.com
Mon Apr 16 13:18:02 CDT 2012


On Mon, Apr 16, 2012 at 2:05 PM, Abdul Hanan Sheikh
<hanangul12 at yahoo.co.uk>wrote:

> Thanks! :)
>
> I have an other query.
> By using VecScale on vector "x" with scalar "alpha", it overwrites the
> vector "x" with "alpha \times x" .
> Can we re-use the vector "x" after scaling ?
>

No. If you want the original vector around,  use VecAXPY() instead.

   Matt


> thanks,
>
> Abdul
>
>   ------------------------------
> *From:* Shri <abhyshr at mcs.anl.gov>
> *To:* Abdul Hanan Sheikh <hanangul12 at yahoo.co.uk>; PETSc users list <
> petsc-users at mcs.anl.gov>
> *Sent:* Monday, 16 April 2012, 19:20
> *Subject:* Re: [petsc-users] Complex Number
>
>
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscOptionsGetScalar.html
>
> ------------------------------
>
> Dear users n devlopers,
>
> My Petsc routine contans a complex number, as a parameter of my problem.
> I need to provide it at the run time options, since I intend to test a
> variety of parameter.
> In this regard, I read that PetscScalar is the way to declare a complex
> number.
> If I need merely a complex number at run time option to compile a compact
> routine,
> any details from any examples of libraries ?
>
> Thanks in anticipation.
>
> Abdul,
>
>
>
>
>


-- 
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/20120416/0c0f08e7/attachment.htm>


More information about the petsc-users mailing list