← Back to team overview

dolfin team mailing list archive

Re: New xml io

 

On Sat, Apr 25, 2009 at 7:26 AM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>
>
> Ola Skavhaug wrote:
>>
>> 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;
>>
>
> Is the final intention that the XML file for a MeshFunction will contain the
> mesh and a list of variables, or just a list of variables? If it's the
> latter, then FunctionPlotData could be generalised to handle MeshFunctions
> to faciliate plottting via viper.

That's a good idea. I don't like that we save both the mesh and the
meshfunction when writing a meshfunction to file. If we use
functionplotdata instead, the meshfunction and mesh is more naturally
stored together.

Ola

>
> Garth
>
>> 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