lc=0.1; //characteristic mesh size (optional make smaller to refine mesh)

// Place points
Point(1) = {0,0,0,lc};
Point(2) = {1,0,0,lc};
Point(3) = {1,1,0,lc};
Point(4) = {0,1,0,lc};

// Create lines from points
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line(5) = {3,1};

// Define line loops used to construct surfaces
Line Loop(1) = {1,2,5};
Line Loop(2) = {-5,3,4};

// Make surfaces from line loops
Plane Surface(1) = {1}; //using LL #1
Plane Surface(2) = {2}; //using LL #2

// Showing off another gmsh feature:
// Tell gmsh to use mostly quads rather than tris for surface #2
Recombine Surface(2);

// Give physical IDs to everything you want meshed
Physical Line(1) = {5}; //Line #5 --> Interface
Physical Surface(2) = {1}; //Surface #1 --> Lower triangle (tris)
Physical Surface(3) = {2}; // Surface #2 --> Upper triangle (mostly quads)

Mesh.MeshOnlyVisible=1;

Show { Surface{1};}
Hide {Surface{2};}
Mesh.FirstNodeTag=1;
Mesh 2;
Printf("Number of Nodes = %g",Mesh.NbNodes);
Printf("Number of TriElements = %g",Mesh.NbTriangles);
Printf("Number of QuadElements = %g",Mesh.NbQuadrangles);
Save "mesh_1.msh";
//Exit;
