On Tue, 12 May 2015 13:33:30 +0000 (UTC) Bou Mi <[email protected]> wrote:
> Hello, > I begin in Fenics and i need your help please, can you explain me > this part of program please, and is array a fonction of fenics or > python? Thanks a lot array() is a member function of some DOLFIN objects, e.g. GenericMatrix, GenericVector, and returns (dense) NumPy array representation. numpy.abs(u_e_array - u_array).max() is l^1 norm of the difference u_e - u. Nevertheless this way of computing it is not recommended. One can avoid NumPy manipulation at all using just GenericVector interface. Sometimes, NumPy interface provides flexible, easy way of trying things, especially while debugging, but usually involves an extra copy and is problematic in parallel. Jan > > > u_e = interpolate(u0, V) > u_e_array = u_e.vector().array() > u_array = u.vector().array() > print 'Max error, t=%-10.3f:' % t, numpy.abs(u_e_array - > u_array).max() > > t += dt > u_1.assign(u) > _______________________________________________ > fenics-support mailing list > [email protected] > http://fenicsproject.org/mailman/listinfo/fenics-support _______________________________________________ fenics-support mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics-support
