|
From: Derek G. <fri...@gm...> - 2007-06-05 17:29:07
|
Very nice! I'll give it a whirl...
I also often forget to write out xda files and have to rerun the problem ;-)
Derek
On 6/5/07, John Peterson <pet...@cf...> wrote:
> Hi,
>
> It's possible to read in a GMV file and solutions.
> Sample code:
>
> {
> Mesh mesh(dim);
> GMVIO gmvio(mesh);
> gmvio.read("meshfile.gmv");
> }
>
> If there were solution fields in the GMV file they
> were read in as well and are now stored in the GMV
> object. Suppose you later created an EquationSystems
> object based on this mesh:
>
> {
> EquationSystems es(mesh);
>
> TransientLinearImplicitSystem & heat_system =
> es.add_system<TransientLinearImplicitSystem> ("HeatSystem");
>
> heat_system.add_variable ("T", FIRST);
>
> es.init();
> }
>
> Then, you can copy the solution you read in
> from the GMV file to the EquationSystems object:
>
> {
> gmvio.copy_nodal_solution(es);
> }
>
> I did it in stages like this because you can't initialize the
> EquationSystems without the mesh, and you can't easily put the
> solution data into the EquationSystems object before it has been
> initialized.
>
> Note that there isn't much information stored in a GMV file: only
> nodal (or cell, which I didn't support yet) data values, so this
> feature is limited to reading in linear, Lagrange elements (sorry
> Roy!).
>
> If you wrote out a quadratic solution to a GMV file, it was probably
> written out as linear sub-elements, so this is what will be read back
> in, not your nice original quadratic solution. It will also probably
> completely break on non-conforming (AMR) GMV files, I haven't even
> tested that yet.
>
> I mainly wrote this was to be able to post-process uniform GMV files
> for which I forgot to also write out the xda files. I hope it will
> be useful for that, and maybe other stuff.
>
> -John
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Libmesh-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libmesh-devel
>
|