I want to make a post to document the issues I’ve encountered while using sgio. In case others have encountered the same issues they can refer to this post.
The issues I’ve encountered using sgio are:
-
Does not work with material orientation defined using “Orientations“ in Abaqus, but works with “Composite Layup.“ For now, only use “Composite Layup” to define material orientation in Abaqus. I think this issue will be resolved in the future according to Dr. @su.tian.22 (refer to his post ABAQUS-SwiftComp GUI Issues - #17 by su.tian.22 )
-
Some element types may not be supported by meshio. This is not a bug from sgio but a limitation of the meshio package. You may encounter a key error like this
Traceback (most recent call last):
...
File “d:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\meshio_mesh.py”, line 147, in
init
cell_block = CellBlock(
^^^^^^^^^^
File “d:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\meshio_mesh.py”, line 100, in
init
self.dim = topological_dimension[cell_type]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: ‘tetra15’
This means element type “tetra15“ is not supported. This is what I did:
In themeshio
package, go tomeshio/_mesh.py
, add one line totopological_dimension
topological_dimension = {
# …
“tetra10”: 3,
“tetra15”: 3, # ← add this
“hexahedron27”: 3,
# …
}
then go tomeshio/_common.py
, and add one line tonum_nodes_per_cell
num_nodes_per_cell = {
# …
“tetra10”: 10,
“tetra15”: 15, # ← add this
# …
}
This adds the element type to meshio. After doing the modification above, I still encountered this error:
Traceback (most recent call last):
…
File “d:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\iofunc\gmsh_gmsh41.py”, line 472, in _write_elements
cell_type = _meshio_to_gmsh_type[cell_block.type]
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: ‘tetra15’
So it turns out you can’t write the element type “tetra15” to a Gmsh.msh
file because Gmsh has no element ID for a 15-node wedge element. Basically, Gmsh does not support this type of element. -
Cannot process inp file when the node has gap between them. For example, your node in your inp file might be “1, 2, 5, 6, 7“ but sgio always assumes no gap, which means nodes must be numbered as “1, 2, 3, 4, 5.“ If there is gap between nodes in your inp file as Abaqus sometimes writes the inp file with gaps, sgio will still run but sgio does not renumber the nodes to eliminate such gaps, so when you run SwiftComp with sc file produced by sgio, SwiftComp will complain about some nodes do not exist. This happens because in the sc file prepared by sgio, the node numbering is still “1, 2, 5, 6, 7“ but the total number of nodes is 5, so SwiftComp will try to retrieve the node with the label 6, then it exceeds the total number of nodes, thus throwing an error.
An easy solution to this is to use Mesh Edit → Node → Renumbering (note that “Renumbering“ is only available for an orphan mesh, so you can either create an orphan mesh by disassociating the mesh from the geometry or by importing inp file as a new model) in Abaqus, and set the starting number as 1 and increment as 1. This will solve the node numbering issues using sgio.