# Python to PrePoMax workflow

**URL:** <https://prepomax.discourse.group/t/python-to-prepomax-workflow/1821>\
**Category:** General Questions\
**Created:** [June 22, 2024, 5:34pm UTC](https://prepomax.discourse.group/t/python-to-prepomax-workflow/1821 "2024-06-22T17:34:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daalgi](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@daalgi](https://prepomax.discourse.group/u/daalgi)\
**Post date:** [June 22, 2024, 5:34pm UTC](https://prepomax.discourse.group/t/python-to-prepomax-workflow/1821/1 "2024-06-22T17:34:27Z")

</div>

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):

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [June 22, 2024, 5:43pm UTC](https://prepomax.discourse.group/t/python-to-prepomax-workflow/1821/2 "2024-06-22T17:43:16Z")

</div>

> [@daalgi](#):
>
> (element R3D3 is not supported).
> 
> Is there any list of Abaqus-like element types available in PrePoMax?

Check the list of elements available in CalculiX ([https://www.dhondt.de/ccx\_2.21.pdf](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).

---

<div class="post-metadata">

**Author:** ![synt](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/synt/32/4658_2.png) [@synt](https://prepomax.discourse.group/u/synt)\
**Post date:** [June 23, 2024, 4:56pm UTC](https://prepomax.discourse.group/t/python-to-prepomax-workflow/1821/3 "2024-06-23T16:56:57Z")

</div>

> [@daalgi](#):
>
> Has anyone tried the workflow python → PrePoMax?

> [@Geometry editing feature in Pre-processing](https://prepomax.discourse.group/t/geometry-editing-feature-in-pre-processing/1809/5):
>
> Gmsh library used capable in solid modeling, editing and meshing by scripting language, maybe this advancement is possible to implementing in the future versions of PrePoMax.

---

<div class="post-metadata">

**Author:** ![daalgi](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@daalgi](https://prepomax.discourse.group/u/daalgi)\
**Post date:** [June 25, 2024, 2:22pm UTC](https://prepomax.discourse.group/t/python-to-prepomax-workflow/1821/4 "2024-06-25T14:22:09Z")

</div>

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:

```auto
*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.
