← Back to team overview

dolfin team mailing list archive

Re: numbering of nodes for Function.vector().get()

 

On Wed, Jul 15, 2009 at 11:49:32AM +0200, Kristian Oelgaard wrote:
> Quoting phil marinier <lonewolf_13p@xxxxxxxxxxx>:
> 
> >
> > If I use   Function.vector().get()   to get my nodal values for a solution I
> > obviously get a 1-dimensional vector. I made sure I used    .order()     on
> > my mesh so that the numbering would be UFC standard. What I can't seem to
> > find is what the UFC global numbering standard is. I read parts of the UFC
> > user manual, but all I could find was local entity numbering with respect to
> > the global numbering.
> >
> > What I would like to end up with is a 2-dimensional array with all the nodal
> > values. I can easily convert my vector into such an array if someone can
> > point me to the numbering scheme. However, if there is an easier way to do
> > this, please let me know.

UFC does not dictate a global numbering for the degrees of freedom,
only for the local numbering of mesh entities.

If you explain which element you are using (like piecewise linears),
someone can answer exactly how the degrees of freedom are numbered.

-- 
Anders


> I'm not sure what your end goal is, but if you want to manipulate the solution
> vector one cell at a time I see two ways of doing it:
> 
> Loop the cells
> 
> 1) tabulate the dofs on each cell and the use the vectors get() methods with
> those dofs as extra arguments.
> 
> or
> 
> 2) use the functions interpolate() method to interpolate the function values on
> the current cell.
> 
> I don't know which method is best/fastest, I use 1).
> 
> Take a look at fem/Assembler.cpp.
> 
> Kristian
> 
> > Thanks for your help.
> >
> > Phil
> >
> 
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev

Attachment: signature.asc
Description: Digital signature


Follow ups

References