← Back to team overview

dolfin team mailing list archive

Re: [Question #159696]: Saving 1-d solution in simple text format

 

Question #159696 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/159696

Martin Sandve Alnæs proposed the following answer:
On 31 May 2011 13:58, Anders Logg <logg@xxxxxxxxx> wrote:
> On Tue, May 31, 2011 at 06:55:50AM -0000, Praveen C wrote:
>> Question #159696 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/159696
>>
>>     Status: Answered => Open
>>
>> Praveen C is still having a problem:
>> Thats close. I need to save the degree of freedom (u) and its associated
>> location (x). I dont know how to access these from the solution u and
>> the mesh.
>
> Just call u.vector().array() and you will get a NumPy array that you
> can iterate over.

And mesh.coordinates() to get a NumPy array with the coordinates.
For linear Lagrange, the numberings should match.

Martin

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.


References