dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #14418
Re: numbering of nodes for Function.vector().get()
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.
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
>
Follow ups
References