{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/34003702","id":34003702,"diff_hunk":"@@ -0,0 +1,509 @@\n+#include \"../src/CPUSolver.h\"\n+#include \"../src/Solver.h\"\n+#include \"../src/log.h\"\n+#include <array>\n+#include <iostream>\n+\n+int main(){\n+\n+  /* Define simulation parameters */\n+  #ifdef OPENMP\n+  int num_threads = omp_get_num_procs();\n+  #else\n+  int num_threads = 1;\n+  #endif\n+  double track_spacing = 0.1;\n+  int num_azim = 4;\n+  double tolerance = 1e-5;\n+  int max_iters = 1000;\n+\n+  /* Set logging information */\n+  set_log_level(\"NORMAL\");\n+  log_printf(TITLE, \"Simulating the OECD's C5G7 Benchmark Problem...\");\n+ \n+  /* Define material properties */\n+  log_printf(NORMAL, \"Defining material properties...\"); \n+ \n+  std::map<std::string, std::array<double, 7> > sigmaA;\n+  std::map<std::string, std::array<double, 7> > nuSigmaF;\n+  std::map<std::string, std::array<double, 7> > sigmaF;\n+  std::map<std::string, std::array<double, 49> > sigmaS;\n+  std::map<std::string, std::array<double, 7> > chi;\n+  std::map<std::string, std::array<double, 7> > sigmaT;\n+\n+  /* Define water cross-sections */\n+  sigmaA[\"Water\"] = std::array<double, 7> {6.0105E-4, 1.5793E-5, 3.3716E-4, \n+    0.0019406, 0.0057416, 0.015001, 0.037239};\n+  nuSigmaF[\"Water\"] = std::array<double, 7> {0, 0, 0, 0, 0, 0, 0};\n+  sigmaF[\"Water\"] = std::array<double, 7> {0, 0, 0, 0, 0, 0, 0};\n+  sigmaS[\"Water\"] = std::array<double, 49>\n+      {0.0444777, 0.1134, 7.2347E-4, 3.7499E-6, 5.3184E-8, 0.0, 0.0, \n+      0.0, 0.282334, 0.12994, 6.234E-4, 4.8002E-5, 7.4486E-6, 1.0455E-6,\n+      0.0, 0.0, 0.345256, 0.22457, 0.016999, 0.0026443, 5.0344E-4,\n+      0.0, 0.0, 0.0, 0.0910284, 0.41551, 0.063732, 0.012139,\n+      0.0, 0.0, 0.0, 7.1437E-5, 0.139138, 0.51182, 0.061229,\n+      0.0, 0.0, 0.0, 0.0, 0.0022157, 0.699913, 0.53732, \n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.13244, 2.4807};\n+  chi[\"Water\"] = std::array<double, 7> {0, 0, 0, 0, 0, 0, 0};\n+  sigmaT[\"Water\"] = std::array<double, 7> {0.159206, 0.41297, 0.59031, \n+    0.58435, 0.718, 1.25445, 2.65038};\n+\n+  /* Define UO2 cross-sections */\n+  sigmaA[\"UO2\"] = std::array<double, 7> {0.0080248, 0.0037174, 0.026769, \n+    0.096236, 0.03002, 0.11126, 0.28278};\n+  nuSigmaF[\"UO2\"] = std::array<double, 7> {0.02005998, 0.002027303, \n+    0.01570599, 0.04518301, 0.04334208, 0.2020901, 0.5257105};\n+  sigmaF[\"UO2\"] = std::array<double, 7> {0.00721206, 8.19301E-4, 0.0064532, \n+    0.0185648, 0.0178084, 0.0830348, 0.216004};\n+  sigmaS[\"UO2\"] = std::array<double, 49> \n+      {0.127537, 0.042378, 9.4374E-6, 5.5163E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.324456, 0.0016314, 3.1427E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.45094, 0.0026792, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 0.452565, 0.0055664, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 1.2525E-4, 0.271401, 0.010255, 1.0021E-8,\n+      0.0, 0.0, 0.0, 0.0, 0.0012968, 0.265802, 0.016809,\n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.0085458, 0.27308};\n+  chi[\"UO2\"] = std::array<double, 7> {0.58791, 0.41176, 3.3906E-4, 1.1761E-7,\n+    0.0, 0.0, 0.0};\n+  sigmaT[\"UO2\"] = std::array<double, 7> {0.177949, 0.329805, 0.480388, \n+    0.554367, 0.311801, 0.395168, 0.564406};\n+\n+  /* Define MOX-4.3% cross-sections */\n+  sigmaA[\"MOX-4.3%\"] = std::array<double, 7> {0.0084339, 0.0037577, 0.02797,\n+    0.10421, 0.13994, 0.40918, 0.40935};\n+  nuSigmaF[\"MOX-4.3%\"] = std::array<double, 7> {0.021753, 0.002535103, \n+    0.01626799, 0.0654741, 0.03072409, 0.666651, 0.7139904};\n+  sigmaF[\"MOX-4.3%\"] = std::array<double, 7> {0.00762704, 8.76898E-4, \n+    0.00569835, 0.0228872, 0.0107635, 0.232757, 0.248968};\n+  sigmaS[\"MOX-4.3%\"] = std::array<double, 49> \n+      {0.128876, 0.041413, 8.229E-6, 5.0405E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.325452, 0.0016395, 1.5982E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.453188, 0.0026142, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 0.457173, 0.0055394, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 1.6046E-4, 0.276814, 0.0093127, 9.1656E-9,\n+      0.0, 0.0, 0.0, 0.0, 0.0020051, 0.252962, 0.01485,\n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.0084948, 0.265007}; \n+  chi[\"MOX-4.3%\"] = std::array<double, 7> {0.58791, 0.41176, 3.3906E-4, \n+    1.1761E-7, 0.0, 0.0, 0.0};\n+  sigmaT[\"MOX-4.3%\"] = std::array<double, 7> {0.178731, 0.330849, 0.483772,\n+    0.566922, 0.426227, 0.678997, 0.68285};\n+\n+  /* Define MOX-7% cross-sections */\n+  sigmaA[\"MOX-7%\"] = std::array<double, 7> {0.0090657, 0.0042967, 0.032881,\n+    0.12203, 0.18298, 0.56846, 0.58521};\n+  nuSigmaF[\"MOX-7%\"] = std::array<double, 7> {0.02381395, 0.003858689, \n+    0.024134, 0.09436622, 0.04576988, 0.9281814, 1.0432};\n+  sigmaF[\"MOX-7%\"] = std::array<double, 7> {0.00825446, 0.00132565, 0.00842156,\n+    0.032873, 0.0159636, 0.323794, 0.362803};\n+  sigmaS[\"MOX-7%\"] = std::array<double, 49> \n+      {0.130457, 0.041792, 8.5105E-6, 5.1329E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.328428, 0.0016436, 2.2017E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.458371, 0.0025331, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 0.463709, 0.0054766, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 1.7619E-4, 0.282313, 0.0087289, 9.0016E-9,\n+      0.0, 0.0, 0.0, 0.0, 0.002276, 0.249751, 0.013114,\n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.0088645, 0.259529};\n+  chi[\"MOX-7%\"] = std::array<double, 7> {0.58791, 0.41176, 3.3906E-4, \n+    1.1761E-7, 0.0, 0.0, 0.0};\n+  sigmaT[\"MOX-7%\"] = std::array<double, 7> {0.181323, 0.334368, 0.493785, \n+    0.591216, 0.474198, 0.833601, 0.853603};\n+\n+  /* Define MOX-8.7% cross-sections */\n+  sigmaA[\"MOX-8.7%\"] = std::array<double, 7> {0.0094862, 0.0046556, 0.03624, \n+    0.13272, 0.2084, 0.6587, 0.69017};\n+  nuSigmaF[\"MOX-8.7%\"] = std::array<double, 7> {0.025186, 0.004739509, \n+    0.02947805, 0.11225, 0.05530301, 1.074999, 1.239298};\n+  sigmaF[\"MOX-8.7%\"] = std::array<double, 7> {0.00867209, 0.00162426, \n+    0.0102716, 0.0390447, 0.0192576, 0.374888, 0.430599};\n+  sigmaS[\"MOX-8.7%\"] = std::array<double, 49> \n+      {0.131504, 0.042046, 8.6972E-6, 5.1938E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.330403, 0.0016463, 2.6006E-9, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.461792, 0.0024749, 0.0, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 0.468021, 0.005433, 0.0, 0.0,\n+      0.0, 0.0, 0.0, 1.8597E-4, 0.285771, 0.0083973, 8.928E-9,\n+      0.0, 0.0, 0.0, 0.0, 0.0023916, 0.247614, 0.012322,\n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.0089681, 0.256093}; \n+  chi[\"MOX-8.7%\"] = std::array<double, 7> {0.58791, 0.41176, 3.3906E-4, \n+    1.1761E-7, 0.0, 0.0, 0.0};\n+  sigmaT[\"MOX-8.7%\"] = std::array<double, 7> {0.183045, 0.336705, 0.500507, \n+    0.606174, 0.502754, 0.921028, 0.955231};\n+\n+  /* Define fission chamber cross-sections */\n+  sigmaA[\"Fission Chamber\"] = std::array<double, 7> {5.1132E-4, 7.5813E-5, \n+    3.1643E-4, 0.0011675, 0.0033977, 0.0091886, 0.023244};\n+  nuSigmaF[\"Fission Chamber\"] = std::array<double, 7> {1.323401E-8, 1.4345E-8, \n+    1.128599E-6, 1.276299E-5, 3.538502E-7, 1.740099E-6, 5.063302E-6};\n+  sigmaF[\"Fission Chamber\"] = std::array<double, 7> {4.79002E-9, 5.82564E-9, \n+    4.63719E-7, 5.24406E-6, 1.4539E-7, 7.14972E-7, 2.08041E-6};\n+  sigmaS[\"Fission Chamber\"] = std::array<double, 49>\n+      {0.0661659, 0.05907, 2.8334E-4, 1.4622E-6, 2.0642E-8, 0.0, 0.0,\n+      0.0, 0.240377, 0.052435, 2.499E-4, 1.9239E-5, 2.9875E-6, 4.214E-7,\n+      0.0, 0.0, 0.183425, 0.092288, 0.0069365, 0.001079, 2.0543E-4,\n+      0.0, 0.0, 0.0, 0.0790769, 0.16999, 0.02586, 0.0049256,\n+      0.0, 0.0, 0.0, 3.734E-5, 0.099757, 0.20679, 0.024478,\n+      0.0, 0.0, 0.0, 0.0, 9.1742E-4, 0.316774, 0.23876,\n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.049793, 1.0991};\n+  chi[\"Fission Chamber\"] = std::array<double, 7> {0.58791, 0.41176, 3.3906E-4,\n+    1.1761E-7, 0.0, 0.0, 0.0};\n+  sigmaT[\"Fission Chamber\"] = std::array<double, 7> {0.126032, 0.29316, \n+    0.28425, 0.28102, 0.33446, 0.56564, 1.17214};\n+\n+  /* Define guide tube cross-sections */\n+  sigmaA[\"Guide Tube\"] = std::array<double, 7> {5.1132E-4, 7.5801E-5, \n+    3.1572E-4, 0.0011582, 0.0033975, 0.0091878, 0.023242};\n+  nuSigmaF[\"Guide Tube\"] = std::array<double, 7> {0, 0, 0, 0, 0, 0, 0};\n+  sigmaF[\"Guide Tube\"] = std::array<double, 7> {0, 0, 0, 0, 0, 0, 0};\n+  sigmaS[\"Guide Tube\"] = std::array<double, 49> \n+      {0.0661659, 0.05907, 2.8334E-4, 1.4622E-6, 2.0642E-8, 0.0, 0.0,\n+      0.0, 0.240377, 0.052435, 2.499E-4, 1.9239E-5, 2.9875E-6, 4.214E-7,\n+      0.0, 0.0, 0.183297, 0.092397, 0.0069446, 0.0010803, 2.0567E-4,\n+      0.0, 0.0, 0.0, 0.0788511, 0.17014, 0.025881, 0.0049297,\n+      0.0, 0.0, 0.0, 3.7333E-5, 0.0997372, 0.20679, 0.024478,\n+      0.0, 0.0, 0.0, 0.0, 9.1726E-4, 0.316765, 0.23877,\n+      0.0, 0.0, 0.0, 0.0, 0.0, 0.049792, 1.09912};\n+  chi[\"Guide Tube\"] = std::array<double, 7> {0, 0, 0, 0, 0, 0, 0};\n+  sigmaT[\"Guide Tube\"] = std::array<double, 7> {0.126032, 0.29316, 0.28424, \n+    0.28096, 0.33444, 0.56564, 1.17215};\n+\n+  /* Create materials */\n+  log_printf(NORMAL, \"Creating materials...\");\n+  std::map<std::string, Material*> materials;\n+  int numEnergyGroups = 7;\n+  \n+  std::map<std::string, std::array<double, 7> >::iterator it;\n+  int id_num = 0;\n+  for (it = sigmaA.begin(); it != sigmaA.end(); it++) {\n+    \n+    std::string name = it->first;\n+    materials[name] = new Material(id_num, name.c_str());\n+    materials[name]->setNumEnergyGroups(numEnergyGroups);\n+    id_num++;\n+    \n+    materials[name]->setSigmaA(sigmaA[name].data(), sigmaA[name].size());\n+    materials[name]->setSigmaF(sigmaF[name].data(), sigmaF[name].size());\n+    materials[name]->setNuSigmaF(nuSigmaF[name].data(), nuSigmaF[name].size());\n+    materials[name]->setSigmaS(sigmaS[name].data(), sigmaS[name].size());\n+    materials[name]->setChi(chi[name].data(), chi[name].size());\n+    materials[name]->setSigmaT(sigmaT[name].data(), sigmaT[name].size());\n+  }\n+\n+  /* Create surfaces */\n+  XPlane left(-32.13);\n+  XPlane right(32.13);\n+  YPlane top(32.13);\n+  YPlane bottom(-32.13);\n+\n+  left.setBoundaryType(REFLECTIVE);\n+  right.setBoundaryType(VACUUM);\n+  top.setBoundaryType(REFLECTIVE);\n+  bottom.setBoundaryType(VACUUM);\n+\n+  /* Create circles for the fuel as well as to discretize the moderator into \n+     rings */\n+  Circle fuel_radius(0.0, 0.0, 0.54);\n+  Circle moderator_inner_radius(0.0, 0.0, 0.62);\n+  Circle moderator_outer_radius(0.0, 0.0, 0.58);\n+\n+  /* Create cells and universes */\n+  log_printf(NORMAL, \"Creating cells...\");\n+\n+  /* Moderator rings */\n+  Cell moderator_ring1;\n+  Cell moderator_ring2;\n+  Cell moderator_ring3;\n+  moderator_ring1.setNumSectors(8);\n+  moderator_ring2.setNumSectors(8);\n+  moderator_ring3.setNumSectors(8);\n+  moderator_ring1.setFill(materials[\"Water\"]);\n+  moderator_ring2.setFill(materials[\"Water\"]);\n+  moderator_ring3.setFill(materials[\"Water\"]);\n+  moderator_ring1.addSurface(+1, &fuel_radius);\n+  moderator_ring1.addSurface(-1, &moderator_inner_radius);\n+  moderator_ring2.addSurface(+1, &moderator_inner_radius);\n+  moderator_ring2.addSurface(-1, &moderator_outer_radius);\n+  moderator_ring3.addSurface(+1, &moderator_outer_radius);\n+\n+  /* UO2 pin cell */\n+  Cell uo2_cell;\n+  uo2_cell.setNumRings(3);\n+  uo2_cell.setNumSectors(8);\n+  uo2_cell.setFill(materials[\"UO2\"]);\n+  uo2_cell.addSurface(-1, &fuel_radius);\n+\n+  Universe uo2;\n+  uo2.addCell(&uo2_cell);\n+  uo2.addCell(&moderator_ring1);\n+  uo2.addCell(&moderator_ring2);\n+  uo2.addCell(&moderator_ring3);\n+\n+  /* 4.3% MOX pin cell */\n+  Cell mox43_cell;\n+  mox43_cell.setNumRings(3);\n+  mox43_cell.setNumSectors(8);\n+  mox43_cell.setFill(materials[\"MOX-4.3%\"]);\n+  mox43_cell.addSurface(-1, &fuel_radius);\n+\n+  Universe mox43;\n+  mox43.addCell(&mox43_cell);\n+  mox43.addCell(&moderator_ring1);\n+  mox43.addCell(&moderator_ring2);\n+  mox43.addCell(&moderator_ring3);\n+\n+  /* 7% MOX pin cell */\n+  Cell mox7_cell;\n+  mox7_cell.setNumRings(3);\n+  mox7_cell.setNumSectors(8);\n+  mox7_cell.setFill(materials[\"MOX-7%\"]);\n+  mox7_cell.addSurface(-1, &fuel_radius);\n+\n+  Universe mox7;\n+  mox7.addCell(&mox7_cell);\n+  mox7.addCell(&moderator_ring1);\n+  mox7.addCell(&moderator_ring2);\n+  mox7.addCell(&moderator_ring3);\n+\n+  /* 8.7% MOX pin cell */\n+  Cell mox87_cell;\n+  mox87_cell.setNumRings(3);\n+  mox87_cell.setNumSectors(8);\n+  mox87_cell.setFill(materials[\"MOX-8.7%\"]);\n+  mox87_cell.addSurface(-1, &fuel_radius);\n+\n+  Universe mox87;\n+  mox87.addCell(&mox87_cell);\n+  mox87.addCell(&moderator_ring1);\n+  mox87.addCell(&moderator_ring2);\n+  mox87.addCell(&moderator_ring3);\n+\n+  /* Fission chamber pin cell */\n+  Cell fission_chamber_cell;\n+  fission_chamber_cell.setNumRings(3);\n+  fission_chamber_cell.setNumSectors(8);\n+  fission_chamber_cell.setFill(materials[\"Fission Chamber\"]);\n+  fission_chamber_cell.addSurface(-1, &fuel_radius);\n+\n+  Universe fission_chamber;\n+  fission_chamber.addCell(&fission_chamber_cell);\n+  fission_chamber.addCell(&moderator_ring1);\n+  fission_chamber.addCell(&moderator_ring2);\n+  fission_chamber.addCell(&moderator_ring3);\n+\n+  /* Guide tube pin cell */\n+  Cell guide_tube_cell;\n+  guide_tube_cell.setNumRings(3);\n+  guide_tube_cell.setNumSectors(8);\n+  guide_tube_cell.setFill(materials[\"Guide Tube\"]);\n+  guide_tube_cell.addSurface(-1, &fuel_radius);\n+\n+  Universe guide_tube;\n+  guide_tube.addCell(&guide_tube_cell);\n+  guide_tube.addCell(&moderator_ring1);\n+  guide_tube.addCell(&moderator_ring2);\n+  guide_tube.addCell(&moderator_ring3);\n+\n+  /* Reflector */\n+  Cell reflector_cell;\n+  reflector_cell.setFill(materials[\"Water\"]);\n+\n+  Universe reflector;\n+  reflector.addCell(&reflector_cell);\n+\n+  /* Cells */\n+  Cell assembly1_cell;\n+  Cell assembly2_cell;\n+  Cell refined_reflector_cell;\n+  Cell right_reflector_cell;\n+  Cell corner_reflector_cell;\n+  Cell bottom_reflector_cell;\n+\n+  Universe assembly1;\n+  Universe assembly2;\n+  Universe refined_reflector;\n+  Universe right_reflector;\n+  Universe corner_reflector;\n+  Universe bottom_reflector;\n+\n+  assembly1.addCell(&assembly1_cell);\n+  assembly2.addCell(&assembly2_cell);\n+  refined_reflector.addCell(&refined_reflector_cell);\n+  right_reflector.addCell(&right_reflector_cell);\n+  corner_reflector.addCell(&corner_reflector_cell);\n+  bottom_reflector.addCell(&bottom_reflector_cell);\n+\n+  /* Root Cell */\n+  Cell root_cell;\n+  root_cell.addSurface(+1, &left);\n+  root_cell.addSurface(-1, &right);\n+  root_cell.addSurface(-1, &top);\n+  root_cell.addSurface(+1, &bottom);\n+\n+  Universe root_universe;\n+  root_universe.addCell(&root_cell);\n+\n+  /* Create lattices */\n+  log_printf(NORMAL, \"Creating lattices...\");\n+\n+  /* Top left, bottom right 17 x 17 assemblies */\n+  Lattice assembly1_lattice;\n+  assembly1_lattice.setWidth(1.26, 1.26);\n+  Universe* matrix1[17*17];\n+  {\n+    int mold[17*17] =  {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n+\n+    std::map<int, Universe*> names = {{1, &uo2}, {2, &guide_tube}, \n+                                      {3, &fission_chamber}};\n+    for(int n=0; n<17*17; n++)\n+      matrix1[n] = names[mold[n]];  \n+\n+    assembly1_lattice.setUniverses(17, 17, matrix1);\n+  }\n+  assembly1_cell.setFill(&assembly1_lattice);\n+\n+  /* Top right, bottom left 17 x 17 assemblies */\n+  Lattice assembly2_lattice;\n+  assembly2_lattice.setWidth(1.26, 1.26);\n+  Universe* matrix2[17*17];\n+  {\n+    int mold[17*17] =  {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n+                        1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,\n+                        1, 2, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 1,\n+                        1, 2, 2, 4, 2, 3, 3, 3, 3, 3, 3, 3, 2, 4, 2, 2, 1,\n+                        1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1,\n+                        1, 2, 4, 3, 3, 4, 3, 3, 4, 3, 3, 4, 3, 3, 4, 2, 1,\n+                        1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1,\n+                        1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1,\n+                        1, 2, 4, 3, 3, 4, 3, 3, 5, 3, 3, 4, 3, 3, 4, 2, 1,\n+                        1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1,\n+                        1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1,\n+                        1, 2, 4, 3, 3, 4, 3, 3, 4, 3, 3, 4, 3, 3, 4, 2, 1,\n+                        1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1,\n+                        1, 2, 2, 4, 2, 3, 3, 3, 3, 3, 3, 3, 2, 4, 2, 2, 1,\n+                        1, 2, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 1,\n+                        1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,\n+                        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n+\n+    std::map<int, Universe*> names = {{1, &mox43}, {2, &mox7}, {3, &mox87},\n+                                      {4, &guide_tube}, {5, &fission_chamber}};\n+    for(int n=0; n<17*17; n++)\n+      matrix2[n] = names[mold[n]];  \n+    \n+    assembly2_lattice.setUniverses(17, 17, matrix2);\n+  }\n+  assembly2_cell.setFill(&assembly2_lattice);\n+\n+  /* Sliced up water cells - semi finely spaced */\n+  Lattice refined_ref_lattice;\n+  refined_ref_lattice.setWidth(0.126, 0.126);\n+  Universe* refined_ref_matrix[10*10];\n+  for(int n=0; n<10*10; n++)\n+    refined_ref_matrix[n] = &reflector;\n+  refined_ref_lattice.setUniverses(10, 10, refined_ref_matrix);\n+  refined_reflector_cell.setFill(&refined_ref_lattice);\n+\n+  /* Sliced up water cells - right side of geometry */\n+  Lattice right_ref_lattice;\n+  right_ref_lattice.setWidth(1.26, 1.26);\n+  Universe* right_ref_matrix[17*17];\n+  for(int i=0; i<17; i++){","path":"profile/c5g7-cmfd.cpp","position":423,"original_position":423,"commit_id":"c329479843333fd0f033dc63c65fc74d52882a0b","original_commit_id":"c329479843333fd0f033dc63c65fc74d52882a0b","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"body":"whitespace between ``for`` and ``(``","created_at":"2015-07-07T02:32:52Z","updated_at":"2015-07-07T02:32:52Z","html_url":"https://github.com/mit-crpg/OpenMOC/pull/165#discussion_r34003702","pull_request_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments/34003702"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/165#discussion_r34003702"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165","id":39041634,"html_url":"https://github.com/mit-crpg/OpenMOC/pull/165","diff_url":"https://github.com/mit-crpg/OpenMOC/pull/165.diff","patch_url":"https://github.com/mit-crpg/OpenMOC/pull/165.patch","issue_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/165","number":165,"state":"open","locked":false,"title":"Adding Alternative C++ Build System for Profiling","user":{"login":"geogunow","id":2420416,"avatar_url":"https://avatars.githubusercontent.com/u/2420416?v=3","gravatar_id":"","url":"https://api.github.com/users/geogunow","html_url":"https://github.com/geogunow","followers_url":"https://api.github.com/users/geogunow/followers","following_url":"https://api.github.com/users/geogunow/following{/other_user}","gists_url":"https://api.github.com/users/geogunow/gists{/gist_id}","starred_url":"https://api.github.com/users/geogunow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geogunow/subscriptions","organizations_url":"https://api.github.com/users/geogunow/orgs","repos_url":"https://api.github.com/users/geogunow/repos","events_url":"https://api.github.com/users/geogunow/events{/privacy}","received_events_url":"https://api.github.com/users/geogunow/received_events","type":"User","site_admin":false},"body":"In this PR I introduce an alternative build system for OpenMOC that relies solely on C++. This is helpful primarily for High Performance Computing (HPC) and profiling reasons. While the SWIG interface allows users great flexibility and ease of use when building geometries, the SWIG interface also poses challenges for profiling the code and installing it on newer HPC architectures which might not have all the python requirements needed by OpenMOC.\r\n\r\nI have created a new directory entitled \"profile\" which includes a standard Makefile which can be used to compile hard-coded C++ inputs. I have provided example inputs for C5G7 (with and without CMFD acceleration), the one-directional and two-directional gradient cases, and for the homogeneous one group benchmark. Users of this added functionality should be proficient enough in C++ to be able to edit the Makefile in order to compile the case of interest. It is suggested that users of this directory should concentrate on profiling the test cases before attempting to write their own C++ input file.\r\n\r\nThe source code of OpenMOC would ideally not be modified. However, slight alterations were made in order to compile without SWIG. Still, adjustments to the OpenMOC source will be directly adopted by the profiling directory so that it profiles the most recent version. \r\n\r\nAny suggestions on alternative strategies or styles are welcomed. \r\n\r\nThis PR is a response to issue #159.","created_at":"2015-07-02T01:47:41Z","updated_at":"2015-07-07T02:32:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c498e09aaaab39a80a0ff4afbd814603d156cdf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165/comments","review_comment_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/165/comments","statuses_url":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/c329479843333fd0f033dc63c65fc74d52882a0b","head":{"label":"geogunow:profiling","ref":"profiling","sha":"c329479843333fd0f033dc63c65fc74d52882a0b","user":{"login":"geogunow","id":2420416,"avatar_url":"https://avatars.githubusercontent.com/u/2420416?v=3","gravatar_id":"","url":"https://api.github.com/users/geogunow","html_url":"https://github.com/geogunow","followers_url":"https://api.github.com/users/geogunow/followers","following_url":"https://api.github.com/users/geogunow/following{/other_user}","gists_url":"https://api.github.com/users/geogunow/gists{/gist_id}","starred_url":"https://api.github.com/users/geogunow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geogunow/subscriptions","organizations_url":"https://api.github.com/users/geogunow/orgs","repos_url":"https://api.github.com/users/geogunow/repos","events_url":"https://api.github.com/users/geogunow/events{/privacy}","received_events_url":"https://api.github.com/users/geogunow/received_events","type":"User","site_admin":false},"repo":{"id":17528654,"name":"OpenMOC","full_name":"geogunow/OpenMOC","owner":{"login":"geogunow","id":2420416,"avatar_url":"https://avatars.githubusercontent.com/u/2420416?v=3","gravatar_id":"","url":"https://api.github.com/users/geogunow","html_url":"https://github.com/geogunow","followers_url":"https://api.github.com/users/geogunow/followers","following_url":"https://api.github.com/users/geogunow/following{/other_user}","gists_url":"https://api.github.com/users/geogunow/gists{/gist_id}","starred_url":"https://api.github.com/users/geogunow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geogunow/subscriptions","organizations_url":"https://api.github.com/users/geogunow/orgs","repos_url":"https://api.github.com/users/geogunow/repos","events_url":"https://api.github.com/users/geogunow/events{/privacy}","received_events_url":"https://api.github.com/users/geogunow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geogunow/OpenMOC","description":"A method of characteristics code for nuclear reactor physics calculations.","fork":true,"url":"https://api.github.com/repos/geogunow/OpenMOC","forks_url":"https://api.github.com/repos/geogunow/OpenMOC/forks","keys_url":"https://api.github.com/repos/geogunow/OpenMOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geogunow/OpenMOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geogunow/OpenMOC/teams","hooks_url":"https://api.github.com/repos/geogunow/OpenMOC/hooks","issue_events_url":"https://api.github.com/repos/geogunow/OpenMOC/issues/events{/number}","events_url":"https://api.github.com/repos/geogunow/OpenMOC/events","assignees_url":"https://api.github.com/repos/geogunow/OpenMOC/assignees{/user}","branches_url":"https://api.github.com/repos/geogunow/OpenMOC/branches{/branch}","tags_url":"https://api.github.com/repos/geogunow/OpenMOC/tags","blobs_url":"https://api.github.com/repos/geogunow/OpenMOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geogunow/OpenMOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geogunow/OpenMOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/geogunow/OpenMOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geogunow/OpenMOC/statuses/{sha}","languages_url":"https://api.github.com/repos/geogunow/OpenMOC/languages","stargazers_url":"https://api.github.com/repos/geogunow/OpenMOC/stargazers","contributors_url":"https://api.github.com/repos/geogunow/OpenMOC/contributors","subscribers_url":"https://api.github.com/repos/geogunow/OpenMOC/subscribers","subscription_url":"https://api.github.com/repos/geogunow/OpenMOC/subscription","commits_url":"https://api.github.com/repos/geogunow/OpenMOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/geogunow/OpenMOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/geogunow/OpenMOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/geogunow/OpenMOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/geogunow/OpenMOC/contents/{+path}","compare_url":"https://api.github.com/repos/geogunow/OpenMOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geogunow/OpenMOC/merges","archive_url":"https://api.github.com/repos/geogunow/OpenMOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geogunow/OpenMOC/downloads","issues_url":"https://api.github.com/repos/geogunow/OpenMOC/issues{/number}","pulls_url":"https://api.github.com/repos/geogunow/OpenMOC/pulls{/number}","milestones_url":"https://api.github.com/repos/geogunow/OpenMOC/milestones{/number}","notifications_url":"https://api.github.com/repos/geogunow/OpenMOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geogunow/OpenMOC/labels{/name}","releases_url":"https://api.github.com/repos/geogunow/OpenMOC/releases{/id}","created_at":"2014-03-07T21:58:36Z","updated_at":"2014-03-07T21:58:37Z","pushed_at":"2015-07-02T01:53:56Z","git_url":"git://github.com/geogunow/OpenMOC.git","ssh_url":"git@github.com:geogunow/OpenMOC.git","clone_url":"https://github.com/geogunow/OpenMOC.git","svn_url":"https://github.com/geogunow/OpenMOC","homepage":"https://mit-crpg.github.io/OpenMOC/","size":73632,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"f1e85e4e3900dafd1c4674963101fd40d884bed3","user":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"repo":{"id":8780988,"name":"OpenMOC","full_name":"mit-crpg/OpenMOC","owner":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mit-crpg/OpenMOC","description":"A method of characteristics code for nuclear reactor physics calculations.","fork":false,"url":"https://api.github.com/repos/mit-crpg/OpenMOC","forks_url":"https://api.github.com/repos/mit-crpg/OpenMOC/forks","keys_url":"https://api.github.com/repos/mit-crpg/OpenMOC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-crpg/OpenMOC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-crpg/OpenMOC/teams","hooks_url":"https://api.github.com/repos/mit-crpg/OpenMOC/hooks","issue_events_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/events{/number}","events_url":"https://api.github.com/repos/mit-crpg/OpenMOC/events","assignees_url":"https://api.github.com/repos/mit-crpg/OpenMOC/assignees{/user}","branches_url":"https://api.github.com/repos/mit-crpg/OpenMOC/branches{/branch}","tags_url":"https://api.github.com/repos/mit-crpg/OpenMOC/tags","blobs_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-crpg/OpenMOC/languages","stargazers_url":"https://api.github.com/repos/mit-crpg/OpenMOC/stargazers","contributors_url":"https://api.github.com/repos/mit-crpg/OpenMOC/contributors","subscribers_url":"https://api.github.com/repos/mit-crpg/OpenMOC/subscribers","subscription_url":"https://api.github.com/repos/mit-crpg/OpenMOC/subscription","commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-crpg/OpenMOC/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-crpg/OpenMOC/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-crpg/OpenMOC/contents/{+path}","compare_url":"https://api.github.com/repos/mit-crpg/OpenMOC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-crpg/OpenMOC/merges","archive_url":"https://api.github.com/repos/mit-crpg/OpenMOC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-crpg/OpenMOC/downloads","issues_url":"https://api.github.com/repos/mit-crpg/OpenMOC/issues{/number}","pulls_url":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-crpg/OpenMOC/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-crpg/OpenMOC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-crpg/OpenMOC/labels{/name}","releases_url":"https://api.github.com/repos/mit-crpg/OpenMOC/releases{/id}","created_at":"2013-03-14T17:19:26Z","updated_at":"2015-07-02T15:16:02Z","pushed_at":"2015-07-07T01:32:33Z","git_url":"git://github.com/mit-crpg/OpenMOC.git","ssh_url":"git@github.com:mit-crpg/OpenMOC.git","clone_url":"https://github.com/mit-crpg/OpenMOC.git","svn_url":"https://github.com/mit-crpg/OpenMOC","homepage":"https://mit-crpg.github.io/OpenMOC/","size":113843,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":26,"forks":19,"open_issues":26,"watchers":14,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165"},"html":{"href":"https://github.com/mit-crpg/OpenMOC/pull/165"},"issue":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/165"},"comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/OpenMOC/statuses/c329479843333fd0f033dc63c65fc74d52882a0b"}}}}