Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Writing the mesh for a periodic domain (Abaqus)

More
4 years 9 months ago - 4 years 9 months ago #1695 by bhaveshshrimali
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
Code:
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.
Last edit: 4 years 9 months ago by bhaveshshrimali. Reason: Wrong snippet
More
4 years 9 months ago - 4 years 9 months ago #1696 by joachim
Hi,

1. with
Code:
mesh.Export("mymesh.inp", "Abaqus Format")
you get the inp-file, and in addition the mpc file if you have periodic constraints.

2. You can access the periodic vertices (edes, faces) only via the NGSolve mesh:
Code:
import ngsolve ngs_mesh = ngsolve.Mesh (ngmesh) ngs_mesh.GetPeriodicNodePairs(VERTEX)


3. 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.

best,
Joachim
Last edit: 4 years 9 months ago by joachim.
The following user(s) said Thank You: bhaveshshrimali
More
4 years 9 months ago #1697 by bhaveshshrimali
Time to create page: 0.105 seconds