I have read the help about select statements but unfortunatly I cannot figure out how it works for my purpose.
Here is my problem and probably there is an easy way to do this
I have an existing hexahedral mesh from an INP file.
When I import this mesh and check the quality, there are some hex elements with a negative scaled jacobian quality. I can visualize these with this command easily: quality element all scaled jacobian high 0 draw mesh
Now I would like to get all Element IDs of these by a command - actually, it would be perfect if I can have a list of IDs in a python script so I can then modify the bad elements later.
thank you for your help on my previous topics, I really appreciate your effort!
In Python there is a method get_quality_value() that can return the quality value for a given element. You could simply loop through all elements in your mesh and store the value in a list or NumPy array.
thank you for your quick and helpful support!
This works basically, but I need to have my element IDs as in the INP file, therefore I would do a sequence of the following:
loop through all element IDs
cubit.cmd("select element [elementID]");
hexID = cubit.get_selected_id(0);
quality = cubit.get_quality_value("hex",hexID,"scaled jacobian");
check quality and save it ...
loop end
Is there an āeasierā way to do that?
I tried it with quality = cubit.get_quality_value("element",elementID,"scaled jacobian")
but it didnāt work, return value is 0.0
# Get all the (Cubit) Hex Ids in a volume
hexID = cubit.get_volume_hexes(1)
# Initialize list to store element information
abaID = []
quality = []
for i in range(0,len(hexID)):
# If you need the Abaqus ID, I think this should work
abaID.append(cubit.get_global_element_id("hex", hexID[i]))
# Query the current hex element's quality
quality.append(cubit.get_quality_value("hex", hexID[i], "scaled jacobian"))