seacas icon indicating copy to clipboard operation
seacas copied to clipboard

expose put_node_set_dist_fact and get_node_set_dist_facts in exomerge.py

Open kayarre opened this issue 5 years ago • 3 comments

currently exomerge doesn't support put_node_set_dist_fact or get_node_set_dist_facts.

I tried using: model.create_node_set_field(node_set_field_name='distribution_factors', node_set_ids='all', value=1.0) but I don't think that is the same kind of thing.

also it gives an error on export because there is not a timestep associated with the node_set_field

  File "merge_test.py", line 173, in <module>
    new_model.export_model(filename='merge.g')
  File "/home/krs/build/peridot/install/lib/exomerge.py", line 7959, in export_model
    field[timestep_index[0]])
  File "/home/krs/build/peridot/install/lib/exodus.py", line 2892, in put_node_set_variable_values
    (numSetNodes, _numSetDistFacts) = self.get_set_params(object_id, 'EX_NODE_SET')
  File "/home/krs/build/peridot/install/lib/exodus.py", line 2939, in get_set_params
    (numSetEntities, numSetDistFacts) = self.__ex_get_set_param(object_type, object_id)
  File "/home/krs/build/peridot/install/lib/exodus.py", line 4969, in __ex_get_set_param
    object_type = ctypes.c_int(get_entity_type(objType))
  File "/home/krs/build/peridot/install/lib/exodus.py", line 420, in get_entity_type
    return ex_entity_type[varType].value
  File "/home/krs/anaconda3/envs/seacas/lib/python3.7/enum.py", line 352, in __getitem__
    return cls._member_map_[name]
KeyError: 0

kayarre avatar Dec 03 '19 17:12 kayarre

create_node_set_field is not timestep aware, and therefore causes this to break if there is a timestep in the model.

kayarre avatar Dec 03 '19 18:12 kayarre

The distribution factor routines are exposed in exodus.py; is it possible to access those routines to do what you need? I will look into pushing up to exomerge.py level; but probably won’t be until later.

gdsjaar avatar Dec 05 '19 16:12 gdsjaar

Stale issue message

github-actions[bot] avatar Nov 06 '20 01:11 github-actions[bot]