// Gmsh project created on Sun Apr 21 21:12:12 2019
SetFactory("OpenCASCADE");
Merge "msfr_gmsh.stp";

//Remove duplicate entities from CAD model
Coherence;


//Convert units from mm to m WHY DOESN'T IT WORK?!
factor = 1.e-3;
allpoints[] = Point "*";
Dilate{{0,0,0},{factor,factor,factor}}{Point{allpoints[]};}



//Define Physical Volumes and Surfaces
Physical Volume("core", 10001) = {1, 5, 7, 9, 10};
Physical Volume("pump", 10002) = {6};
Physical Volume("heat_exchanger", 10003) = {8};
Physical Volume("blanket", 20001) = {3};
Physical Volume("reflectors", 20003) = {4, 2};
//+
allVolumes[] = Volume "*";
total_bnd[]=CombinedBoundary{Volume{allVolumes[]};};
refl_bnd[] = {18, 7, 14, 8, 11, 1, 15, 12};
Physical Surface("adiabatic_void", 996)={total_bnd[]}; Physical Surface("adiabatic_void", 996)-={refl_bnd[]};
Physical Surface("symmetry_reflective", 995) = {refl_bnd[]};





//Setting the mesh coarseness for all points
allPoints[]=Point "*";
Characteristic Length{allPoints[]}=100;

//Set some meshing options
Mesh.RemeshAlgorithm=1;
Coherence Mesh;

