Mesh.MshBinary = 0;
Mesh.Format = 1;
Mesh.SaveAll = 0; //Ignore Physical definitions and save all elements

Mesh.ElementOrder = 1;
Mesh.SecondOrderLinear = 1;

//Mesh.Smoothing = 1000;
//Mesh.SmoothInternalEdges = 100;
Mesh.Optimize = 1; //Optimize the mesh using Netgen to improve the quality of tetrahedral elements

Mesh.Algorithm = 2; //1 by Antoine (1=meshadapt, 2=delaunay)
Mesh.Algorithm3D = 5;//4 by Antoine //(1=delaunay, 4=netgen, 5=tetgen)

radius = 1;

length = 1;

element_dim = 0.6; // control the elements' size

extrusion_number = 1; // number of elements in the extrusion direction

////////////   No Need to Change Beyond ////////////////////////////
// points used to create quarter of circle
Point(1) = {radius, 0, 0, element_dim} ;
Point(2) = {0, radius, 0, element_dim} ;
Point(3) = {0, 0, 0, element_dim};

Circle(1) = {1,3,2};
//Delete { Point {3}; }

// copy and rotate the quarter circle to create a full one
Rotate {{0,0,1}, {0,0,0}, Pi/2} {
  Duplicata { Line{1}; }
}

Rotate {{0,0,1}, {0,0,0}, Pi} {
  Duplicata { Line{1}; }
}

Rotate {{0,0,1}, {0,0,0}, 3*Pi/2} {
  Duplicata { Line{1}; }
}

Line Loop(1) = {1,2,3,4};
Plane Surface(1) = {1};

// extrude in third direction
Extrude { 0 , 0 , length }
{
	Surface{ 1 };
	Layers
	{
		{ extrusion_number },
		{ 1. }
	};
}
