%Units:
micron = 1e-6;

%Trims:

%Shrinkages (293 K --> 4.2 K):

%Angles:
sidewall_angle = (pi/180) * 26; %in radians

%Dimensions:
disk_diameter = 2.12 * micron;
disk_thickness = .255 * micron;

volume_min_radius = 0.02 * micron
volume_max_radius = 8.0 * micron;
volume_height = 8.0 * micron;

%Domain dimensions:
sparse_radius = 0.5 * micron;

%Coordinate macros
%radial:
x_lwr_edge = (disk_diameter /2) + (disk_thickness /2) * tan(sidewall_angle);;
x_uppr_edge = (disk_diameter /2) - (disk_thickness /2) * tan(sidewall_angle);

%axial:

%Point coordinates:
p1 = [volume_min_radius, volume_height/2];
p2 = [volume_min_radius, disk_thickness/2];
p3 = [volume_min_radius, -disk_thickness/2];
p4 = [volume_min_radius, -volume_height/2 ];

p5 = [sparse_radius, volume_height/2];
p6 = [sparse_radius, disk_thickness/2];
p7 = [sparse_radius, -disk_thickness/2];
p8 = [sparse_radius, -volume_height/2 ];

p9 = [x_uppr_edge, volume_height/2];
p10 = [x_uppr_edge, disk_thickness/2];
p11 = [x_lwr_edge, -disk_thickness/2];
p12 = [x_lwr_edge, -volume_height/2];

p13 = [volume_max_radius, volume_height/2];
p14 = [volume_max_radius, disk_thickness/2];
p15 = [volume_max_radius, -disk_thickness/2];
p16 = [volume_max_radius, -volume_height/2];

%Subdomains:
v1 = poly2vert([p1;p5;p6;p2]);
a1 = poly2vert([p2;p6;p7;p3]);
v2 = poly2vert([p3;p7;p8;p4]);
v3 = poly2vert([p5;p9;p10;p6]);
a2 = poly2vert([p6;p10;p11;p7]);
v4 = poly2vert([p7;p11;p12;p8]);
v5 = poly2vert([p9;p13;p14;p10]);
v6 = poly2vert([p10;p14;p15;p11]);
v7 = poly2vert([p11;p15;p16;p12]);

geom=geomcsg({v1},{a1},{v2},{v3},{a2},{v4},{v5},{v6},{v7});

geomplot(geom);

strng = 'v1 a1 v2 v3 a2 v4 v5 v6 v7';