Merge "skin_fixed.stl";
Merge "skull_fixed.stl";
Merge "csf_fixed.stl";
Merge "gm_fixed.stl";
Merge "wm_fixed.stl";
Merge "ventricles_fixed.stl";
Merge "cerebellum_fixed.stl";

Surface Loop(1) = {1};
Surface Loop(2) = {2};
Surface Loop(3) = {3};
Surface Loop(4) = {4};
Surface Loop(5) = {5};
Surface Loop(6) = {6};
Surface Loop(7) = {7};

// Generate the volumes
Volume(1) = {1};
Volume(2) = {2};
Volume(3) = {3};
Volume(4) = {4};
Volume(5) = {5};
Volume(6) = {6};
Volume(7) = {7};

// Create physical surfaces
Physical Surface("S_Skin", 1) = {1};
Physical Surface("S_Skull", 2) = {2};
Physical Surface("S_CSF", 3) = {3, 6};
Physical Surface("S_Grey_Matter", 4) = {4};
Physical Surface("S_White_Matter", 5) = {5};
Physical Surface("S_Cerebellum", 6) = {7};

// Create physical volumes
Physical Volume("V_Skin", 1) = {1};
Physical Volume("V_Skull", 2) = {2};
Physical Volume("V_CSF", 3) = {3, 6};
Physical Volume("V_Grey_Matter", 4) = {4};
Physical Volume("V_White_Matter", 5) = {5};
Physical Volume("V_Cerebellum", 6) = {7};

Mesh 3; // Create the 3D mesh