0
$\begingroup$

I am new to Gmsh and I am having trouble creating a circle with a coarse mesh. I use

Geometry->Elementary entities->Add->Circle

to create the geometry and then

Mesh->1D

to create a mesh. Then I can can refine the mesh using Mesh->Refine by splitting but there seems to be no option for coarsening the mesh?

For other shapes/dimensions I can easily coarsen the mesh using the .geo file directly. For example, I created a planar rectangle in 3D and use the 'h' parameter in my .geo file to make the mesh finer/coarser. Here is that .geo file:

h = 1;
//+
Point(1) = {-1, -1, 0, h};
//+
Point(2) = {1, -1, 0, h};
//+
Point(3) = {1, 1, 0, h};
//+
Point(4) = {-1, 1, 0, h};
//+
Line(1) = {1, 2};
//+
Line(2) = {2, 3};
//+
Line(3) = {3, 4};
//+
Line(4) = {4, 1};
//+
Line Loop(1) = {3, 4, 1, 2};
//+
Plane Surface(1) = {1};

But my .geo mesh for the circle doesn't to have any place I can use a variable such as 'h' above to refine/coarsen the mesh for the circle:

//+
SetFactory("OpenCASCADE");
Circle(1) = {0, 0, 0, 1, 0, 2*Pi};

So how can I create coarser meshes for the circle either in Gmsh or directly using some parameter in the .geo file?

$\endgroup$
2
$\begingroup$

To create a coarser mesh, you can set the characteristic length globally to a larger value, e.g.,

SetFactory("OpenCASCADE");
Mesh.CharacteristicLengthFactor = 2;

Circle(1) = {0, 0, 0, 1, 0, 2*Pi};
Line Loop(1) = {1};
Surface(1) = {1};

Increasing the value of Mesh.CharacteristicLengthFactor results in a coarser mesh; decreasing the value results in a finer mesh.

You can also set the characteristic length factor in the gmsh options. You can find it under Tools -> Options -> Mesh -> General -> Element size factor.

If you need a finer control over the element sizes, you can set the element size for different parts of your domain, e.g., by defining a box in which a certain mesh size is required. See Specifying mesh element sizes in the gmsh manual.

$\endgroup$

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.