Writing the mesh for a periodic domain (Abaqus)

Hello everyone,

I was trying to export a Netgen-generated mesh for a 3D-periodic domain in Abaqus format.

For now, since I have generated a .geo file (ASCII format), I simply use the GUI to generate and then export the corresponding mesh to the required .inp format.

Netgen then (automatically) writes the corresponding multi-point-constraint (.mpc) file to the same directory. Is there a way to access this information (i.e. the set of constraints written to the .mpc file?) through the Python interface ?

The .mpc file basically gives the list of linear constraints relating dofs on opposite facets of a periodic domain. Is there a way to access this functionality through the Python interface ?

Given a .geo file, can I simply import it in Python like the following

geo = CSGeometry('<filename>.geo') 

and then an exportAbaqus function (?) to write the corresponding .inp format which generates the .mpc file?

For 2D meshes I was manually identifying the opposite facet nodes and writing the linear constraints, something like this:

This becomes inefficient for larger meshes in 3D.


  1. with
mesh.Export("mymesh.inp", "Abaqus Format")

you get the inp-file, and in addition the mpc file if you have periodic constraints.

  1. You can access the periodic vertices (edes, faces) only via the NGSolve mesh:
import ngsolve
ngs_mesh = ngsolve.Mesh (ngmesh) 
  1. Exporting the mesh in Python is obviously slower than in C++, about 5 to 10 times for text formats. Exporting a mesh with a million elements in Python should not take more than a few seconds.


Thanks @joachim.