.mesh to .lsm to .msh

Asked by Toketo

Hello guys!
Is this way possible?
I saved my mesh in .mesh file, then converted it to .lsm. I noticed the script in .lsm is similar to the one I found in the tutorial, Trianges, Nodes, Tri,.. So what I did was to copy the info from .lsm and pasted it to a script and saved it as a .msh file. This .msh file will be used in esys-particle.

If I save my mesh as .msh in gmsh, its look is different from .lsm.

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Dion Weatherley
Solved:
Last query:
Last reply:
Revision history for this message
Dion Weatherley (d-weatherley) said :
#1

Hi Toketo,

The mesh file format used by ESyS-Particle is not compatible with the .msh format of gmsh however, it is possible to export meshes from gmsh and convert them rather easily to ESyS-Particle's mesh format.

A tutorial on converting from gmsh to esys-particle mesh formats and some helper scripts are available here:
https://twiki.esscc.uq.edu.au/index.php/Documentation_and_Presentations#Creating_ESyS-Particle_Triangle_Meshes_Using_Gmsh

The most important thing when converting from another mesh format to ESyS-Particle is that the ordering of nodes in esys-particle is very important: It determines which side of each triangle is active. The active face must point in the direction of particles in order to work correctly. Particles will "tunnel" through triangles whose active side faces away from the particles. This issue is explained in the ESyS-Particle Tutorial.

Cheers,

Dion

Revision history for this message
Toketo (tomcarlosimborio) said :
#2

Thanks Sir Dion for answering. What version of gmsh is used in the tutorial? I'm currently using 2.4.1. So it is fine to have it in .mesh then convert it to .lsm, then from .lsm copy it to another script and save it as .msh right?

Also, how do I know about the ordering of nodes? How do I know about the active face?

Revision history for this message
Dion Weatherley (d-weatherley) said :
#3

Hi Toketo,

I cannot recall which version of gmsh I used when producing the tutorial. It was some years ago. I recently constructed some meshes with version 2.60 of gmsh and it seems to have not changed very much.

I am not quite sure about your second question. Why do you wish to convert from .mesh to .lsm then to .msh? It is sufficient to follow the gmsh tutorial and save the mesh as an 'medit mesh' then use the medit2TriMesh.py script to convert to esys-particle mesh format. The script is here:
https://twiki.esscc.uq.edu.au/images/8/85/Medit2TriMesh_py.txt

That script also contains a subroutine for reordering nodes so that the active face of all triangles points towards a specified point "inside" the model i.e. in the direction of the initial locations of your particles. More information about the ordering of nodes is provided in section 5.3.1 of the ESyS-Particle Tutorial.

Cheers,

Dion

Revision history for this message
Toketo (tomcarlosimborio) said :
#4

Because the .msh is used in the script for esys. Example in the hopper flow: it used floorMesh.msh.
The Medit2TriMesh txt only converts .mesh to .lsm

So the active triangle faces to a certain inpoint.
Should I also change the inpoints from the text? [0.5,0.5,1.0], [0,10,0]? Because my mesh is somewhere around -250,150,-22.5 and -150,300,22.5?

Revision history for this message
Dion Weatherley (d-weatherley) said :
#5

Hi Toketo,

The .lsm format is the same as .msh in this case...just a different choice of filename extension. The .lsm format produced by Medit2TriMesh.py is the correct format for importing meshes into ESyS-Particle.

Yes, you will need to change the inpoint in the script to match your desired model arrangement. I would suggest a point in the centre of the block of particles. That script is designed to work with a cylinder mesh or similar surrounding the particles but can be easily adapted to your needs.

Cheers,

Dion

Revision history for this message
Best Dion Weatherley (d-weatherley) said :
#6

Hi Toketo,

The .lsm format is the same as .msh in this case...just a different choice of filename extension. The .lsm format produced by Medit2TriMesh.py is the correct format for importing meshes into ESyS-Particle.

Yes, you will need to change the inpoint in the script to match your desired model arrangement. I would suggest a point in the centre of the block of particles. That script is designed to work with a cylinder mesh or similar surrounding the particles but can be easily adapted to your needs.

Cheers,

Dion

Revision history for this message
Toketo (tomcarlosimborio) said :
#7

Thanks Dion! I'm gonna try it.

Revision history for this message
Toketo (tomcarlosimborio) said :
#8

Thanks Dion Weatherley, that solved my question.