- Thank you received: 0
Writing the mesh for a periodic domain (Abaqus)
- bhaveshshrimali
- Topic Author
- Offline
- Junior Member
Less
More
5 years 4 months ago - 5 years 4 months ago #1695
by bhaveshshrimali
Writing the mesh for a periodic domain (Abaqus) was created 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
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.
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: 5 years 4 months ago by bhaveshshrimali. Reason: Wrong snippet
5 years 4 months ago - 5 years 4 months ago #1696
by joachim
Replied by joachim on topic Writing the mesh for a periodic domain (Abaqus)
Hi,
1. with
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:
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
1. with
Code:
mesh.Export("mymesh.inp", "Abaqus Format")
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: 5 years 4 months ago by joachim.
The following user(s) said Thank You: bhaveshshrimali
- bhaveshshrimali
- Topic Author
- Offline
- Junior Member
Less
More
- Thank you received: 0
5 years 4 months ago #1697
by bhaveshshrimali
Replied by bhaveshshrimali on topic Writing the mesh for a periodic domain (Abaqus)
Thanks @joachim.
Time to create page: 0.118 seconds