Python to PrePoMax workflow

I created a simple mesh in python using the meshio library. Then, I was trying to export as an .inp file and import it into PrePoMax, but I get the error “There were errors while importing the file” (element R3D3 is not supported).

Is there any list of Abaqus-like element types available in PrePoMax?

Has anyone tried the workflow python → PrePoMax? Python for the geometry and/or mesh creation, PrePoMax for pre-processing, solving and post-processing. Any recommendations?

Here’s the code used in my example (not working):

import meshio

points = [
    [0.0, 0.0],
    [1.0, 0.0],
    [0.0, 1.0],
    [1.0, 1.0],
]
cells = [
    ("triangle", [[0, 1, 2], [1, 3, 2]]),
]
mesh = meshio.Mesh(points, cells)

output_file = "D:\\FEM\\Calculix\\Tests\\meshio-to-prepomax.inp"
mesh.write(output_file)

Check the list of elements available in CalculiX (https://www.dhondt.de/ccx_2.21.pdf, chapter 6.2. Element types) - rigid elements are not among them. Then the elements supported by PrePoMax are pretty much all up to axisymmetric ones - 1D elements are not supported (apart from a few of them used in predefined constraints).

1 Like
1 Like

In the end it was a problem of the type of element indicated in the inp file. First, I got it working by just changing the element type manually. For instance, in a set hexadron elements I made sure to include C3D8, which is included in Calculix:

*Element, Type=C3D8

Later on, I just slightly modified the meshio library in my local virtual environment to remove non-valid elements in Calculix while exporting to inp Abaqus files. Now, I can export meshes from python to inp files.