Usage of nodes/elements IDs versus indices on CAE readers

Roberta Varela_20843
Roberta Varela_20843 New Altair Community Member
edited March 2021 in Altair HyperWorks

Hello, Community!

It is usually confusing to understand the difference between nodal/elemental IDs versus indices - usually users ask "why is my node with ID 10 not understood in my CAE reader?" or "the CAE reader is retrieving the wrong value for that specific ID, why is that?"

In order to understand how to answer these questions, first of all, we need keep in mind that the 1st element/node of a model does not necessarily have ID = 1. We could have a model with 5 elements such that it is organized like this:

  • E1: 1st element
  • E10: 2nd element
  • E12: 3rd element
  • E15: 4th element
  • E20: 5th element

And you may want to refer to the node/element ID or to its index in the CAE reader, which is different.

With that said, now to the very common issue when using different syntax approaches to read nodal/elemental data using the CAE readers:

Syntax that works:

  • mylist = {'E1','E10','E12'} works fine because you are passing a list of non-numeric values (E1, E10 and E12), which is a cell, and therefore you should use {}
  • mylist = [1:3] works fine because you are passing a list of numeric values (1st to 3rd elements in the model), which is a matrix, and therefore you should use []

Syntax that does not work:

  • mylist = ['E1','E10','E12'] does not work because [] are used for numeric data in matrices, and not for cells

Another tip: when indices are used, of course they are limited to the number of elements/nodes in the model. It does not make sense to query the 1000th element if the model has only 999 elements - although the ID 1000 may be there, its index is different from that.

Regards,

Roberta

Tagged: