[Smtk-developers] Exodus bridge
David Thompson
david.thompson at kitware.com
Mon Nov 17 17:43:07 EST 2014
Hi all,
I've merged some changes to master that store element block, side set, and node set IDs on the SMTK model entities. So, in Python you can
# ... load file as in script below ...
result = rdr.operate()
model = smtk.model.ModelEntity(res.findModelEntity('model').value(0))
for group in model.groups():
print group.name(), group.stringProperty('exodus type'), group.integerProperty('exodus id')
and get
Unnamed block ID: 1 Type: HEX ['element block'] [1]
Unnamed block ID: 2 Type: HEX ['element block'] [2]
Unnamed set ID: 4 ['side set'] [4]
Unnamed set ID: 1 ['node set'] [1]
Unnamed set ID: 100 ['node set'] [100]
I am about halfway through modernizing the Hydra Python exporter script to use the new model. Once I'm done and Yumin has the association widget working we should have an end-to-end demo. (!!!)
David
> ...
> I can certainly help with the exporter part. I will call you to discuss a bit.
>
> Yumin
>
> On Mon, Nov 17, 2014 at 11:29 AM, David Thompson <david.thompson at kitware.com> wrote:
> Hi Yumin,
>
> I've pushed a simple example bridge to SMTK master that uses VTK's Exodus reader to read side and node set information in as groups. No cells (volumes/faces/edges/vertices) are included, but the blocks and sets have tessellation information. You can do this:
>
> import smtk
> mgr = smtk.model.Manager.create()
> sess = mgr.createSession('exodus')
> rdr = sess.op('read')
> rdr.findAsFile('filename').setValue('can.ex2')
> res = rdr.operate()
> me = smtk.model.ModelEntity(res.findModelEntity('model').value(0))
> print '\n'.join([x.name() for x in me.groups()])
>
> which will print this:
>
> Unnamed block ID: 1 Type: HEX
> Unnamed block ID: 2 Type: HEX
> Unnamed set ID: 4
> Unnamed set ID: 1
> Unnamed set ID: 100
>
> Because each group has a Tessellation associated with it you should be able to render the side and node sets as well as element blocks. There are a few things left to do and then we will have an end-to-end example of simulation preparation using (unaltered) Exodus files.
>
> 1. Verify that the vtkModelMultiBlockSource properly includes the tessellation information attached to the side and node sets.
> 2. Add properties to the groups from the Exodus reader's metadata (describing set IDs).
> 3. Adapt an exporter to the new model.
>
> I can do #1-2, but will need some help with #3.
>
> David
>
More information about the Smtk-developers
mailing list