Element coordinate system

Hi everyone,
I have meshed a model in Cubit . I wish to retrieve the element coordinate system for individual mesh. Is there a way to do so using the CUBIT COMMAND LINE ? Additionally, can it also be done using python interface?

Alternatively, I can re-frame the above question, if it is possible to obtain the local mesh orientation in the form of three vector directions for a 3D mesh using command line & python script ?

I would highly appreciate any suggestion in this regard :slightly_smiling_face:

With warm wishes,
Aakash Dhar Dwivedi

Welcome @Aakash!

I have a few questions about your question.

  1. By “local mesh orientation” do you mean to use this for assigning a material orientation? Do you wish to assign a “local coordinate system” to mesh entities for this purpose?

  2. For a general mesh / element, there is no single “local mesh orientation”. Am I correct in assuming that you are interested in capturing the local coordinate system at the center of the element? Essentially, evaluating the Jacobian at the parametric-center of the element?

For the second point, you’ll probably want to know the element local node ordering so you can build the basis / compute the Jacobian. To do this you can build a single element on a geometry that reflects the parametric shape of the element and use the Python interface to determine local node ordering. Example for hex:

cubit.cmd("reset")
cubit.cmd("brick x 2")
cubit.cmd("vol 1 interval 1")
cubit.cmd("mesh vol 1")

node_ids = cubit.get_entities("node")
node_loc = []
for n in node_ids:
  node_loc.append(cubit.get_nodal_coordinates(n))

elem_conn = cubit.get_connectivity("hex", 1)

Printing node_loc shows:

[( 1, -1,  1),
 ( 1,  1,  1),
 (-1,  1,  1),
 (-1, -1,  1),
 ( 1,  1, -1),
 ( 1, -1, -1),
 (-1, -1, -1),
 (-1,  1, -1)]

and printing elem_conn shows:

(4, 7, 8, 3, 1, 6, 5, 2)

This can be visualized in the image below, where the black numbers & coordinates represent the local node-ordering and parametric coordinates, and the orange reflect the global coordinate system and global node-ids. Importantly, these are the local node orderings in Cubit – on export, these may have a different ordering depending on what code you’re exporting to (though the global node ids should remain consistent).

From there, you should be able to evaluate the coordinate system at each element’s center using Python to evaluate the Jacobian and apply it to the parametric coordinate system, which I think is what you want.

Thank you for your reply Mr. Greg Vernon. I will look into your explanation and shall be right back.

With warm regards,
Aakash

This was quite helpful. Thank you very much for your efforts.