calculix / calculix-mesh2inp

Convert 2D netgen meshes to calculix format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert 2D netgen meshes to calculix input files

Date: 2019-03-24
tags:calculix, Python 3
Author: Roland Smith

Introduction

Calculix is my FEA program of choice. To function it does require a mesh in the form of nodes and elements. Since writing these by hand is cumbersome, I'm using netgen for that.

This script takes a 2D netgen mesh containing S6 elements, and converts it to the input format used by calculix.

Nodes from sirface ID's with a number >100 are considered special and are stored in node sets. These are useful for boundary conditions.

How does it work

It requires three filenames; * An existing .mesh file generated by netgen. * A file name for nodes and node sets. I'd suggest to use nodes.inp. * A file name for the elements. I'd suggest to use elements.inp.

The program reads the mesh file and extracts the nodes and elements. It writes the node coordinates and the node set to the first output file. The elements are written to the second output file.

At the moment it only handles 2D second order (S6) elements.

Invocation

This program should be run from the directory that contains the mesh file.

python3 mesh2inp.py <foo>.mesh nodes.inp elements.inp

About

Convert 2D netgen meshes to calculix format.


Languages

Language:Python 100.0%