How to set node set Ids #288
-
|
Hello I am working on converting some of my input into exodus format. Now i am stuck with defining node sets. I have some node sets in my own format. To set these into exodus format, I am using the following code node_set_ids = range(1,10)
set_nodes = [5,9]
status = my_exo.put_node_set(1, set_nodes)But unfortunately, it results in a an error saying no set with id 1 is found. I tried to set the node set ids but cannot find a suitable function to do. Can you point me to the necessary setps to do this ? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
|
When you first define the exodus model, you will tell it how many node sets the model will contain ( Then, for each of those You can then use your code above to actually output the Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
|
You might also be interested in using |
Beta Was this translation helpful? Give feedback.
-
|
@gsjaardema Sorry to revive an old thread, but what if the exodus file is already defined as having no nodesets and I want to add one? In my case I'm reading in an exodus file with the exodus python API with no node sets defined and want to add one. |
Beta Was this translation helpful? Give feedback.
-
|
It is very difficult to modify an existing file using the exodus API to add element blocks or sets. The usual way is to read an existing database, add nodesets/sidesets/blocks and then write a new database. |
Beta Was this translation helpful? Give feedback.
When you first define the exodus model, you will tell it how many node sets the model will contain (
num_ns):Then, for each of those
num_nsnodesets, you tell exodus the ID and count of nodes and distribution factors:You can then use your code above to actually output the
set_nodes. Somewhat convulted and not really pythonic, but this is driven by the C API...Hope that helps.