[Trilinos-Users] [EXTERNAL] writing programmatically-built STK mesh and skin to exodus files

Roth, Philip C. rothpc at ornl.gov
Wed Jun 29 15:14:18 EDT 2016


Greg,

Thank you for the pointers.  Since I sent my initial request for help, and before I got your message, I ended up with both of those examples open.

As far as the low level file I/O example goes: I need to start from a point of *not* having an Exodus file to read.  I'm trying to create the STK mesh in memory without using the "generated" classes, then hopefully use the StkMeshIoBroker to write it.  I have gotten farther than before, using the replaceBulkData example for writing the BulkData that I create.  I'm still missing something in defining the mesh programmatically, however, because I'm not getting my tets in element blocks in the output file.

Thanks again for the pointers - it tells me I'm on an approach that should work.

Phil Roth



> On Jun 29, 2016, at 3:00 PM, Sjaardema, Gregory D <gdsjaar at sandia.gov> wrote:
> 
> You should be able to take a look at packages/stk/stk_io/example/io_mesh_read_write_example.cpp.  It will read an exodus file and create a stk mesh and then it will output that same stk mesh to an exodus file.  You could also look at packages/stk/stk_io/testsForDocumentation/replaceBulkData.cpp for an example of how to specify a bulk data for the StkMeshIoBroker class to use instead of the bulk data that it creates in its constructor.
> 
> The Iogn classes are for input only – it generates a mesh of the requested I, j, k intervals – either hex or tet.  It is typically used to generate a mesh for testing.
> 
> If you don’t need a stk mesh and only need to read and write a mesh, you can use the Ioss library directly.  There should be an example in packages/seacas/libraries/ioss/src/main/io_shell.C
> 
> .. Greg
> -- 
> "A supercomputer is a device for turning compute-bound problems into I/O-bound problems”
> 
> On 6/29/16, 12:47 PM, "Trilinos-Users on behalf of Roth, Philip C." <trilinos-users-bounces at trilinos.org on behalf of rothpc at ornl.gov> wrote:
> 
>> 
>> Hello,
>> 
>> I am trying to build an STK mesh programmatically, and then output it to an Exodus file.  I've been at it longer than I care to admit, with little success, and feel like I'm missing something obvious.  Perhaps someone can point me in the right direction.
>> 
>> I want to define a volumetric mesh of tet4s and write it to an Exodus file.  By following examples in the STK distribution, I *think* I can successfully build the mesh using MetaData and BulkData objects.  After that, I'm at a loss as to how to write it to an Exodus file.  I've looked at using StkMeshIoBroker but can't see a way to associate my MetaData/BulkData objects with an output mesh.  I also can't see how to use Ioss classes/functions directly to output this mesh.  At one point, I thought I might be able to use Iogn to generate a mesh that I would throw away and replace with my own, but Iogn seems to be limited in the types of mesh elements it supports and tet4s aren't supported.
>> 
>> I also need to have the exposed faces of my mesh defined as face elements.  I've seen the examples on how to skin a mesh, and have done that successfully, but because of limitations in visit's handling of Exodus files I think I need these faces to be represented as a surface mesh in a separate file, not a sideset in the 3D mesh's file.  I can't see how to convert the sideset I get from skinning the mesh to a surface of triangles in 3D space, and write that out to an Exodus file.
>> 
>> Can anyone point me in the right direction for addressing either of these problems?
>> 
>> Regards,
>> Phil Roth
>> 
>> -- 
>> Philip C. Roth | +1 865 241-1543 | http://ft.ornl.gov/~rothpc
>> 
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at trilinos.org
>> https://trilinos.org/mailman/listinfo/trilinos-users
> 

-- 
Philip C. Roth | +1 865 241-1543 | http://ft.ornl.gov/~rothpc



More information about the Trilinos-Users mailing list