dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #22071
Re: [Question #149302]: format of vector function in matlab file
On Wed, Mar 16, 2011 at 12:56:46PM -0000, Melanie Jahny wrote:
> New question #149302 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/149302
>
> I need to print a vector valued function in a matlab-file.
> I'm using:
> V = VectorFunctionSpace(mesh, "CG", 2)
> u = TrialFunction(V)
> ...
> solution_file = File( "velocity_test.m" )
> solution_file << u.vector()
>
> For a 5x4 mesh I get a vector of 198 values.
> I'd like to know now, how these values are arranged,
> so that I can arrange them how matlab needs them.
> Is there a possibility to print only the values in x-direction of u?
The values are ordered as follows (for a 2D mesh):
x-components at all vertices in order
x-components at all edges in order
y-components at all vertices in order
y-components at all edges in order
--
Anders
References