2
$\begingroup$

I am currently working on remeshers for my simulations (academic purpose) and I try to find a method to remesh previous meshes using Gmsh. The first mesh (normalMesh.msh) was created using a .geo file (normalMesh.geo) and the new meshes should be either coarser or finer depending on the location and stress distribution (Abaqus will be my solver). MWE is given below.

normalMesh.geo

Point(1) = {0, 0, 0, 1.0};
Point(2) = {0, 2, 0, 1.0};
Point(3) = {2, 2, 0, 1.0};
Point(4) = {0, 1, 0, 1.0};
Point(5) = {1, 2, 0, 1.0};
Circle(1) = {1, 2, 3};
Circle(2) = {4, 2, 5};
Line(3) = {5, 3};
Line(4) = {4, 1};
Line Loop(1) = {2, 3, -1, -4};
Plane Surface(1) = {1};
Physical Surface("surf1") = {1};
Physical Line("setTop") = {3};
Physical Line("setBot") = {4};
Physical Line("setInner") = {2};
Physical Line("setOuter") = {1};

If you now mesh the .geo file

gmsh <name_of_your_geo_file.geo> -2 <-o name_of_the_output_file> 

you can view it in gmsh.

NormalMesh.msh showed in Gmsh, slightly resembles the shape of geometry, given in .geo file

If you mesh finerMesh.geo, you will see what I aim to get.

Point(1) = {0, 0, 0, 0.3};
Point(2) = {0, 2, 0, 1.0};
Point(3) = {2, 2, 0, 1.0};
Point(4) = {0, 1, 0, 0.3};
Point(5) = {1, 2, 0, 1.0};
Circle(1) = {1, 2, 3};
Circle(2) = {4, 2, 5};
Line(3) = {5, 3};
Line(4) = {4, 1};
Line Loop(1) = {2, 3, -1, -4};
Plane Surface(1) = {1};
Physical Surface("surf1") = {1};
Physical Line("setTop") = {3};
Physical Line("setBot") = {4};
Physical Line("setInner") = {2};
Physical Line("setOuter") = {1};

finerMesh.msh shown in gmsh, better resemblence of geometry

If you now compare both .geo files, you will see that I only slightly changed 2 lines. I changed line 1 (from 1.0 to 0.3) and line 4 (from 1.0 to 0.3). I want to be able to only manipulating the .msh files to get the same result or remeshing the .msh files.

I appreciate any kind of suggestions and help coming up.

$\endgroup$
  • $\begingroup$ For remeshing you could look into MMG: mmgtools.org $\endgroup$ – Beni Bogosel Jul 15 at 11:15
  • $\begingroup$ Regarding your request of adding the tag remesh, I think that right now it is not useful. $\endgroup$ – nicoguaro Jul 15 at 14:20
  • $\begingroup$ Regarding your question, do you want to refine (split each element in for) the original mesh? If that's the case, you can just use Refine by splitting in the software. $\endgroup$ – nicoguaro Jul 15 at 14:22
  • $\begingroup$ I don't want to uniformly split each element in the model. I want a way to select a given area in the body where I can either refine the mesh or even make it coarser there. That's why in the finerMesh.geo you can see that I only refined the mesh on the bottom end of the pipe and not on the top. $\endgroup$ – fruitiest Punch Jul 16 at 7:30
  • $\begingroup$ Well, I don't understand what is that you are asking then. Also, if you add @ and the user handle the person would be notified. $\endgroup$ – nicoguaro Jul 16 at 13:44
2
$\begingroup$

It is a tricky thing to do (in pure GMSH) by using only the MSH file. Because, conceptually, the MSH file does not contain information about the underlying geometry that was discretized.

However, certain remeshing capabilities are present in GMSH. See tutorial 13 "Remeshing without underlying CAD model" for remeshing of an STL file. For your task, you would have to classify your mesh elements, so that only the ones that need refinement are selected. Then, you would apply a new characteristic length in the right points.

Unfortunately, I was not able to achieve the desired result while quickly trying it; but it is certainly possible with enough efforts.

$\endgroup$
  • $\begingroup$ Thanks, this is what I did for the past view months. I learned a lot about the remising capabilities of Gmsh. My next question is what you stated in your comment. By that I mean the classification of mesh elements and selecting the only ones that need refinement or coarsening. In essence, I try to use node sets. This would help tremendously with that problem. Do you have any idea how I can import the pure geometry (stl, step, iges) but also containing the node sets in some way or another? $\endgroup$ – fruitiest Punch Sep 15 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.