Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/source/tutorials/aquad/sLDFE.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@
"aquad.LocallyRefine(Vector3(0., 0., 1.), 15.0 * np.pi / 180, True)\n",
"# 10-degree cone around point [1/np.sqrt(3), 1/np.sqrt(3), 1/np.sqrt(3)]\n",
"aquad.LocallyRefine(Vector3(0., 0., 1.), 4.0 * np.pi / 180, True)\n",
"aquad.PrintQuadratureToFile(\"sLDFE_data2\")"
"aquad.PrintQuadratureToFile(\"sLDFE_data2\")\n",
"\n",
"print('number of directions =', len(aquad.omegas))"
]
},
{
Expand Down
12 changes: 12 additions & 0 deletions doc/source/tutorials/aquad/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "number of directions =",
"goldvalue": 24,
"abs_tol": 1e-8
}
]
},
Expand All @@ -16,6 +22,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "number of directions =",
"goldvalue": 6240,
"abs_tol": 1e-8
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions doc/source/tutorials/lbs/keigen/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Eigenvalue =",
"goldvalue": 1.171551,
"abs_tol": 1e-6
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions doc/source/tutorials/lbs/primer/adjoint_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@
"fwd_resp = sig_det*fwd_flux\n",
"\n",
"if rank == 0:\n",
" print(f\"{'Forward Total Flux :'} {fwd_flux:.6e}\")\n",
" print(f\"{'Forward Total Response :'} {fwd_resp:.6e}\")\n"
" print(f\"Forward Total Flux : {fwd_flux:.6e}\")\n",
" print(f\"Forward Total Response : {fwd_resp:.6e}\")\n"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions doc/source/tutorials/lbs/primer/forward_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@
"ffi.Initialize()\n",
"ffi.Execute()\n",
"val_whole = ffi.GetValue()\n",
"print(f\"value (edit zone: whole domain) = {val_whole}\")\n",
"print(f\"ratio =\",val_whole/val)"
"if rank == 0:\n",
" print(f\"value (edit zone: whole domain) = {val_whole}\")\n",
" print(f\"ratio =\",val_whole/val)"
]
},
{
Expand Down
18 changes: 18 additions & 0 deletions doc/source/tutorials/lbs/primer/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "value (edit zone: whole domain) =",
"goldvalue": 1.0276937,
"abs_tol": 1e-6
}
]
},
Expand All @@ -16,6 +22,18 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Forward Total Flux :",
"goldvalue": 3.321548e-1,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "Forward Total Response :",
"goldvalue": 1.992929e-1,
"abs_tol": 1e-6
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Adjoint Total Response :",
"goldvalue": 1.237160e-01,
"abs_tol": 1e-8
}
]
}
Expand Down
12 changes: 12 additions & 0 deletions doc/source/tutorials/lbs/src_driven/detector_forward/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Forward Total Flux :",
"goldvalue": 2.896951,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "Forward Total Response :",
"goldvalue": 1.237160e-1,
"abs_tol": 1e-6
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
"adj_resp = evaluator.EvaluateResponse(\"detector1\")\n",
"\n",
"if rank == 0:\n",
" print(f\"{'Total Response Detector 1:'} {adj_resp:.6e}\")"
" print(f\"Total Response Detector 1: {adj_resp:.6e}\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Total Response Detector 1:",
"goldvalue": 4.451637e-3,
"abs_tol": 1e-6
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,11 @@
" resp.append(sig_a * flux[d])\n",
"\n",
"if rank == 0:\n",
" print(f\"{'Total Flux in Detector-1:'} {np.sum(flux[0]):.6e}\")\n",
" print(f\"{'Total Response in Detector-1:'} {np.sum(resp[0]):.6e}\")\n",
" print(f\"Total Flux in Detector-1: {np.sum(flux[0]):.6e}\")\n",
" print(f\"Total Response in Detector-1: {np.sum(resp[0]):.6e}\")\n",
"\n",
" print(f\"{'Total Flux in Detector-2:'} {np.sum(flux[1]):.6e}\")\n",
" print(f\"{'Total Response in Detector-2:'} {np.sum(resp[1]):.6e}\")"
" print(f\"Total Flux in Detector-2: {np.sum(flux[1]):.6e}\")\n",
" print(f\"Total Response in Detector-2: {np.sum(resp[1]):.6e}\")"
]
},
{
Expand Down
24 changes: 24 additions & 0 deletions doc/source/tutorials/lbs/src_driven/glovebox_forward/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Total Flux in Detector-1:",
"goldvalue": 6.109007e-2,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "Total Flux in Detector-2:",
"goldvalue": 6.121125e-2,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "Total Response in Detector-1:",
"goldvalue": 4.451617e-3,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "Total Response in Detector-2:",
"goldvalue": 4.452532e-3,
"abs_tol": 1e-6
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,17 @@
"</div>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"max_flux = np.max(flux)\n",
"if rank == 0:\n",
" print(f\"Maximum flux = {max_flux}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -515,6 +526,13 @@
"if ipython_instance is not None:\n",
" ipython_instance.events.register(\"post_execute\", finalize_env)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
6 changes: 6 additions & 0 deletions doc/source/tutorials/lbs/src_driven/mg_src_driven/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
{
"type": "ErrorCode",
"error_code": 0
},
{
"type": "KeyValuePair",
"key": "Maximum flux =",
"goldvalue": 7.8163339e-2,
"abs_tol": 1e-6
}
]
}
Expand Down
21 changes: 21 additions & 0 deletions doc/source/tutorials/logvol/logvol_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
")\n",
"grid.SetBlockIDFromLogicalVolume(lv2, 3, True)\n",
"\n",
"volumes_per_block = grid.ComputeVolumePerBlockID()\n",
"for block_id, volume in volumes_per_block.items():\n",
" print(f\"1-Block {block_id}: volume = {volume:.4f}\")\n",
"\n",
"\n",
"# Export\n",
"grid.ExportToPVTU(\"RCC_mesh\")"
]
Expand Down Expand Up @@ -143,6 +148,10 @@
"lv3 = RPPLogicalVolume(xmin=-0.5, xmax=0.5, infy=True, infz=True)\n",
"grid.SetBlockIDFromLogicalVolume(lv3, 2, True)\n",
"\n",
"volumes_per_block = grid.ComputeVolumePerBlockID()\n",
"for block_id, volume in volumes_per_block.items():\n",
" print(f\"2-Block {block_id}: volume = {volume:.4f}\")\n",
"\n",
"# Export\n",
"grid.ExportToPVTU(\"RPP_mesh\")"
]
Expand Down Expand Up @@ -177,6 +186,10 @@
"lv4 = SphereLogicalVolume(r=0.5, x=0., y=0., z=0.)\n",
"grid.SetBlockIDFromLogicalVolume(lv4, 2, True)\n",
"\n",
"volumes_per_block = grid.ComputeVolumePerBlockID()\n",
"for block_id, volume in volumes_per_block.items():\n",
" print(f\"3-Block {block_id}: volume = {volume:.4f}\")\n",
"\n",
"# Export\n",
"grid.ExportToPVTU(\"Sphere_mesh\")"
]
Expand Down Expand Up @@ -273,6 +286,10 @@
"# Assign block ID 3 to all cells in lv1\n",
"grid.SetBlockIDFromLogicalVolume(lv1, 3, True)\n",
"\n",
"volumes_per_block = grid.ComputeVolumePerBlockID()\n",
"for block_id, volume in volumes_per_block.items():\n",
" print(f\"4-Block {block_id}: volume = {volume:.4f}\")\n",
"\n",
"# Export\n",
"grid.ExportToPVTU(\"Bool_mesh\")"
]
Expand Down Expand Up @@ -334,6 +351,10 @@
"# Assign mat ID 3 to lv of skin mesh\n",
"grid.SetBlockIDFromLogicalVolume(lv_skinmesh, 3, True)\n",
"\n",
"volumes_per_block = grid.ComputeVolumePerBlockID()\n",
"for block_id, volume in volumes_per_block.items():\n",
" print(f\"5-Block {block_id}: volume = {volume:.4f}\")\n",
"\n",
"# Export to vtk\n",
"grid.ExportToPVTU(\"lv_skinmesh\")"
]
Expand Down
86 changes: 86 additions & 0 deletions doc/source/tutorials/logvol/tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
{
"file": "logvol_examples.py",
"num_procs": 1,
"checks": [
{
"type": "KeyValuePair",
"key": "1-Block 1: volume =",
"goldvalue": 6.4864,
"abs_tol": 1e-4
},
{
"type": "KeyValuePair",
"key": "1-Block 2: volume =",
"goldvalue": 0.7541,
"abs_tol": 1e-4
},
{
"type": "KeyValuePair",
"key": "1-Block 3: volume =",
"goldvalue": 0.7595,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "2-Block 1: volume =",
"goldvalue": 3.9999,
"abs_tol": 1e-4
},
{
"type": "KeyValuePair",
"key": "2-Block 2: volume =",
"goldvalue": 4.0001,
"abs_tol": 1e-4
},
{
"type": "KeyValuePair",
"key": "3-Block 1: volume =",
"goldvalue": 7.4768,
"abs_tol": 1e-4
},
{
"type": "KeyValuePair",
"key": "3-Block 2: volume =",
"goldvalue": 0.5232,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "4-Block 1: volume =",
"goldvalue": 6.4288,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "4-Block 2: volume =",
"goldvalue": 1.048,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "4-Block 3: volume =",
"goldvalue": 0.5232,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "5-Block 1: volume =",
"goldvalue": 122.6,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "5-Block 2: volume =",
"goldvalue": 1.4,
"abs_tol": 1e-6
},
{
"type": "KeyValuePair",
"key": "5-Block 3: volume =",
"goldvalue": 1.0,
"abs_tol": 1e-6
}
]
}
]
Loading