SetFactory("OpenCASCADE");

Point(1) = {0, 0, 0};
Point(2) = {r_i, 0, 0};
Point(3) = {r_o, 0, 0};
Point(4) = {0, r_i, 0};
Point(5) = {0, r_o, 0};

Line(1) = {2, 3};
Line(2) = {5, 4};

Circle(3) = {3, 1, 5};
Circle(4) = {4, 1, 2};
Curve Loop(1) = {1, 3, 2, 4};

Plane Surface(1) = {1};

Transfinite Line {1:2} = n+1;
Transfinite Line {3:4} = n+1;
Transfinite Surface {1};

Mesh.RecombineAll = 1;
Mesh.ElementOrder = 2;

Extrude {0, 0, 0.1*0.5*(r_i+r_o)} {
  Surface{1}; Layers{n/4}; Recombine;
}


Physical Surface("inner") = {5};
Physical Surface("outer") = {3};
Physical Surface("bottom") = {2};
Physical Surface("left") = {4};
Physical Surface("infinite") = {1,6};
Physical Volume("bulk") = {1};
