# Custom Mesh Sizes in GMSH [closed]

I have a simple question today. I am new to GMSH and I am currently learning how to use the software program. I am using GMSH 3.0.4.

What I am looking to do is to set a different mesh size for different faces in my 2D geometry. As a test, I am creating 2 squares next to each other. The square on the left will have a mesh size set by the element size factor in the options dialog.

I have been doing some research on this matter and came across this for posting:

http://onelab.info/pipermail/gmsh/2009/004647.html

I also read section 6.3.1 in the user manual. In this section, it is stated that:

A MathEval field specifies the size of the mesh using an explicit mathematical function.


So, I went to Mesh->Define->Size Fields and then New->MathEval and then typed in 0.001 in the box. I also set a restrict field by going to New->restrict. I typed my edge list and the face list that I want to restrict the field. Since this I want to restrict my first Mesh field, I typed in 1 in the IFields box.

I also ensured that the 2D mesh algorithm is set to Delauney.

However, I am still having difficulty in setting up a custom mesh size. I am attempting to bound a face to specific mesh size. I am posting my .geo file here so that others may take a look.

My question is this: What is the best method that I can do on the GUI in order to bound different faces to different mesh sizes?

Please note that currently the Element size factor is set to 1. Also note that I am generating a mesh of only quads.

My .geo file:

//+
SetFactory("Built-in");
//+
Point(1) = {0, 0, 0, 1.0};
//+
Point(2) = {1, 0, 0, 1.0};
//+
Point(3) = {1, 1, 0, 1.0};
//+
Point(4) = {0, 1, 0, 1.0};
//+
Line(1) = {1, 4};
//+
Line(2) = {4, 3};
//+
Line(3) = {3, 2};
//+
Line(4) = {2, 1};
//+
Line Loop(1) = {2, 3, 4, 1};
//+
Plane Surface(1) = {1};

Recombine Surface{1};
//+
Point(5) = {2, 1.2, 0, 1.0};
//+
Point(6) = {2, 0, 0, 1.0};
//+
Line(5) = {3, 5};
//+
Line(6) = {5, 6};
//+
Line(7) = {6, 2};
//+
Line Loop(2) = {5, 6, 7, -3};
//+
Plane Surface(2) = {2};
//+
Field = Restrict;
//+
Field.EdgesList = {5, 6, 7, 3};
//+
Field.FacesList = {2};
//+
Field = MathEval;
//+
Field.F = "1.0";

//+
//Background Field = 1;

//+

//+
Field.F = "0.01";
//+
Background Field = 1;
//+
Background Field = -1;
//+
Field.F = "0.001";


Point(1) = {0,0,0,0.1};