[petsc-users] [petsc4py] dm/examples/tutorials/ex2 in python

Francesco Caimmi francesco.caimmi at polimi.it
Thu Jun 4 10:42:41 CDT 2015


On Wednesday June 3 2015 at 13:50 Matthew Knepley wrote:
> > ####
> > 
> > start, end = global_vec.getOwnershipRange()
> > 
> > 
> > 
> > for i in xrange(start,end):
> > 
> > global_vec[i] = 5.0*rank
> 
> It looks like Lisandro has overloaded the [] operator to translate from
> local to global indices. I don't
> think I would recommend this since it would lock the vector for every
> entry. The code above is
> a direct numpy array access.
> 
>   Thanks,
> 
>      Matt
> 
Ok, I got it. Thank you for time and sorry for the basic question, but unfortunately 
there is very little petsc4py documentation available.

Thank you again,

-- 
Francesco Caimmi
 
Laboratorio di Ingegneria dei Polimeri
http://www.chem.polimi.it/polyenglab/

Politecnico di Milano - Dipartimento di Chimica,
Materiali e Ingegneria Chimica “Giulio Natta”

P.zza Leonardo da Vinci, 32
I-20133 Milano
Tel. +39.02.2399.4711
Fax +39.02.7063.8173

francesco.caimmi at polimi.it
Skype: fmglcaimmi (please arrange meetings by e-mail)
GPG Public Key : http://goo.gl/64dDo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150604/c93281ce/attachment.html>


More information about the petsc-users mailing list