[petsc-users] Python version of VecDuplicateVecs

Matthew Knepley knepley at gmail.com
Wed Jul 19 07:25:39 CDT 2023


On Wed, Jul 19, 2023 at 7:59 AM Karsten Bolding <
karsten at bolding-bruggeman.com> wrote:

> Hello
>
> I'm re-implementing a model from mixed C/Fortran to Python where Petsc is
> used for matrix/vector operations.
>
> In the C-code I have:
> ierr = VecDuplicateVecs(templateVec,numTracers,&uef);
> to create uef with numTracers vectors.
>
> Later in the code looping is done of the individual vectors and a sequence
> of operations are performed.
>
> I would like to follow the same idea in Python - but do not find any
> example.
>
> An alternative would be to make a list of Vecs?
>

There is no optimization here, so I would just make a list of duplicates.

  Thanks,

     Matt


> Best Regards,
> Karsten
>
> --
> Karsten Bolding
> karsten at bolding-bruggeman.com
> +4564422058
>


-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230719/7e0f5656/attachment.html>


More information about the petsc-users mailing list