On 12/03/2013 08:42 AM, Roy Stogner wrote:
>
> On Tue, 3 Dec 2013, David Knezevic wrote:
>
>> I'd like to write some selected elements from a mesh to disk, and to be
>> able to read them in again later to reinitialize those elements. I don't
>> need connectivity info, so the mesh IO classes seem like more than I
>> need for this.
>>
>> I was wondering if there are any "helper functions" somewhere in the
>> library that I could reuse for this?
>
> Hmm... not deliberately. UnstructuredMesh::copy_nodes_and_elements
> would need to be refactored to take iterator ranges rather than a
> whole mesh as an input, I guess.
I ended up writing a simple function that does something similar to
copy_nodes_and_elements. It copies my "selected" elements to a new
SerialMesh. I then write that mesh to disk with
mesh.write("selected_elements.xda"), and read it in elsewhere with
mesh.read("selected_elements.xda").
This seems to work fine so far.
My only question is: Can I rely on this write/read process preserving
the element and node IDs? I gather the answer is no, since libMesh may
do some renumbering, right?
Thanks,
David
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users