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

[email protected]
Skype: fmglcaimmi (please arrange meetings by e-mail)
GPG Public Key : http://goo.gl/64dDo

Reply via email to