dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #13193
Re: New xml io
On Fri, Apr 24, 2009 at 5:04 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
> I've been looking at the new XML io with the intention of getting the
> plotting of MeshFunctions working again, but it's not clear to me what
> the intention is with the input of MeshFunctions. If 'intersection' is a
> MeshFunction<unsigned int>, if I do
>
> File file("mesh_function.xml", true);
> file << intersection;
>
> the file "mesh_function.xml" contains the XML output for a Mesh and a
> MeshFuncion (the latter being just a list of numbers). When I then try
> to read the MeshFunction,
>
> MeshFunction<unsigned int> test_function;
> file >> test_function;
>
> I get the error "what(): *** Error: Mesh has not been specified,
> unable to initialize mesh function."
>
> The new XML code look sophisticated and takes some effort to understand
> - can we clear out the old code yet so there is less to trawl through?
That's a good idea. I will start on this on Monday. For the moment,
you need to do the following:
Mesh mesh;
file >> mesh;
MeshFunction<uint> mf(mesh);
file >> mf;
I see that this is not the most elegant solution.
Ola
>
> Garth
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
--
Ola Skavhaug
Follow ups
References