├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── README.rst ├── config.py ├── docs ├── Makefile ├── doxygen │ ├── Doxyfile │ └── doxy2swig.py ├── img │ ├── alg-SOR-solve.png │ ├── alg-cmfd-solve.png │ ├── alg-transport-sweep-CMFD.png │ ├── annular_pin_fuel_rings.png │ ├── annular_pin_inner_rings.png │ ├── annular_pin_materials.png │ ├── annular_pin_outer_rings.png │ ├── c5g7-cmfd-cells.png │ ├── c5g7-fsrs.png │ ├── cells.png │ ├── cmfd-SOR-solve.png │ ├── cmfd-accel-alg-1.png │ ├── cmfd-accel-alg-2.png │ ├── cmfd-accel-moc.png │ ├── cmfd-axial-interpolation.png │ ├── cmfd-example.png │ ├── cmfd-gs.png │ ├── cmfd-matrix.png │ ├── cmfd-solve-alg.png │ ├── corner-crossing-2.png │ ├── corner-crossing-3.png │ ├── corner-crossing.png │ ├── cosine_flux_distribution.png │ ├── cover.odg │ ├── cover.png │ ├── csg-cells-halfspace-intersection.odg │ ├── csg-cells-halfspace-intersection.png │ ├── csg-halfspace-intersection.odg │ ├── csg-halfspace-intersection.png │ ├── csg-halfspace.odg │ ├── csg-halfspace.png │ ├── csg-lattice-cells.odg │ ├── csg-lattice-cells.png │ ├── csg-primitives-hierarchy.odg │ ├── csg-primitives-hierarchy.png │ ├── csg-tree.png │ ├── current-tally.png │ ├── cyclic-tracks.png │ ├── exponential-interpolation-algorithm.png │ ├── exponential-tangent.png │ ├── fig-fsr-mesh-regions.png │ ├── find-cell-algorithm.png │ ├── find-universe-algorithm.png │ ├── fission-rates.png │ ├── flat-source-regions.png │ ├── flux-fsr-0.png │ ├── flux-fsr-1.png │ ├── flux-group-1.png │ ├── flux-group-7.png │ ├── fs-32-angles-group-3.png │ ├── fs-4-angles-group-3.png │ ├── fs-flux-calc-32-angles-group-1.png │ ├── fs-flux-calc-4-angles-group-1.png │ ├── general-spatial-plot-1.png │ ├── general-spatial-plot-2.png │ ├── get_rand_array.cpp │ ├── get_rand_array.h │ ├── get_rand_array.i │ ├── get_rand_list.cpp │ ├── get_rand_list.h │ ├── get_rand_list.i │ ├── halfspace.png │ ├── halfspace.svg │ ├── materials.png │ ├── min-surf-dist-algorithm.png │ ├── nested-coordinates.odg │ ├── nested-coordinates.png │ ├── next-intersection-point-algorithm.png │ ├── numpy.i │ ├── openmoc-logo-api.png │ ├── openmoc-logo-sphinx-small.png │ ├── openmoc-logo-sphinx.png │ ├── openmoc-logo.png │ ├── openmoc-software-design.png │ ├── overall-iterative-scheme.png │ ├── pin-cell-fsrs-annular.png │ ├── pin-cell-fsrs-moderator-rings.png │ ├── pin-cell-fsrs.png │ ├── pin-cell-materials-annular.png │ ├── pin-cell-materials.png │ ├── polar-quad-ty.png │ ├── polar_quadrature_sets.png │ ├── print_list.cpp │ ├── print_list.h │ ├── print_list.i │ ├── ray-tracing-2d_periodic_track_cycles.png │ ├── ray-tracing-3d-track_cycles.png │ ├── ray-tracing-algorithm.png │ ├── saxpy.cpp │ ├── saxpy.h │ ├── saxpy.i │ ├── segments.png │ ├── solvers.png │ ├── source-update-algorithm.png │ ├── spatial-a.png │ ├── spatial-b.png │ ├── spatial-c.png │ ├── sum_array.cpp │ ├── sum_array.h │ ├── sum_array.i │ ├── sum_list.cpp │ ├── sum_list.h │ ├── sum_list.i │ ├── surfaces.png │ ├── surfs-cells.png │ ├── tracks.png │ ├── transport-sweep-algorithm.png │ ├── transport-sweep.odg │ ├── transport-sweep.png │ ├── union.png │ └── union.svg └── source │ ├── _templates │ └── layout.html │ ├── api │ ├── cell.rst │ ├── cellfill.rst │ ├── cmfd.rst │ ├── cpulssolver.rst │ ├── cpusolver.rst │ ├── geometry.rst │ ├── gpusolver.rst │ ├── halfspace.rst │ ├── index.rst │ ├── lattice.rst │ ├── log.rst │ ├── material.rst │ ├── pairwisesum.rst │ ├── plane.rst │ ├── point.rst │ ├── quadrature.rst │ ├── region.rst │ ├── segment.rst │ ├── solver.rst │ ├── surface.rst │ ├── timer.rst │ ├── track.rst │ ├── trackgenerator.rst │ ├── trackgenerator3D.rst │ ├── universe.rst │ ├── vectorizedsolver.rst │ ├── xplane.rst │ ├── yplane.rst │ ├── zcylinder.rst │ └── zplane.rst │ ├── conf.py │ ├── developers.rst │ ├── devguide │ ├── build_system.rst │ ├── debugging.rst │ ├── documentation.rst │ ├── index.rst │ ├── software_design.rst │ ├── style_guide.rst │ ├── swig.rst │ └── work_flow.rst │ ├── doxygen │ └── api.rst │ ├── index.rst │ ├── license.rst │ ├── methods │ ├── cmfd.rst │ ├── constructive_solid_geometry.rst │ ├── eigenvalue_calculations.rst │ ├── index.rst │ ├── introduction.rst │ ├── krylov.rst │ ├── method_of_characteristics.rst │ ├── parallelization.rst │ └── track_generation.rst │ ├── publications.rst │ ├── quickinstall.rst │ ├── releasenotes │ ├── index.rst │ ├── notes_0.1.1.rst │ ├── notes_0.1.2.rst │ ├── notes_0.1.3.rst │ └── notes_0.1.4.rst │ └── usersguide │ ├── beginners.rst │ ├── index.rst │ ├── input.rst │ ├── install.rst │ ├── mac_prerequisites.rst │ ├── processing.rst │ ├── running.rst │ ├── troubleshoot.rst │ └── ubuntu_prerequisites.rst ├── logo ├── openmoc-logo.ai ├── openmoc-logo.cdr ├── openmoc-logo.png └── openmoc-logo.psd ├── openmoc ├── __init__.py ├── checkvalue.py ├── compatible │ ├── __init__.py │ ├── casmo.py │ └── opencg_compatible.py ├── cuda │ ├── __init__.py │ └── openmoc_cuda.i ├── krylov.py ├── log.py ├── materialize.py ├── opencg_compatible.py ├── options.py ├── plotter.py ├── process.py ├── subdivider.py └── swig │ ├── argument_typemaps.i │ ├── casting.i │ ├── docstring.i │ ├── map_to_dict.i │ ├── mpi4py.i │ ├── numpy.i │ ├── numpy_typemaps.i │ ├── openmoc.i │ ├── swig_typemaps.i │ ├── thisown.i │ └── typemaps.i ├── profile ├── Makefile ├── models │ ├── Takeda │ │ └── Takeda-unrodded.cpp │ ├── c5g7 │ │ ├── c5g7-3d-cmfd.cpp │ │ ├── c5g7-3d.cpp │ │ ├── c5g7-rodded-B-2x2.cpp │ │ ├── c5g7-rodded-B.cpp │ │ └── c5g7-ws.cpp │ ├── fixed-source │ │ └── pin-cell-fixed-3d.cpp │ ├── gradients │ │ ├── one-directional │ │ │ └── one-directional-gradient.cpp │ │ └── two-directional │ │ │ └── two-directional-gradient.cpp │ ├── homogeneous │ │ └── homogeneous.cpp │ ├── load-geometry │ │ ├── helper-code │ │ │ └── group-structures.h │ │ ├── load-2D-full-core.cpp │ │ ├── load-full-core.cpp │ │ ├── load-geometry.cpp │ │ └── load-single-assembly.cpp │ ├── pin-cell │ │ └── pin-cell-3d.cpp │ ├── run_time_standard │ │ ├── run_time_standard.cpp │ │ └── simple-lattice-3d.geo │ ├── simple-lattice │ │ └── simple-lattice-3d.cpp │ └── single-assembly │ │ ├── quarter-c5g7-assembly.cpp │ │ └── single-c5g7-assembly.cpp └── results │ ├── base_makefile │ ├── compile-and-run.py │ ├── strip_file.py │ └── submit_base.pbs ├── sample-input ├── benchmarks │ ├── LRA │ │ ├── LRA-cmfd.py │ │ ├── LRA-mgxs-hdf5.py │ │ ├── LRA-mgxs.h5 │ │ ├── LRA.py │ │ ├── cells.py │ │ ├── geometry.py │ │ ├── lattices.py │ │ ├── surfaces.py │ │ └── universes.py │ ├── c5g7 │ │ ├── c5g7-2d.py │ │ ├── c5g7-3d-rodded-A.py │ │ ├── c5g7-3d-rodded-B.py │ │ ├── c5g7-3d-unrodded.py │ │ ├── c5g7-3d.py │ │ ├── c5g7.pbs │ │ ├── c5g7.py │ │ ├── cells.py │ │ ├── gap-05-rodB-A6-v1.geo │ │ ├── gap-10-rodB-A6-v1.geo │ │ ├── gap-50-rodB-A6-v1.geo │ │ ├── gap-c5g7-3d-rodded-B.py │ │ ├── lattices.py │ │ ├── surfaces.py │ │ └── universes.py │ ├── homogeneous-one-group │ │ └── homogeneous-one-group.py │ ├── homogeneous-two-group │ │ └── homogeneous-two-groups.py │ ├── romano │ │ └── romano.py │ └── takeda │ │ └── model_1 │ │ ├── cells.py │ │ ├── lattices.py │ │ ├── materials.py │ │ ├── surfaces.py │ │ ├── takeda-mgxs.h5 │ │ ├── takeda-rodded.py │ │ ├── takeda-unrodded.py │ │ └── universes.py ├── bundled-lattice │ ├── bundled-lattice-2d.py │ ├── bundled-lattice-3d.py │ └── geometry.py ├── c5g7-mgxs-hdf5.py ├── c5g7-mgxs.h5 ├── cosine-source │ └── cosine-source.py ├── gradients │ ├── cube.py │ ├── one-directional │ │ ├── one-directional-cmfd.py │ │ └── one-directional.py │ └── two-directional │ │ ├── two-directional-cmfd.py │ │ └── two-directional.py ├── grid-spacer │ └── grid-spacer.py ├── homogeneous │ ├── geometry.py │ ├── homogeneous-2d.py │ └── homogeneous-3d.py ├── ipython-notebook │ └── mox-assembly.ipynb ├── krylov │ ├── adjoint-eigenmodes.py │ ├── forward-eigenmodes.py │ └── geometry.py ├── nested-lattice │ ├── geometry.py │ ├── nested-lattice-2d.py │ └── nested-lattice-3d.py ├── pin-cell │ ├── geometry.py │ ├── pin-cell-3d.py │ └── pin-cell.py ├── point-source │ ├── geometry.py │ ├── point-source-2d.py │ └── point-source-3d.py ├── simple-lattice │ ├── geometry.py │ ├── simple-lattice-3d.py │ └── simple-lattice.py ├── sph-factors │ ├── pin-cell │ │ ├── compute-mgxs.py │ │ ├── mgxs.pkl │ │ ├── run-openmc.py │ │ └── sph-factors.py │ └── slab │ │ ├── compute-mgxs.py │ │ ├── mgxs.pkl │ │ ├── run-openmc.py │ │ └── sph-factors.py ├── subcritical │ ├── geometry.py │ ├── subcritical-2d.py │ └── subcritical-3d.py └── tiny-lattice │ ├── geometry.py │ ├── tiny-lattice-2d.py │ └── tiny-lattice-3d.py ├── setup.cfg ├── setup.py ├── src ├── CPULSSolver.cpp ├── CPULSSolver.h ├── CPUSolver.cpp ├── CPUSolver.h ├── Cell.cpp ├── Cell.h ├── Cmfd.cpp ├── Cmfd.h ├── ExpEvaluator.cpp ├── ExpEvaluator.h ├── Geometry.cpp ├── Geometry.h ├── LocalCoords.cpp ├── LocalCoords.h ├── MOCKernel.cpp ├── MOCKernel.h ├── Material.cpp ├── Material.h ├── Matrix.cpp ├── Matrix.h ├── Mesh.cpp ├── Mesh.h ├── ParallelHashMap.h ├── Point.cpp ├── Point.h ├── Progress.cpp ├── Progress.h ├── Quadrature.cpp ├── Quadrature.h ├── Region.cpp ├── Region.h ├── RunTime.cpp ├── RunTime.h ├── Solver.cpp ├── Solver.h ├── Surface.cpp ├── Surface.h ├── Timer.cpp ├── Timer.h ├── Track.cpp ├── Track.h ├── Track3D.cpp ├── Track3D.h ├── TrackGenerator.cpp ├── TrackGenerator.h ├── TrackGenerator3D.cpp ├── TrackGenerator3D.h ├── TrackTraversingAlgorithms.cpp ├── TrackTraversingAlgorithms.h ├── TraverseSegments.cpp ├── TraverseSegments.h ├── Universe.cpp ├── Universe.h ├── Vector.cpp ├── Vector.h ├── VectorizedSolver.cpp ├── VectorizedSolver.h ├── accel │ ├── DeviceMaterial.h │ ├── DeviceTrack.h │ └── cuda │ │ ├── GPUQuery.cu │ │ ├── GPUQuery.h │ │ ├── GPUSolver.cu │ │ ├── GPUSolver.h │ │ ├── clone.cu │ │ ├── clone.h │ │ └── dev_exponential.h ├── boundary_type.h ├── constants.h ├── exponentials.h ├── linalg.cpp ├── linalg.h ├── log.cpp ├── log.h ├── pairwise_sum.h └── segmentation_type.h ├── tests ├── .coveragerc ├── cleanup ├── input_set.py ├── pickle-rcparams.py ├── rcparams.pkl ├── readme.rst ├── run_tests.py ├── test_1d_gradient │ ├── results_true.dat │ └── test_1d_gradient.py ├── test_2d_gradient │ ├── results_true.dat │ └── test_2d_gradient.py ├── test_2d_gradient_linear_source │ ├── results_true.dat │ └── test_2d_gradient_linear_source.py ├── test_OTF_transport │ ├── results_true.dat │ └── test_OTF_transport.py ├── test_adjoint_hom_inf_medium │ ├── results_true.dat │ └── test_adjoint_hom_inf_medium.py ├── test_adjoint_pin_cell │ ├── results_true.dat │ └── test_adjoint_pin_cell.py ├── test_adjoint_simple_lattice │ ├── results_true.dat │ └── test_adjoint_simple_lattice.py ├── test_axial_segmentation │ ├── results_true.dat │ └── test_axial_segmentation.py ├── test_calculate_boundaries │ ├── results_true.dat │ └── test_calculate_boundaries.py ├── test_cmfd_axial_interpolation_average │ ├── results_true.dat │ └── test_cmfd_axial_interpolation_average.py ├── test_cmfd_axial_interpolation_centroid │ ├── results_true.dat │ └── test_cmfd_axial_interpolation_centroid.py ├── test_cmfd_check_balance │ ├── results_true.dat │ └── test_cmfd_check_balance.py ├── test_cmfd_linear_source │ ├── results_true.dat │ └── test_cmfd_linear_source.py ├── test_cmfd_periodic_boundaries │ ├── results_true.dat │ └── test_cmfd_periodic_boundary.py ├── test_cmfd_print_ratios │ ├── pf_reference.txt │ ├── results_true.dat │ └── test_cmfd_print_ratios.py ├── test_cmfd_pwr_assembly │ ├── results_true.dat │ └── test_cmfd_pwr_assembly.py ├── test_cmfd_restart │ ├── results_true.dat │ └── test_cmfd_restart.py ├── test_cmfd_vacuum_boundary │ ├── results_true.dat │ └── test_cmfd_vacuum_boundary.py ├── test_complex_region_bounds │ ├── results_true.dat │ └── test_complex_region_bounds.py ├── test_compute_flux │ ├── results_true.dat │ └── test_compute_flux.py ├── test_compute_source │ ├── results_true.dat │ └── test_compute_source.py ├── test_find_cell │ ├── results_true.dat │ └── test_find_cell.py ├── test_fixed_linear_source │ ├── results_true.dat │ └── test_fixed_linear_source.py ├── test_forward_3D_lattice │ ├── results_true.dat │ └── test_forward_3D_lattice.py ├── test_forward_3D_lattice_70g │ ├── results_true.dat │ └── test_forward_3D_lattice_70g.py ├── test_forward_3D_lattice_CMFD │ ├── results_true.dat │ └── test_forward_3D_lattice_CMFD.py ├── test_forward_3D_lattice_linear │ ├── results_true.dat │ └── test_forward_3D_lattice_linear.py ├── test_forward_3D_lattice_linear_70g │ ├── results_true.dat │ └── test_forward_3D_lattice_linear_70g.py ├── test_forward_3D_lattice_symmetry │ ├── results_true.dat │ └── test_forward_3D_lattice_symmetry.py ├── test_forward_hom_inf_medium │ ├── results_true.dat │ └── test_forward_hom_inf_medium.py ├── test_forward_pin_cell │ ├── results_true.dat │ └── test_forward_pin_cell.py ├── test_forward_pin_cell_70g │ ├── results_true.dat │ └── test_forward_pin_cell_70g.py ├── test_forward_simple_lattice │ ├── results_true.dat │ └── test_forward_simple_lattice.py ├── test_geometry_dump │ ├── results_true.dat │ └── test_geometry_dump.py ├── test_geometry_load │ ├── results_true.dat │ └── test_geometry_load.py ├── test_geometry_load_non_uniform_lattice │ ├── non-uniform-lattice.geo │ ├── results_true.dat │ └── test_geometry_load_non_uniform_lattice.py ├── test_geometry_print │ ├── geometry_true.txt │ ├── results_true.dat │ └── test_geometry_print.py ├── test_get_num_cells │ ├── results_true.dat │ └── test_num_cells.py ├── test_krylov_adjoint │ ├── results_true.dat │ └── test_krylov_adjoint.py ├── test_krylov_forward │ ├── results_true.dat │ └── test_krylov_forward.py ├── test_logger │ ├── results_true.dat │ └── test_logger.py ├── test_mesh_from_lattice │ ├── results_true.dat │ └── test_mesh_from_lattice.py ├── test_mesh_reaction_rate_tally │ ├── results_true.dat │ └── test_mesh_reaction_rate_tally.py ├── test_mesh_tally │ ├── results_true.dat │ └── test_mesh_tally.py ├── test_mesh_tally_process │ ├── results_true.dat │ └── test_mesh_tally_process.py ├── test_mgxs_openmc │ ├── generate_libraries.py │ ├── mgxs_angular_legendre.pkl │ ├── mgxs_by_nuclide.pkl │ ├── mgxs_consistent.pkl │ ├── mgxs_consistent_nuscatter.pkl │ ├── mgxs_isotropic.pkl │ ├── mgxs_materials.pkl │ ├── mgxs_transport_corrected.pkl │ ├── results_true.dat │ └── test_mgxs_openmc.py ├── test_modular_domains │ ├── results_true.dat │ └── test_modular_domains.py ├── test_mpi_2D │ ├── 2D_lattice.py │ ├── results_true.dat │ └── test_mpi_2D.py ├── test_mpi_2D_CMFD │ ├── 2D_lattice.py │ ├── results_true.dat │ └── test_mpi_2D_CMFD.py ├── test_mpi_3D │ ├── 3D_lattice.py │ ├── results_true.dat │ └── test_mpi_3D.py ├── test_mpi_3D_CMFD │ ├── 3D_lattice.py │ ├── results_true.dat │ └── test_mpi_3D_CMFD.py ├── test_mpi_flux_checker │ ├── 3D_lattice.py │ ├── results_true.dat │ └── test_mpi_flux_checker.py ├── test_multisim_cmfd │ ├── results_true.dat │ └── test_multisim_cmfd.py ├── test_multisim_fixed_source │ ├── results_true.dat │ └── test_multisim_fixed_source.py ├── test_multisim_linear_source │ ├── results_true.dat │ └── test_multisim_linear.py ├── test_multisim_materials │ ├── results_true.dat │ └── test_multisim_materials.py ├── test_multisim_materials_cmfd │ ├── results_true.dat │ └── test_multisim_materials_cmfd.py ├── test_multisim_num_azim │ ├── results_true.dat │ └── test_multisim_num_azim.py ├── test_multisim_num_groups │ ├── results_true.dat │ └── test_multisim_num_groups.py ├── test_multisim_simple │ ├── results_true.dat │ └── test_multisim_simple.py ├── test_non_uniform_lattice_geometry │ ├── results_true.dat │ └── test_non_uniform_lattice_geometry.py ├── test_plot_3D_cells │ ├── test_plot_3D_cells.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ └── true-5.png ├── test_plot_3D_cmfd_cells │ ├── test_plot_3D_cmfd_cells.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ ├── true-3.png │ └── true-4.png ├── test_plot_3D_fission_rates │ ├── test_plot_3D_fission_rates.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ └── true-3.png ├── test_plot_3D_fsrs │ ├── test_plot_3D_fsrs.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ └── true-3.png ├── test_plot_3D_materials │ ├── test_plot_3D_materials.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ └── true-5.png ├── test_plot_3D_segments │ ├── test_plot_3D_segments.py │ └── true-0.png ├── test_plot_3D_spatial_fluxes │ ├── test_plot_3D_spatial_fluxes.py │ ├── true-0.png │ ├── true-1.png │ ├── true-10.png │ ├── true-11.png │ ├── true-12.png │ ├── true-13.png │ ├── true-14.png │ ├── true-15.png │ ├── true-16.png │ ├── true-17.png │ ├── true-18.png │ ├── true-19.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ ├── true-5.png │ ├── true-6.png │ ├── true-7.png │ ├── true-8.png │ └── true-9.png ├── test_plot_3D_tracks │ ├── test_plot_3D_tracks.py │ └── true-0.png ├── test_plot_cells │ ├── test_plot_cells.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ └── true-5.png ├── test_plot_cmfd_cells │ ├── test_plot_cmfd_cells.py │ ├── true-0.png │ ├── true-1.png │ └── true-2.png ├── test_plot_energy_fluxes │ ├── test_plot_energy_fluxes.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ └── true-3.png ├── test_plot_fission_rates │ ├── test_plot_fission_rates.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ └── true-3.png ├── test_plot_fsrs │ ├── test_plot_fsrs.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ └── true-3.png ├── test_plot_materials │ ├── test_plot_materials.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ └── true-5.png ├── test_plot_quadrature │ ├── test_plot_quadrature.py │ └── true-0.png ├── test_plot_segments │ ├── test_plot_segments.py │ ├── true-0.png │ └── true-1.png ├── test_plot_spatial_data │ ├── test_plot_spatial_data.py │ ├── true-0.png │ ├── true-1.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ └── true-5.png ├── test_plot_spatial_fluxes │ ├── test_plot_spatial_fluxes.py │ ├── true-0.png │ ├── true-1.png │ ├── true-10.png │ ├── true-11.png │ ├── true-2.png │ ├── true-3.png │ ├── true-4.png │ ├── true-5.png │ ├── true-6.png │ ├── true-7.png │ ├── true-8.png │ └── true-9.png ├── test_plot_tracks │ ├── test_plot_tracks.py │ ├── true-0.png │ └── true-1.png ├── test_quadrature │ ├── results_true.dat │ └── test_quadrature.py ├── test_ray_tracing_method │ ├── results_true.dat │ └── test_ray_tracing_method_3D.py ├── test_rings │ ├── results_true.dat │ └── test_rings.py ├── test_runtime │ ├── results_true.dat │ └── test_runtime.py ├── test_sectors │ ├── results_true.dat │ └── test_sectors.py ├── test_simulation_state │ ├── results_true.dat │ └── test_simulation_state.py ├── test_split_segments │ ├── results_true.dat │ └── test_split_segments.py ├── test_split_segments_cmfd │ ├── results_true.dat │ └── test_split_segments_cmfd.py ├── test_subdividing_lattice │ ├── results_true.dat │ └── test_subdividing_lattice.py ├── test_superhomogenization_cell │ ├── generate_library.py │ ├── mgxs.pkl │ ├── results_true.dat │ └── test_superhomogenization_cell.py ├── test_superhomogenization_eigenvalue │ ├── results_true.dat │ └── test_superhomogeneization_eigenvalue.py ├── test_superhomogenization_material │ ├── mgxs.pkl │ ├── results_true.dat │ └── test_superhomogenization_material.py ├── test_tracking_grid │ ├── results_true.dat │ └── test_tracking_grid.py ├── test_tracking_grid_cmfd │ ├── results_true.dat │ └── test_tracking_grid_cmfd.py ├── test_tracking_lattice │ ├── results_true.dat │ └── test_tracking_lattice.py ├── test_tracking_lattice_cmfd │ ├── results_true.dat │ └── test_tracking_lattice_cmfd.py ├── test_tracking_pin_cell │ ├── results_true.dat │ └── test_tracking_pin_cell.py ├── test_tracking_pin_cell_cmfd │ ├── results_true.dat │ └── test_tracking_pin_cell_cmfd.py ├── test_transport_stabilization │ ├── negative_sources_reference │ ├── results_true.dat │ └── test_transport_stabilization.py ├── testing_harness.py ├── travis.sh ├── unit_tests │ ├── test_cells.py │ ├── test_cmfd_parameters.py │ ├── test_exponentials.py │ ├── test_lattices.py │ ├── test_log_parameters.py │ ├── test_materials.py │ ├── test_options.py │ ├── test_rectangular_prism.py │ ├── test_regions.py │ ├── test_surfaces.py │ ├── test_track3D.py │ └── test_universes.py └── update_results.py └── tools └── ci └── travis-install.sh /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: python 3 | addons: 4 | apt: 5 | packages: 6 | - swig 7 | env: 8 | global: 9 | - COVERALLS_PARALLEL=true 10 | cache: 11 | directories: 12 | - $HOME/openmc 13 | - $HOME/miniconda 14 | notifications: 15 | webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN 16 | matrix: 17 | include: 18 | - python: "3.10" 19 | env: OMP=n MPI=n 20 | - python: "3.6" 21 | env: OMP=n MPI=n 22 | - python: "3.6" 23 | env: OMP=y MPI=n 24 | - python: "3.6" 25 | env: OMP=y MPI=y 26 | before_install: 27 | # ========== Point apt-get to C++11-compatible compiler ===================== 28 | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 29 | - sudo apt-get update -qq 30 | install: 31 | - chmod +x ./tools/ci/travis-install.sh 32 | - . ./tools/ci/travis-install.sh 33 | script: 34 | - cd tests 35 | - ./travis.sh 36 | after_success: 37 | - cd .. 38 | - cpp-coveralls -i src -i build/temp.linux*/src/ --exclude-pattern "/usr/*" --dump cpp_cov.json 39 | - cp tests/.coverage ./ 40 | - cat .coverage 41 | # Switch to Python coveralls, which can merge reports 42 | - coveralls --rcfile=./tests/.coveragerc --merge=cpp_cov.json 43 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | #=============================================================================== 4 | # Regression tests 5 | #=============================================================================== 6 | 7 | # This allows for dashboard configuration 8 | include(CTest) 9 | 10 | # Get a list of all the tests to run 11 | file(GLOB_RECURSE TESTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_*.py) 12 | 13 | # Loop through all the tests 14 | foreach(test ${TESTS}) 15 | 16 | # Get test information 17 | get_filename_component(TEST_NAME ${test} NAME) 18 | get_filename_component(TEST_PATH ${test} PATH) 19 | 20 | if(${COVERAGE}) 21 | add_test(NAME ${TEST_NAME} 22 | WORKING_DIRECTORY ${TEST_PATH} 23 | COMMAND ${PYTHON_EXECUTABLE} run --omit=${OMIT} ${TEST_NAME} 24 | ) 25 | else() 26 | add_test(NAME ${TEST_NAME} 27 | WORKING_DIRECTORY ${TEST_PATH} 28 | COMMAND ${PYTHON_EXECUTABLE} ${TEST_NAME} 29 | ) 30 | endif() 31 | 32 | endforeach(test) 33 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | #Use latest Ubuntu version as parent image 2 | # FIXME: Decide on a specific version of ubuntu 3 | FROM ubuntu:latest 4 | RUN apt-get update && \ 5 | apt-get upgrade -y && \ 6 | apt-get install -y git && \ 7 | apt-get install --reinstall build-essential -y 8 | 9 | #Clone Repository 10 | RUN git clone -b 3D-MOC https://github.com/mit-crpg/OpenMOC.git /OpenMOC/ 11 | 12 | #Install necessary python dependencies 13 | RUN apt-get install python3.7 -y 14 | 15 | #Response to Tzdata package 16 | ENV TZ=US 17 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 18 | 19 | RUN apt-get install git swig python3-dev python3-numpy python3-matplotlib python3-h5py -y 20 | 21 | #Build OpenMOC 22 | WORKDIR "/OpenMOC" 23 | RUN python3 setup.py install --user 24 | RUN python3 setup.py install --user 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012-2023 Massachusetts Institute of Technology 2 | and OpenMOC contributors 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include src *.h *.cpp *.cu 2 | recursive-include sample-input *.py *.h5 *.pbs 3 | include *.rst 4 | include setup.py 5 | include config.py -------------------------------------------------------------------------------- /docs/img/alg-SOR-solve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/alg-SOR-solve.png -------------------------------------------------------------------------------- /docs/img/alg-cmfd-solve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/alg-cmfd-solve.png -------------------------------------------------------------------------------- /docs/img/alg-transport-sweep-CMFD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/alg-transport-sweep-CMFD.png -------------------------------------------------------------------------------- /docs/img/annular_pin_fuel_rings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/annular_pin_fuel_rings.png -------------------------------------------------------------------------------- /docs/img/annular_pin_inner_rings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/annular_pin_inner_rings.png -------------------------------------------------------------------------------- /docs/img/annular_pin_materials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/annular_pin_materials.png -------------------------------------------------------------------------------- /docs/img/annular_pin_outer_rings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/annular_pin_outer_rings.png -------------------------------------------------------------------------------- /docs/img/c5g7-cmfd-cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/c5g7-cmfd-cells.png -------------------------------------------------------------------------------- /docs/img/c5g7-fsrs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/c5g7-fsrs.png -------------------------------------------------------------------------------- /docs/img/cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cells.png -------------------------------------------------------------------------------- /docs/img/cmfd-SOR-solve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-SOR-solve.png -------------------------------------------------------------------------------- /docs/img/cmfd-accel-alg-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-accel-alg-1.png -------------------------------------------------------------------------------- /docs/img/cmfd-accel-alg-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-accel-alg-2.png -------------------------------------------------------------------------------- /docs/img/cmfd-accel-moc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-accel-moc.png -------------------------------------------------------------------------------- /docs/img/cmfd-axial-interpolation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-axial-interpolation.png -------------------------------------------------------------------------------- /docs/img/cmfd-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-example.png -------------------------------------------------------------------------------- /docs/img/cmfd-gs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-gs.png -------------------------------------------------------------------------------- /docs/img/cmfd-matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-matrix.png -------------------------------------------------------------------------------- /docs/img/cmfd-solve-alg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cmfd-solve-alg.png -------------------------------------------------------------------------------- /docs/img/corner-crossing-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/corner-crossing-2.png -------------------------------------------------------------------------------- /docs/img/corner-crossing-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/corner-crossing-3.png -------------------------------------------------------------------------------- /docs/img/corner-crossing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/corner-crossing.png -------------------------------------------------------------------------------- /docs/img/cosine_flux_distribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cosine_flux_distribution.png -------------------------------------------------------------------------------- /docs/img/cover.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cover.odg -------------------------------------------------------------------------------- /docs/img/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cover.png -------------------------------------------------------------------------------- /docs/img/csg-cells-halfspace-intersection.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-cells-halfspace-intersection.odg -------------------------------------------------------------------------------- /docs/img/csg-cells-halfspace-intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-cells-halfspace-intersection.png -------------------------------------------------------------------------------- /docs/img/csg-halfspace-intersection.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-halfspace-intersection.odg -------------------------------------------------------------------------------- /docs/img/csg-halfspace-intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-halfspace-intersection.png -------------------------------------------------------------------------------- /docs/img/csg-halfspace.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-halfspace.odg -------------------------------------------------------------------------------- /docs/img/csg-halfspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-halfspace.png -------------------------------------------------------------------------------- /docs/img/csg-lattice-cells.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-lattice-cells.odg -------------------------------------------------------------------------------- /docs/img/csg-lattice-cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-lattice-cells.png -------------------------------------------------------------------------------- /docs/img/csg-primitives-hierarchy.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-primitives-hierarchy.odg -------------------------------------------------------------------------------- /docs/img/csg-primitives-hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-primitives-hierarchy.png -------------------------------------------------------------------------------- /docs/img/csg-tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/csg-tree.png -------------------------------------------------------------------------------- /docs/img/current-tally.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/current-tally.png -------------------------------------------------------------------------------- /docs/img/cyclic-tracks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/cyclic-tracks.png -------------------------------------------------------------------------------- /docs/img/exponential-interpolation-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/exponential-interpolation-algorithm.png -------------------------------------------------------------------------------- /docs/img/exponential-tangent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/exponential-tangent.png -------------------------------------------------------------------------------- /docs/img/fig-fsr-mesh-regions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/fig-fsr-mesh-regions.png -------------------------------------------------------------------------------- /docs/img/find-cell-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/find-cell-algorithm.png -------------------------------------------------------------------------------- /docs/img/find-universe-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/find-universe-algorithm.png -------------------------------------------------------------------------------- /docs/img/fission-rates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/fission-rates.png -------------------------------------------------------------------------------- /docs/img/flat-source-regions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/flat-source-regions.png -------------------------------------------------------------------------------- /docs/img/flux-fsr-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/flux-fsr-0.png -------------------------------------------------------------------------------- /docs/img/flux-fsr-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/flux-fsr-1.png -------------------------------------------------------------------------------- /docs/img/flux-group-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/flux-group-1.png -------------------------------------------------------------------------------- /docs/img/flux-group-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/flux-group-7.png -------------------------------------------------------------------------------- /docs/img/fs-32-angles-group-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/fs-32-angles-group-3.png -------------------------------------------------------------------------------- /docs/img/fs-4-angles-group-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/fs-4-angles-group-3.png -------------------------------------------------------------------------------- /docs/img/fs-flux-calc-32-angles-group-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/fs-flux-calc-32-angles-group-1.png -------------------------------------------------------------------------------- /docs/img/fs-flux-calc-4-angles-group-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/fs-flux-calc-4-angles-group-1.png -------------------------------------------------------------------------------- /docs/img/general-spatial-plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/general-spatial-plot-1.png -------------------------------------------------------------------------------- /docs/img/general-spatial-plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/general-spatial-plot-2.png -------------------------------------------------------------------------------- /docs/img/get_rand_array.cpp: -------------------------------------------------------------------------------- 1 | /* File get_rand_array.cpp */ 2 | #include "get_rand_array.h" 3 | 4 | /* Define function implementation */ 5 | void get_rand_array(double* output_array, int length) { 6 | 7 | /* Populate input NumPy array with random numbers */ 8 | for (int i=0; i < length; i++) 9 | output_array[i] = ((double) rand()) / RAND_MAX; 10 | 11 | return; 12 | } 13 | -------------------------------------------------------------------------------- /docs/img/get_rand_array.h: -------------------------------------------------------------------------------- 1 | /* File get_rand_array.h */ 2 | #include 3 | 4 | /* Define function prototype to take in a NumPy array */ 5 | void get_rand_array(double* output_array, int length); 6 | -------------------------------------------------------------------------------- /docs/img/get_rand_array.i: -------------------------------------------------------------------------------- 1 | %module get_rand_array 2 | 3 | %{ 4 | #define SWIG_FILE_WITH_INIT 5 | #include "get_rand_array.h" 6 | %} 7 | 8 | /* Include the NumPy typemaps library */ 9 | %include "numpy.i" 10 | 11 | %init %{ 12 | import_array(); 13 | %} 14 | 15 | /* Typemap for get_rand_array(double* output_array, int length) C/C++ routine */ 16 | %apply (double* ARGOUT_ARRAY1, int DIM1) {(double* output_array, int length)}; 17 | 18 | %include "get_rand_array.h" 19 | -------------------------------------------------------------------------------- /docs/img/get_rand_list.cpp: -------------------------------------------------------------------------------- 1 | /* File get_rand_list.cpp */ 2 | #include "get_rand_list.h" 3 | 4 | /* Define function implementation */ 5 | std::vector get_rand_list(int length) { 6 | 7 | /* Allocate memory for the C++ STL vector */ 8 | std::vector output_list(length); 9 | 10 | /* Populate vector with random numbers */ 11 | for (int i=0; i < length; i++) 12 | output_list[i] = ((double) rand()) / RAND_MAX; 13 | 14 | return output_list; 15 | } 16 | -------------------------------------------------------------------------------- /docs/img/get_rand_list.h: -------------------------------------------------------------------------------- 1 | /* File get_rand_list.h */ 2 | #include 3 | #include 4 | 5 | /* Define function prototype to return a random Python tuple */ 6 | std::vector get_rand_list(int length); 7 | -------------------------------------------------------------------------------- /docs/img/get_rand_list.i: -------------------------------------------------------------------------------- 1 | %module get_rand_list 2 | %{ 3 | #define SWIG_FILE_WITH_INIT 4 | #include "get_rand_list.h" 5 | %} 6 | 7 | %include "std_vector.i" 8 | 9 | /* SWIG template for get_rand_list(int length) C++ routine */ 10 | namespace std { 11 | %template(DoubleVector) vector; 12 | } 13 | 14 | %include "get_rand_list.h" 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/img/halfspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/halfspace.png -------------------------------------------------------------------------------- /docs/img/materials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/materials.png -------------------------------------------------------------------------------- /docs/img/min-surf-dist-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/min-surf-dist-algorithm.png -------------------------------------------------------------------------------- /docs/img/nested-coordinates.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/nested-coordinates.odg -------------------------------------------------------------------------------- /docs/img/nested-coordinates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/nested-coordinates.png -------------------------------------------------------------------------------- /docs/img/next-intersection-point-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/next-intersection-point-algorithm.png -------------------------------------------------------------------------------- /docs/img/openmoc-logo-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/openmoc-logo-api.png -------------------------------------------------------------------------------- /docs/img/openmoc-logo-sphinx-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/openmoc-logo-sphinx-small.png -------------------------------------------------------------------------------- /docs/img/openmoc-logo-sphinx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/openmoc-logo-sphinx.png -------------------------------------------------------------------------------- /docs/img/openmoc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/openmoc-logo.png -------------------------------------------------------------------------------- /docs/img/openmoc-software-design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/openmoc-software-design.png -------------------------------------------------------------------------------- /docs/img/overall-iterative-scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/overall-iterative-scheme.png -------------------------------------------------------------------------------- /docs/img/pin-cell-fsrs-annular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/pin-cell-fsrs-annular.png -------------------------------------------------------------------------------- /docs/img/pin-cell-fsrs-moderator-rings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/pin-cell-fsrs-moderator-rings.png -------------------------------------------------------------------------------- /docs/img/pin-cell-fsrs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/pin-cell-fsrs.png -------------------------------------------------------------------------------- /docs/img/pin-cell-materials-annular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/pin-cell-materials-annular.png -------------------------------------------------------------------------------- /docs/img/pin-cell-materials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/pin-cell-materials.png -------------------------------------------------------------------------------- /docs/img/polar-quad-ty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/polar-quad-ty.png -------------------------------------------------------------------------------- /docs/img/polar_quadrature_sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/polar_quadrature_sets.png -------------------------------------------------------------------------------- /docs/img/print_list.cpp: -------------------------------------------------------------------------------- 1 | /* File print_list.cpp */ 2 | #include "print_list.h" 3 | 4 | void print_list(int length, double* list) { 5 | printf("Printing a Python list from C/C++\n"); 6 | 7 | /* Loop over each list value and print to the screen */ 8 | for (int i=0; i < length; i++) 9 | printf("list[%d] = %f\n", i, list[i]); 10 | } 11 | -------------------------------------------------------------------------------- /docs/img/print_list.h: -------------------------------------------------------------------------------- 1 | /* File print_list.h */ 2 | #include 3 | 4 | /* Define function prototype */ 5 | void print_list(int length, double* list); 6 | -------------------------------------------------------------------------------- /docs/img/print_list.i: -------------------------------------------------------------------------------- 1 | %module print_list 2 | %{ 3 | #define SWIG_FILE_WITH_INIT 4 | #include "print_list.h" 5 | %} 6 | 7 | /* Include the SWIG typemaps library */ 8 | %include typemaps.i 9 | 10 | /* Typemap for the print(int length, double* list) C/C++ routine */ 11 | %typemap(in) (int length, double* list) { 12 | 13 | /* Check that the input is a Python list data structure */ 14 | if (!PyList_Check($input)) { 15 | PyErr_SetString(PyExc_ValueError,"Expected a Python list of values\n"); 16 | return NULL; 17 | } 18 | 19 | /* Set the first parameter to the length of the Python list input */ 20 | $1 = PySequence_Length($input); 21 | 22 | /* Allocate memory to convert the list into a C/C++ array */ 23 | $2 = (double*) malloc($1 * sizeof(double)); 24 | 25 | /* Loop over the values in the list */ 26 | for (int i = 0; i < $1; i++) { 27 | 28 | /* Extract the value from the list at this location */ 29 | PyObject *o = PySequence_GetItem($input,i); 30 | 31 | /* If the value is a number, cast it as an int and set the 32 | * input array value */ 33 | if (PyNumber_Check(o)) { 34 | $2[i] = (double) PyFloat_AsDouble(o); 35 | } 36 | else { 37 | free($2); 38 | PyErr_SetString(PyExc_ValueError,"Expected a list of numbers\n"); 39 | return NULL; 40 | } 41 | } 42 | } 43 | 44 | %include "print_list.h" 45 | -------------------------------------------------------------------------------- /docs/img/ray-tracing-2d_periodic_track_cycles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/ray-tracing-2d_periodic_track_cycles.png -------------------------------------------------------------------------------- /docs/img/ray-tracing-3d-track_cycles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/ray-tracing-3d-track_cycles.png -------------------------------------------------------------------------------- /docs/img/ray-tracing-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/ray-tracing-algorithm.png -------------------------------------------------------------------------------- /docs/img/saxpy.cpp: -------------------------------------------------------------------------------- 1 | /* File saxpy.cpp */ 2 | #include "saxpy.h" 3 | 4 | /* Define global variables */ 5 | int length; 6 | double a; 7 | double* x; 8 | double* y; 9 | 10 | void set_array_length(int n) { 11 | length = n; 12 | } 13 | 14 | void initialize_data() { 15 | 16 | /* Allocate memory for arrays */ 17 | x = (double*)malloc(length*sizeof(double)); 18 | y = (double*)malloc(length*sizeof(double)); 19 | 20 | /* Initialize data with random numbers in [0,1] */ 21 | a = float(rand()) / RAND_MAX; 22 | 23 | for (int i=0; i < length; i++) { 24 | x[i] = float(rand()) / RAND_MAX; 25 | y[i] = float(rand()) / RAND_MAX; 26 | } 27 | } 28 | 29 | void free_data() { 30 | free(x); 31 | free(y); 32 | } 33 | 34 | void print_data() { 35 | printf("a = %f\n", a); 36 | 37 | for (int i=0; i < length; i++) 38 | printf("x[%d] = %f\ty[%d] = %f\n", i, x[i], i, y[i]); 39 | } 40 | 41 | void saxpy() { 42 | for (int i=0; i < length; i++) 43 | y[i] = a * x[i] + y[i]; 44 | } 45 | -------------------------------------------------------------------------------- /docs/img/saxpy.h: -------------------------------------------------------------------------------- 1 | /* File saxpy.h */ 2 | #include 3 | #include 4 | 5 | /* Define function prototypes */ 6 | void set_array_length(int n); 7 | void initialize_data(); 8 | void free_data(); 9 | void print_data(); 10 | void saxpy(); 11 | -------------------------------------------------------------------------------- /docs/img/saxpy.i: -------------------------------------------------------------------------------- 1 | %module saxpy 2 | %{ 3 | #define SWIG_FILE_WITH_INIT 4 | #include "saxpy.h" 5 | %} 6 | 7 | %include "saxpy.h" 8 | -------------------------------------------------------------------------------- /docs/img/segments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/segments.png -------------------------------------------------------------------------------- /docs/img/solvers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/solvers.png -------------------------------------------------------------------------------- /docs/img/source-update-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/source-update-algorithm.png -------------------------------------------------------------------------------- /docs/img/spatial-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/spatial-a.png -------------------------------------------------------------------------------- /docs/img/spatial-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/spatial-b.png -------------------------------------------------------------------------------- /docs/img/spatial-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/spatial-c.png -------------------------------------------------------------------------------- /docs/img/sum_array.cpp: -------------------------------------------------------------------------------- 1 | /* File sum_array.cpp */ 2 | 3 | /* Define function implementation */ 4 | double sum_array(double* input_array, int length) { 5 | 6 | /* Initialize sum */ 7 | double sum = 0.; 8 | 9 | /* Compute sum of array elements */ 10 | for (int i=0; i < length; i++) 11 | sum += input_array[i]; 12 | 13 | return sum; 14 | } 15 | -------------------------------------------------------------------------------- /docs/img/sum_array.h: -------------------------------------------------------------------------------- 1 | /* File sum_array.h */ 2 | 3 | /* Define function prototype to take in a NumPy array */ 4 | double sum_array(double* input_array, int length); 5 | -------------------------------------------------------------------------------- /docs/img/sum_array.i: -------------------------------------------------------------------------------- 1 | %module sum_array 2 | 3 | %{ 4 | #define SWIG_FILE_WITH_INIT 5 | #include "sum_array.h" 6 | %} 7 | 8 | /* Include the NumPy typemaps library */ 9 | %include "numpy.i" 10 | 11 | %init %{ 12 | import_array(); 13 | %} 14 | 15 | /* Typemap for the sum_list(double* input_list, int length) C/C++ routine */ 16 | %apply (double* IN_ARRAY1, int DIM1) {(double* input_array, int length)}; 17 | 18 | %include "sum_array.h" 19 | -------------------------------------------------------------------------------- /docs/img/sum_list.cpp: -------------------------------------------------------------------------------- 1 | /* File sum_list.cpp */ 2 | #include "sum_list.h" 3 | 4 | double sum_list(double* input_list, int length) { 5 | 6 | /* Initialize sum */ 7 | double sum = 0.; 8 | 9 | /* Compute sum of array elements */ 10 | for (int i=0; i < length; i++) 11 | sum += input_list[i]; 12 | 13 | return sum; 14 | } 15 | -------------------------------------------------------------------------------- /docs/img/sum_list.h: -------------------------------------------------------------------------------- 1 | /* File sum_list.h */ 2 | #include 3 | 4 | /* Define function prototype */ 5 | double sum_list(double* input_list, int length); 6 | -------------------------------------------------------------------------------- /docs/img/sum_list.i: -------------------------------------------------------------------------------- 1 | %module sum_list 2 | %{ 3 | #define SWIG_FILE_WITH_INIT 4 | #include "sum_list.h" 5 | %} 6 | 7 | /* Include the SWIG typemaps library */ 8 | %include typemaps.i 9 | 10 | /* Typemap for the sum_list(double* input_list, int length) C/C++ routine */ 11 | %typemap(in) (double* input_list, int length) { 12 | 13 | /* Check that the input is a Python list data structure */ 14 | if (!PyList_Check($input)) { 15 | PyErr_SetString(PyExc_ValueError,"Expected a Python list of values\n"); 16 | return NULL; 17 | } 18 | 19 | /* Set the second parameter to the length of the Python list input */ 20 | $2 = PySequence_Length($input); 21 | 22 | /* Allocate memory to convert the list into a C/C++ array */ 23 | $1 = (double*) malloc($2 * sizeof(double)); 24 | 25 | /* Loop over the values in the list */ 26 | for (int i = 0; i < $2; i++) { 27 | 28 | /* Extract the value from the list at this location */ 29 | PyObject *o = PySequence_GetItem($input,i); 30 | 31 | /* If the value is a number, cast it as an int and set the 32 | * input array value */ 33 | if (PyNumber_Check(o)) { 34 | $1[i] = (double) PyFloat_AsDouble(o); 35 | } 36 | else { 37 | free($1); 38 | PyErr_SetString(PyExc_ValueError,"Expected a list of numbers\n"); 39 | return NULL; 40 | } 41 | } 42 | } 43 | 44 | %include "sum_list.h" 45 | -------------------------------------------------------------------------------- /docs/img/surfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/surfaces.png -------------------------------------------------------------------------------- /docs/img/surfs-cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/surfs-cells.png -------------------------------------------------------------------------------- /docs/img/tracks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/tracks.png -------------------------------------------------------------------------------- /docs/img/transport-sweep-algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/transport-sweep-algorithm.png -------------------------------------------------------------------------------- /docs/img/transport-sweep.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/transport-sweep.odg -------------------------------------------------------------------------------- /docs/img/transport-sweep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/transport-sweep.png -------------------------------------------------------------------------------- /docs/img/union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/docs/img/union.png -------------------------------------------------------------------------------- /docs/source/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% block footer %} 4 | {{ super() }} 5 | 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /docs/source/api/cell.rst: -------------------------------------------------------------------------------- 1 | .. _cell: 2 | 3 | ==== 4 | Cell 5 | ==== 6 | 7 | .. doxygenclass:: Cell 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/cellfill.rst: -------------------------------------------------------------------------------- 1 | .. _cellfill: 2 | 3 | ======== 4 | CellFill 5 | ======== 6 | 7 | .. doxygenclass:: CellFill 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/cmfd.rst: -------------------------------------------------------------------------------- 1 | .. _cmfd: 2 | 3 | ==== 4 | Cmfd 5 | ==== 6 | 7 | .. doxygenclass:: Cmfd 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/cpulssolver.rst: -------------------------------------------------------------------------------- 1 | .. _cpulssolver: 2 | 3 | =========== 4 | CPULSSolver 5 | =========== 6 | 7 | .. doxygenclass:: CPULSSolver 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/cpusolver.rst: -------------------------------------------------------------------------------- 1 | .. _cpusolver: 2 | 3 | ========= 4 | CPUSolver 5 | ========= 6 | 7 | .. doxygenclass:: CPUSolver 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/geometry.rst: -------------------------------------------------------------------------------- 1 | .. _geometry: 2 | 3 | ======== 4 | Geometry 5 | ======== 6 | 7 | .. doxygenclass:: Geometry 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/gpusolver.rst: -------------------------------------------------------------------------------- 1 | .. _gpusolver: 2 | 3 | ========= 4 | GPUSolver 5 | ========= 6 | 7 | .. doxygenclass:: GPUSolver 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/halfspace.rst: -------------------------------------------------------------------------------- 1 | .. _halfspace: 2 | 3 | ========= 4 | Halfspace 5 | ========= 6 | 7 | .. doxygenclass:: Halfspace 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/index.rst: -------------------------------------------------------------------------------- 1 | .. _api: 2 | 3 | =========== 4 | OpenMOC API 5 | =========== 6 | 7 | Welcome to the OpenMOC API! 8 | 9 | ------- 10 | Solvers 11 | ------- 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | 16 | solver 17 | cpusolver 18 | cpulssolver 19 | gpusolver 20 | vectorizedsolver 21 | 22 | ---------------------- 23 | Transport acceleration 24 | ---------------------- 25 | 26 | .. toctree:: 27 | :maxdepth: 1 28 | 29 | cmfd 30 | 31 | -------- 32 | Geometry 33 | -------- 34 | 35 | .. toctree:: 36 | :maxdepth: 1 37 | 38 | geometry 39 | universe 40 | lattice 41 | cell 42 | cellfill 43 | region 44 | halfspace 45 | surface 46 | plane 47 | xplane 48 | yplane 49 | zplane 50 | zcylinder 51 | 52 | 53 | ----------- 54 | Ray Tracing 55 | ----------- 56 | 57 | .. toctree:: 58 | :maxdepth: 1 59 | 60 | point 61 | track 62 | segment 63 | trackgenerator 64 | trackgenerator3D 65 | quadrature 66 | 67 | 68 | --------- 69 | Materials 70 | --------- 71 | 72 | .. toctree:: 73 | :maxdepth: 1 74 | 75 | material 76 | 77 | --------- 78 | Utilities 79 | --------- 80 | 81 | .. toctree:: 82 | :maxdepth: 1 83 | 84 | timer 85 | log 86 | pairwisesum 87 | -------------------------------------------------------------------------------- /docs/source/api/lattice.rst: -------------------------------------------------------------------------------- 1 | .. _lattice: 2 | 3 | ======= 4 | Lattice 5 | ======= 6 | 7 | .. doxygenclass:: Lattice 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/log.rst: -------------------------------------------------------------------------------- 1 | .. _log: 2 | 3 | === 4 | Log 5 | === 6 | 7 | .. doxygenfile:: log.h 8 | :project: OpenMOC 9 | -------------------------------------------------------------------------------- /docs/source/api/material.rst: -------------------------------------------------------------------------------- 1 | .. _material: 2 | 3 | ======== 4 | Material 5 | ======== 6 | 7 | .. doxygenclass:: Material 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/pairwisesum.rst: -------------------------------------------------------------------------------- 1 | .. _pairwisesum: 2 | 3 | ============ 4 | Pairwise Sum 5 | ============ 6 | 7 | .. doxygenfile:: pairwise_sum.h 8 | :project: OpenMOC 9 | -------------------------------------------------------------------------------- /docs/source/api/plane.rst: -------------------------------------------------------------------------------- 1 | .. _plane: 2 | 3 | ===== 4 | Plane 5 | ===== 6 | 7 | .. doxygenclass:: Plane 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/point.rst: -------------------------------------------------------------------------------- 1 | .. _point: 2 | 3 | ===== 4 | Point 5 | ===== 6 | 7 | .. doxygenclass:: Point 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/quadrature.rst: -------------------------------------------------------------------------------- 1 | .. _quadrature: 2 | 3 | ========== 4 | Quadrature 5 | ========== 6 | 7 | .. doxygenclass:: Quadrature 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/region.rst: -------------------------------------------------------------------------------- 1 | .. _region: 2 | 3 | ====== 4 | Region 5 | ====== 6 | 7 | .. doxygenclass:: Region 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/segment.rst: -------------------------------------------------------------------------------- 1 | .. _segment: 2 | 3 | ======= 4 | Segment 5 | ======= 6 | 7 | .. doxygenstruct:: segment 8 | :project: OpenMOC 9 | -------------------------------------------------------------------------------- /docs/source/api/solver.rst: -------------------------------------------------------------------------------- 1 | .. _solver: 2 | 3 | ====== 4 | Solver 5 | ====== 6 | 7 | .. doxygenclass:: Solver 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/surface.rst: -------------------------------------------------------------------------------- 1 | .. _surface: 2 | 3 | ======= 4 | Surface 5 | ======= 6 | 7 | .. doxygenclass:: Surface 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/timer.rst: -------------------------------------------------------------------------------- 1 | .. _timer: 2 | 3 | ===== 4 | Timer 5 | ===== 6 | 7 | .. doxygenclass:: Timer 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/track.rst: -------------------------------------------------------------------------------- 1 | .. _track: 2 | 3 | ===== 4 | Track 5 | ===== 6 | 7 | .. doxygenclass:: Track 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/trackgenerator.rst: -------------------------------------------------------------------------------- 1 | .. _trackgenerator: 2 | 3 | ============== 4 | TrackGenerator 5 | ============== 6 | 7 | .. doxygenclass:: TrackGenerator 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/trackgenerator3D.rst: -------------------------------------------------------------------------------- 1 | .. _trackgenerator3D: 2 | 3 | ================ 4 | TrackGenerator3D 5 | ================ 6 | 7 | .. doxygenclass:: TrackGenerator3D 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/universe.rst: -------------------------------------------------------------------------------- 1 | .. _universe: 2 | 3 | ======== 4 | Universe 5 | ======== 6 | 7 | .. doxygenclass:: Universe 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/vectorizedsolver.rst: -------------------------------------------------------------------------------- 1 | .. _vectorizedsolver: 2 | 3 | ================ 4 | VectorizedSolver 5 | ================ 6 | 7 | .. doxygenclass:: VectorizedSolver 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/xplane.rst: -------------------------------------------------------------------------------- 1 | .. _xplane: 2 | 3 | ====== 4 | XPlane 5 | ====== 6 | 7 | .. doxygenclass:: XPlane 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/yplane.rst: -------------------------------------------------------------------------------- 1 | .. _yplane: 2 | 3 | ====== 4 | YPlane 5 | ====== 6 | 7 | .. doxygenclass:: YPlane 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/zcylinder.rst: -------------------------------------------------------------------------------- 1 | .. _zcylinder: 2 | 3 | ========= 4 | ZCylinder 5 | ========= 6 | 7 | .. doxygenclass:: ZCylinder 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/api/zplane.rst: -------------------------------------------------------------------------------- 1 | .. _zplane: 2 | 3 | ====== 4 | ZPlane 5 | ====== 6 | 7 | .. doxygenclass:: ZPlane 8 | :project: OpenMOC 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/devguide/index.rst: -------------------------------------------------------------------------------- 1 | .. _devguide: 2 | 3 | ================= 4 | Developer's Guide 5 | ================= 6 | 7 | Welcome to the OpenMOC Developer's Guide! The Developer's Guide is a **must read** for those planning to contribute new code features to the OpenMOC open source project. This guide documents and explains the structure and design of the OpenMOC source code. The Guide discusses how SWIG is used to couple compiled C/C++ source code into a Python interface. In addition, the Python build system and techniques for debugging OpenMOC are presented. The Guide concludes with an overview of the coding style and development workflow used by the OpenMOC development team. 8 | 9 | .. toctree:: 10 | :numbered: 11 | :maxdepth: 2 12 | 13 | software_design 14 | swig 15 | build_system 16 | debugging 17 | style_guide 18 | documentation 19 | work_flow 20 | -------------------------------------------------------------------------------- /docs/source/doxygen/api.rst: -------------------------------------------------------------------------------- 1 | .. _api: 2 | 3 | =========== 4 | OpenMOC API 5 | =========== 6 | 7 | .. raw:: html 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | ========================================== 2 | The OpenMOC Method of Characteristics Code 3 | ========================================== 4 | 5 | OpenMOC is a Method of Characteristics (MOC) neutral particle transport code for reactor physics criticality calculations. The OpenMOC project aims to be the first publicly available MOC code platform for full-core 3D reactor physics analysis. At the present time, it is capable of simulating 2D assembly and full-core reactor models based on constructive solid geometry with second-order surfaces. High-performance parallel solvers for multi-core CPUs and GPUs are actively pursued as part of the OpenMOC project. In addition, continued development of algorithmic acceleration techniques such as coarse mesh finite difference (CMFD) acceleration, are a focus of the OpenMOC project. 6 | 7 | OpenMOC was originally developed by members of the `Computational Reactor Physics 8 | Group`_ at the `Massachusetts Institute of Technology`_ starting 9 | in 2012. For more information on OpenMOC, feel free to send a message to the User's Group `mailing list`_. 10 | 11 | .. _Computational Reactor Physics Group: http://crpg.mit.edu 12 | .. _Massachusetts Institute of Technology: http://web.mit.edu 13 | .. _mailing list: https://groups.google.com/forum/?hl=en#!forum/openmoc-users 14 | 15 | 16 | -------- 17 | Contents 18 | -------- 19 | 20 | .. toctree:: 21 | :maxdepth: 1 22 | 23 | quickinstall 24 | releasenotes/index 25 | methods/index 26 | usersguide/index 27 | devguide/index 28 | doxygen/api 29 | publications 30 | developers 31 | license 32 | 33 | 34 | .. figure:: ../img/cover.png 35 | :align: center 36 | :figclass: align-center 37 | -------------------------------------------------------------------------------- /docs/source/license.rst: -------------------------------------------------------------------------------- 1 | .. _license: 2 | 3 | ================= 4 | License Agreement 5 | ================= 6 | 7 | Copyright © 2012-2023 Massachusetts Institute of Technology 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of 10 | this software and associated documentation files (the "Software"), to deal in 11 | the Software without restriction, including without limitation the rights to 12 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 13 | the Software, and to permit persons to whom the Software is furnished to do so, 14 | subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 21 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 22 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 23 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /docs/source/methods/index.rst: -------------------------------------------------------------------------------- 1 | .. _methods: 2 | 3 | ====================== 4 | Theory and Methodology 5 | ====================== 6 | 7 | .. toctree:: 8 | :numbered: 9 | :maxdepth: 2 10 | 11 | introduction 12 | method_of_characteristics 13 | eigenvalue_calculations 14 | constructive_solid_geometry 15 | track_generation 16 | parallelization 17 | cmfd 18 | krylov 19 | -------------------------------------------------------------------------------- /docs/source/methods/parallelization.rst: -------------------------------------------------------------------------------- 1 | .. _parallelization: 2 | 3 | ====================================================================== 4 | Parallelization of the Method of Characteristics for neutron transport 5 | ====================================================================== 6 | 7 | Coming soon 8 | -------------------------------------------------------------------------------- /docs/source/releasenotes/index.rst: -------------------------------------------------------------------------------- 1 | .. _releasenotes: 2 | 3 | ============= 4 | Release Notes 5 | ============= 6 | 7 | The release notes for OpenMOC give a list of system requirements, new features, 8 | bugs fixed, and known issues for each successive release. Release notes are currently only posted on `Github`_. 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | notes_0.1.1 14 | notes_0.1.2 15 | notes_0.1.3 16 | notes_0.1.4 17 | 18 | .. _Github : https://github.com/mit-crpg/OpenMOC/releases 19 | -------------------------------------------------------------------------------- /docs/source/releasenotes/notes_0.1.1.rst: -------------------------------------------------------------------------------- 1 | .. _notes_0.1.1: 2 | 3 | =============================== 4 | Release Notes for OpenMOC 0.1.1 5 | =============================== 6 | 7 | ------------------- 8 | System Requirements 9 | ------------------- 10 | 11 | There are no special requirements for running the OpenMOC code. As of this 12 | release, OpenMOC has been tested on a variety of Linux distributions as well as 13 | Mac OS X. However, it has not been tested yet on any releases of Microsoft 14 | Windows. Memory requirements will vary depending on the size of the problem at 15 | hand (the number of flat source regions and the level of track discretization). 16 | 17 | ------------ 18 | New Features 19 | ------------ 20 | 21 | - `9ba06b2`_: Added exponential intrinsic evaluation option for GPUSolver. 22 | - `0f2a8d8`_: Implemented a thread private vectorized solver class (VectorizedPrivateClass). 23 | - `3ca79f5`_: Track segments now stored in a stride one array to improve cache coherency. 24 | - `3baffee`_: OpenMP parallel regions use guided rather than dynamic scheduling. 25 | 26 | .. _9ba06b2: https://github.com/mit-crpg/OpenMOC/commit/9ba06b2 27 | .. _0f2a8d8: https://github.com/mit-crpg/OpenMOC/commit/0f2a8d8 28 | .. _3ca79f5: https://github.com/mit-crpg/OpenMOC/commit/3ca79f5 29 | .. _3baffee: https://github.com/mit-crpg/OpenMOC/commit/3baffee 30 | 31 | --------- 32 | Bug Fixes 33 | --------- 34 | -------------------------------------------------------------------------------- /docs/source/releasenotes/notes_0.1.3.rst: -------------------------------------------------------------------------------- 1 | .. _notes_0.1.3: 2 | 3 | =============================== 4 | Release Notes for OpenMOC 0.1.3 5 | =============================== 6 | 7 | ------------------- 8 | System Requirements 9 | ------------------- 10 | 11 | There are no special requirements for running the OpenMOC code. As of this 12 | release, OpenMOC has been tested on a variety of Linux distributions as well as 13 | Mac OS X. However, it has not been tested yet on any releases of Microsoft 14 | Windows. Memory requirements will vary depending on the size of the problem at 15 | hand (the number of flat source regions and the level of track discretization). 16 | 17 | ------------ 18 | New Features 19 | ------------ 20 | 21 | - `bee1e60397`_: Reconstructed segmentation routines to allow for tracking across overlapping cells. 22 | - `a5ccd1324f`_: Added P0 boundary flux update to CMFD solver. 23 | 24 | .. _a5ccd1324f : https://github.com/mit-crpg/OpenMOC/commit/a5ccd1324f 25 | .. _bee1e60397 : https://github.com/mit-crpg/OpenMOC/commit/bee1e60397 26 | 27 | --------- 28 | Bug Fixes 29 | --------- 30 | 31 | - `a5ccd1324f`_: Fixed procedural error in computing diffusion coefficients in CMFD. 32 | - `bee1e60397`_: Fixed error in computing the CMFD optically thick correction factor. 33 | - `bee1e60397`_: TrackGenerator geometry string was incorrect resulting in TrackGenerator often not identifying a valid track file when one actually existed. The error in generating the geometry string has been corrected. 34 | - `bee1e60397`_: Fixed inconsistency in XPlane and YPlane constants. 35 | 36 | .. _a5ccd1324f : https://github.com/mit-crpg/OpenMOC/commit/a5ccd1324f 37 | .. _bee1e60397 : https://github.com/mit-crpg/OpenMOC/commit/bee1e60397 38 | -------------------------------------------------------------------------------- /docs/source/usersguide/index.rst: -------------------------------------------------------------------------------- 1 | .. _usersguide: 2 | 3 | ============ 4 | User's Guide 5 | ============ 6 | 7 | Welcome to the OpenMOC User's Guide! This tutorial will guide you through the 8 | essential aspects of using OpenMOC to perform neutron transport reactor physics calculations. 9 | 10 | .. toctree:: 11 | :numbered: 12 | :maxdepth: 2 13 | 14 | beginners 15 | install 16 | input 17 | processing 18 | running 19 | troubleshoot 20 | -------------------------------------------------------------------------------- /docs/source/usersguide/troubleshoot.rst: -------------------------------------------------------------------------------- 1 | .. _usersguide_troubleshoot: 2 | 3 | =============== 4 | Troubleshooting 5 | =============== 6 | 7 | If you are experiencing problems trying to compile OpenMOC, first check if the 8 | error you are receiving is among the following options. 9 | 10 | If not, you may email the `mailing list`_, and a developer or another user may help you. 11 | 12 | 13 | ------------------------- 14 | Problems with Compilation 15 | ------------------------- 16 | 17 | NameError: ... is not defined 18 | ----------------------------- 19 | 20 | In some cases, the symbolic links for the code are not established correctly and users may receive a `NameError`, and example of which is given below:: 21 | 22 | Traceback (most recent call last): 23 | File "simple-lattice.py", line 1, in 24 | from openmoc import * 25 | File "/home/wbinventor/.local/lib/python2.7/site-packages/openmoc/__init__.py", line 15, in 26 | setLogfileName('log/openmoc-' + current_time + '.log'); 27 | NameError: name 'setLogfileName' is not defined 28 | 29 | This error is commonly seen by new users after just installing the code. As noted in the :ref:`Installation and Configuration `, some Python distributions require that OpenMOC be installed twice the first time it is installed. The recommended solution in this case would be to execute the installation command twice in sequence:: 30 | 31 | python setup.py install --user 32 | python setup.py install --user 33 | 34 | 35 | 36 | .. _mailing list: https://groups.google.com/forum/?hl=en#!forum/openmoc-users 37 | -------------------------------------------------------------------------------- /logo/openmoc-logo.cdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/logo/openmoc-logo.cdr -------------------------------------------------------------------------------- /logo/openmoc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/logo/openmoc-logo.png -------------------------------------------------------------------------------- /logo/openmoc-logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/logo/openmoc-logo.psd -------------------------------------------------------------------------------- /openmoc/__init__.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | import random 3 | import datetime 4 | import signal 5 | 6 | # For Python 2.X.X 7 | if (sys.version_info[0] == 2): 8 | from openmoc import * 9 | from subdivider import Subdivider 10 | import log 11 | import options 12 | import materialize 13 | import plotter 14 | import process 15 | import krylov 16 | # For Python 3.X.X 17 | else: 18 | from openmoc.openmoc import * 19 | from openmoc.subdivider import Subdivider 20 | import openmoc.log 21 | import openmoc.options 22 | import openmoc.materialize 23 | import openmoc.plotter 24 | import openmoc.process 25 | import openmoc.krylov 26 | 27 | # Tell Python to recognize CTRL+C and stop the C++ extension module 28 | # when this is passed in from the keyboard 29 | signal.signal(signal.SIGINT, signal.SIG_DFL) 30 | 31 | # Build a log file name using the date and time 32 | left_pad = lambda x: x.zfill(2) 33 | now = datetime.datetime.now() 34 | time = (now.month, now.day, now.year, now.hour, now.minute, now.second) 35 | year_string = '-'.join(map(left_pad, map(str, (now.month, now.day, now.year)))) 36 | today_string = ':'.join(map(left_pad, map(str, (now.hour, now.minute, now.second)))) 37 | today_string += ':' + str(now.microsecond)[:2] 38 | time_string = year_string + '--' + today_string 39 | initialize_logger() 40 | set_log_filename('openmoc-' + time_string + '.log'); 41 | -------------------------------------------------------------------------------- /openmoc/compatible/__init__.py: -------------------------------------------------------------------------------- 1 | from casmo import * 2 | from opencg_compatible import * -------------------------------------------------------------------------------- /openmoc/cuda/__init__.py: -------------------------------------------------------------------------------- 1 | import signal 2 | import sys 3 | 4 | # For Python 2.X.X 5 | if (sys.version_info[0] == 2): 6 | import openmoc 7 | import _openmoc_cuda 8 | from openmoc_cuda import * 9 | # For Python 3.X.X 10 | else: 11 | import openmoc.openmoc as openmoc 12 | import _openmoc_cuda 13 | from openmoc.cuda.openmoc_cuda import * 14 | 15 | # Tell Python to recognize CTRL+C and stop the C++ extension module 16 | # when this is passed in from the keyboard 17 | signal.signal(signal.SIGINT, signal.SIG_DFL) 18 | -------------------------------------------------------------------------------- /openmoc/cuda/openmoc_cuda.i: -------------------------------------------------------------------------------- 1 | %define DOCSTRING 2 | "A method of characteristics code for nuclear reactor physics calculations." 3 | %enddef 4 | 5 | %module(docstring=DOCSTRING) openmoc_cuda 6 | 7 | %{ 8 | #define SWIG_FILE_WITH_INIT 9 | 10 | #define PySys_WriteStdout printf 11 | 12 | #include 13 | #include "../../src/constants.h" 14 | #include "../../src/Solver.h" 15 | #include "../../src/accel/cuda/GPUSolver.h" 16 | #include "../../src/accel/cuda/GPUQuery.h" 17 | #include "../../src/accel/cuda/clone.h" 18 | 19 | /* Exception helpers */ 20 | static int swig_c_error_num = 0; 21 | static char swig_c_err_msg[1024]; 22 | 23 | const char* err_occurred(void) { 24 | if (swig_c_error_num) { 25 | swig_c_error_num = 0; 26 | return (const char*)swig_c_err_msg; 27 | } 28 | return NULL; 29 | } 30 | 31 | void set_err(const char *msg) { 32 | swig_c_error_num = 1; 33 | strncpy(swig_c_err_msg, msg, 1024); 34 | } 35 | %} 36 | 37 | %exception { 38 | try { 39 | $function 40 | } catch (const std::exception &e) { 41 | SWIG_exception(SWIG_RuntimeError, e.what()); 42 | } 43 | } 44 | 45 | #ifdef NO_NUMPY 46 | #else 47 | %include "../swig/numpy_typemaps.i" 48 | #endif 49 | 50 | %include 51 | %include 52 | %include ../../src/constants.h 53 | %include ../../src/Solver.h 54 | %include ../../src/accel/cuda/GPUSolver.h 55 | %include ../../src/accel/cuda/GPUQuery.h 56 | %include ../../src/accel/cuda/clone.h 57 | 58 | #define PySys_WriteStdout printf 59 | -------------------------------------------------------------------------------- /openmoc/swig/argument_typemaps.i: -------------------------------------------------------------------------------- 1 | /** Helper typemaps to enable user input to functions that require pointers 2 | as input */ 3 | 4 | %module argument_typemaps 5 | 6 | /* Use swig typemaps */ 7 | %include 8 | 9 | /* Typemaps for the intrinsic exponentials */ 10 | void expF1_poly(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 11 | void expF2_poly(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 12 | void expH_poly(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 13 | void expF1_fractional(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 14 | void expF2_fractional(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 15 | void expH_fractional(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 16 | void expG_fractional(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 17 | void expG2_fractional(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 18 | void cram7(FP_PRECISION INPUT, FP_PRECISION* OUTPUT); 19 | -------------------------------------------------------------------------------- /openmoc/swig/casting.i: -------------------------------------------------------------------------------- 1 | /* C++ casting helper method for openmoc.process computePinPowers 2 | * routine and the OpenCG compatibility module */ 3 | 4 | %module casting 5 | 6 | %inline %{ 7 | 8 | Lattice* castUniverseToLattice(Universe* universe) { 9 | return dynamic_cast(universe); 10 | } 11 | 12 | Universe* castLatticeToUniverse(Lattice* lattice) { 13 | return dynamic_cast(lattice); 14 | } 15 | 16 | Intersection* castRegionToIntersection(Region* region) { 17 | return dynamic_cast(region); 18 | } 19 | 20 | Union* castRegionToUnion(Region* region) { 21 | return dynamic_cast(region); 22 | } 23 | 24 | Complement* castRegionToComplement(Region* region) { 25 | return dynamic_cast(region); 26 | } 27 | 28 | Halfspace* castRegionToHalfspace(Region* region) { 29 | return dynamic_cast(region); 30 | } 31 | 32 | Plane* castSurfaceToPlane(Surface* plane) { 33 | return dynamic_cast(plane); 34 | } 35 | 36 | XPlane* castSurfaceToXPlane(Surface* xplane) { 37 | return dynamic_cast(xplane); 38 | } 39 | 40 | YPlane* castSurfaceToYPlane(Surface* yplane) { 41 | return dynamic_cast(yplane); 42 | } 43 | 44 | ZPlane* castSurfaceToZPlane(Surface* zplane) { 45 | return dynamic_cast(zplane); 46 | } 47 | 48 | ZCylinder* castSurfaceToZCylinder(Surface* zcylinder) { 49 | return dynamic_cast(zcylinder); 50 | } 51 | %} 52 | -------------------------------------------------------------------------------- /profile/models/run_time_standard/simple-lattice-3d.geo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/profile/models/run_time_standard/simple-lattice-3d.geo -------------------------------------------------------------------------------- /profile/results/strip_file.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | x = set() 4 | with open(os.environ['PBS_NODEFILE'], 'r') as fh: 5 | lines = fh.readlines() 6 | for line in lines: 7 | x.add(line) 8 | 9 | name = 'machine-' + xxxMACHINExxx 10 | with open(name, 'w') as fh: 11 | for xi in x: 12 | fh.write(xi) 13 | -------------------------------------------------------------------------------- /profile/results/submit_base.pbs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ####################################### 3 | # Specify nodes, processors per node 4 | # and maximum running time 5 | ####################################### 6 | 7 | #PBS -N xxxNAMExxx 8 | #PBS -l nodes=xxxNODESxxx:ppn=xxxPPNxxx 9 | #PBS -l walltime=xxxWTxxx 10 | #PBS -l mem=xxxMEMxxxGB 11 | 12 | ###################################### 13 | # Enter directory and set PATH 14 | ###################################### 15 | 16 | cd $PBS_O_WORKDIR 17 | PATH=$PBS_O_PATH 18 | 19 | ###################################### 20 | # Run OpenMOC - MAKE YOUR CHANGES HERE 21 | ###################################### 22 | 23 | module load gcc 24 | module load mpich2/gnu 25 | python xxxSTRIPxxx 26 | mpiexec -machinefile xxxMACHINExxx ./xxxEXECUTExxx 27 | -------------------------------------------------------------------------------- /sample-input/benchmarks/LRA/LRA-mgxs.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/benchmarks/LRA/LRA-mgxs.h5 -------------------------------------------------------------------------------- /sample-input/benchmarks/LRA/surfaces.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | 3 | ############################################################################### 4 | # Create dictionary of common surfaces 5 | ############################################################################### 6 | 7 | surfaces = {} 8 | 9 | # Instantiate surfaces 10 | surfaces['x-min'] = openmoc.XPlane(x=-82.5, name='x-min') 11 | surfaces['y-min'] = openmoc.YPlane(y=-82.5, name='y-min') 12 | surfaces['x-max'] = openmoc.XPlane(x= 82.5, name='x-max') 13 | surfaces['y-max'] = openmoc.YPlane(y= 82.5, name='y-max') 14 | 15 | surfaces['x-min'].setBoundaryType(openmoc.REFLECTIVE) 16 | surfaces['y-min'].setBoundaryType(openmoc.REFLECTIVE) 17 | surfaces['x-max'].setBoundaryType(openmoc.VACUUM) 18 | surfaces['y-max'].setBoundaryType(openmoc.VACUUM) 19 | -------------------------------------------------------------------------------- /sample-input/benchmarks/LRA/universes.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | from cells import cells 3 | 4 | ############################################################################### 5 | # Creating Universes 6 | ############################################################################### 7 | 8 | universes = {} 9 | 10 | universes['Region 1'] = openmoc.Universe(name='Region 1') 11 | universes['Region 2'] = openmoc.Universe(name='Region 2') 12 | universes['Region 3'] = openmoc.Universe(name='Region 3') 13 | universes['Region 4'] = openmoc.Universe(name='Region 4') 14 | universes['Region 5'] = openmoc.Universe(name='Region 5') 15 | universes['Region 1 Assembly'] = openmoc.Universe(name='Region 1 Assembly') 16 | universes['Region 2 Assembly'] = openmoc.Universe(name='Region 2 Assembly') 17 | universes['Region 3 Assembly'] = openmoc.Universe(name='Region 3 Assembly') 18 | universes['Region 4 Assembly'] = openmoc.Universe(name='Region 4 Assembly') 19 | universes['Region 5 Assembly'] = openmoc.Universe(name='Region 5 Assembly') 20 | universes['Root'] = openmoc.Universe(name='Root') 21 | 22 | # Add cells to universes 23 | universes['Region 1'] .addCell(cells['Region 1']) 24 | universes['Region 2'] .addCell(cells['Region 2']) 25 | universes['Region 3'] .addCell(cells['Region 3']) 26 | universes['Region 4'] .addCell(cells['Region 4']) 27 | universes['Region 5'] .addCell(cells['Region 5']) 28 | universes['Region 1 Assembly'].addCell(cells['Region 1 Assembly']) 29 | universes['Region 2 Assembly'].addCell(cells['Region 2 Assembly']) 30 | universes['Region 3 Assembly'].addCell(cells['Region 3 Assembly']) 31 | universes['Region 4 Assembly'].addCell(cells['Region 4 Assembly']) 32 | universes['Region 5 Assembly'].addCell(cells['Region 5 Assembly']) 33 | universes['Root'] .addCell(cells['Root']) 34 | -------------------------------------------------------------------------------- /sample-input/benchmarks/c5g7/c5g7.pbs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ####################################### 3 | # Specify nodes, processors per node 4 | # and maximum running time 5 | ####################################### 6 | 7 | #PBS -l nodes=1:ppn=12 8 | #PBS -l walltime=01:00:00 9 | 10 | ###################################### 11 | # Enter directory and set PATH 12 | ###################################### 13 | 14 | cd $PBS_O_WORKDIR 15 | PATH=$PBS_O_PATH 16 | 17 | ###################################### 18 | # Run OpenMOC - MAKE YOUR CHANGES HERE 19 | ###################################### 20 | 21 | #PBS -k eo 22 | python c5g7-2d.py 23 | -------------------------------------------------------------------------------- /sample-input/benchmarks/c5g7/gap-05-rodB-A6-v1.geo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/benchmarks/c5g7/gap-05-rodB-A6-v1.geo -------------------------------------------------------------------------------- /sample-input/benchmarks/c5g7/gap-10-rodB-A6-v1.geo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/benchmarks/c5g7/gap-10-rodB-A6-v1.geo -------------------------------------------------------------------------------- /sample-input/benchmarks/c5g7/gap-50-rodB-A6-v1.geo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/benchmarks/c5g7/gap-50-rodB-A6-v1.geo -------------------------------------------------------------------------------- /sample-input/benchmarks/takeda/model_1/cells.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | import openmoc.materialize as materialize 3 | from surfaces import surfaces 4 | 5 | ############################################################################### 6 | # Creating Materials 7 | ############################################################################### 8 | 9 | materials = materialize.load_from_hdf5('takeda-mgxs.h5', '') 10 | 11 | ############################################################################### 12 | # Create dictionary of all cells 13 | ############################################################################### 14 | 15 | cells = {} 16 | 17 | # Instantiate Cells 18 | cells['Core'] = openmoc.Cell(name='Core') 19 | cells['Control Rod'] = openmoc.Cell(name='Control Rod') 20 | cells['Void'] = openmoc.Cell(name='Void') 21 | cells['Reflector'] = openmoc.Cell(name='Reflector') 22 | cells['Root'] = openmoc.Cell(name='Root') 23 | 24 | # Register Materials with Cells 25 | cells['Core'].setFill(materials['Core']) 26 | cells['Void'].setFill(materials['Void']) 27 | cells['Control Rod'].setFill(materials['Control Rod']) 28 | cells['Reflector'].setFill(materials['Reflector']) 29 | 30 | # Add surfaces to root cell 31 | cells['Root'].addSurface(halfspace=+1, surface=surfaces['Root x-min']) 32 | cells['Root'].addSurface(halfspace=-1, surface=surfaces['Root x-max']) 33 | cells['Root'].addSurface(halfspace=+1, surface=surfaces['Root y-min']) 34 | cells['Root'].addSurface(halfspace=-1, surface=surfaces['Root y-max']) 35 | cells['Root'].addSurface(halfspace=+1, surface=surfaces['Root z-min']) 36 | cells['Root'].addSurface(halfspace=-1, surface=surfaces['Root z-max']) 37 | -------------------------------------------------------------------------------- /sample-input/benchmarks/takeda/model_1/lattices.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | from universes import universes, cells 3 | 4 | ############################################################################### 5 | ########################### Creating Lattices ############################# 6 | ############################################################################### 7 | 8 | lattices = {} 9 | 10 | # Instantiate Lattices 11 | lattices['Root'] = openmoc.Lattice() 12 | 13 | # Fill cells with lattices 14 | cells['Root'].setFill(lattices['Root']) 15 | -------------------------------------------------------------------------------- /sample-input/benchmarks/takeda/model_1/surfaces.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | 3 | ############################################################################### 4 | # Create dictionary of common surfaces 5 | ############################################################################### 6 | 7 | surfaces = {} 8 | 9 | # Instantiate surfaces 10 | surfaces['Root x-min'] = openmoc.XPlane(x=-12.5, name='Root x-min') 11 | surfaces['Root y-min'] = openmoc.YPlane(y=-12.5, name='Root y-min') 12 | surfaces['Root z-min'] = openmoc.ZPlane(z=-12.5, name='Root z-min') 13 | surfaces['Root x-max'] = openmoc.XPlane(x= 12.5, name='Root x-max') 14 | surfaces['Root y-max'] = openmoc.YPlane(y= 12.5, name='Root y-max') 15 | surfaces['Root z-max'] = openmoc.ZPlane(z= 12.5, name='Root z-max') 16 | 17 | surfaces['Root x-min'].setBoundaryType(openmoc.REFLECTIVE) 18 | surfaces['Root y-min'].setBoundaryType(openmoc.REFLECTIVE) 19 | surfaces['Root z-min'].setBoundaryType(openmoc.REFLECTIVE) 20 | surfaces['Root x-max'].setBoundaryType(openmoc.VACUUM) 21 | surfaces['Root y-max'].setBoundaryType(openmoc.VACUUM) 22 | surfaces['Root z-max'].setBoundaryType(openmoc.VACUUM) 23 | -------------------------------------------------------------------------------- /sample-input/benchmarks/takeda/model_1/takeda-mgxs.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/benchmarks/takeda/model_1/takeda-mgxs.h5 -------------------------------------------------------------------------------- /sample-input/benchmarks/takeda/model_1/universes.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | from cells import cells 3 | 4 | ############################################################################### 5 | # Creating Universes 6 | ############################################################################### 7 | 8 | universes = {} 9 | 10 | universes['Core'] = openmoc.Universe(name='Core') 11 | universes['Reflector'] = openmoc.Universe(name='Reflector') 12 | universes['Control Rod'] = openmoc.Universe(name='Control Rod') 13 | universes['Void'] = openmoc.Universe(name='Void') 14 | universes['Root'] = openmoc.Universe(name='Root') 15 | 16 | # Add cells to universes 17 | universes['Core'] .addCell(cells['Core']) 18 | universes['Control Rod'].addCell(cells['Control Rod']) 19 | universes['Reflector'] .addCell(cells['Reflector']) 20 | universes['Void'] .addCell(cells['Void']) 21 | universes['Root'] .addCell(cells['Root']) 22 | -------------------------------------------------------------------------------- /sample-input/c5g7-mgxs.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/c5g7-mgxs.h5 -------------------------------------------------------------------------------- /sample-input/sph-factors/pin-cell/compute-mgxs.py: -------------------------------------------------------------------------------- 1 | import openmc 2 | import openmc.mgxs 3 | 4 | # Load the last statepoint file 5 | sp = openmc.StatePoint('statepoint.100.h5') 6 | 7 | # Instantiate a 16-group EnergyGroups object 8 | groups = openmc.mgxs.EnergyGroups() 9 | groups.group_edges = [0., 0.03, 0.058, 0.14, 0.28, 0.35, 10 | 0.625, 0.85, 0.972, 1.02, 1.097, 11 | 1.15, 1.3, 4., 5.53e3, 821.e3, 20.e6] 12 | 13 | # Initialize an 2-group MGXS Library for OpenMOC 14 | mgxs_lib = openmc.mgxs.Library(sp.summary.geometry) 15 | mgxs_lib.energy_groups = groups 16 | mgxs_lib.mgxs_types = ['total', 'nu-fission', 'nu-scatter matrix', 'chi'] 17 | mgxs_lib.domain_type = 'cell' 18 | mgxs_lib.correction = None 19 | mgxs_lib.build_library() 20 | mgxs_lib.load_from_statepoint(sp) 21 | 22 | # Store library and its MGXS objects in a pickled binary file 23 | mgxs_lib.dump_to_file(filename='mgxs', directory='.') 24 | -------------------------------------------------------------------------------- /sample-input/sph-factors/pin-cell/mgxs.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/sph-factors/pin-cell/mgxs.pkl -------------------------------------------------------------------------------- /sample-input/sph-factors/slab/compute-mgxs.py: -------------------------------------------------------------------------------- 1 | import openmc 2 | import openmc.mgxs 3 | 4 | # Load the last statepoint file 5 | sp = openmc.StatePoint('statepoint.100.h5') 6 | 7 | # Instantiate a 1-group EnergyGroups object 8 | groups = openmc.mgxs.EnergyGroups() 9 | groups.group_edges = [0., 20e6] 10 | 11 | # Initialize an 2-group MGXS Library for OpenMOC 12 | mgxs_lib = openmc.mgxs.Library(sp.summary.geometry) 13 | mgxs_lib.energy_groups = groups 14 | mgxs_lib.mgxs_types = ['total', 'nu-fission', 'nu-scatter matrix', 'chi'] 15 | mgxs_lib.domain_type = 'cell' 16 | mgxs_lib.correction = None 17 | mgxs_lib.build_library() 18 | mgxs_lib.load_from_statepoint(sp) 19 | 20 | # Store library and its MGXS objects in a pickled binary file 21 | mgxs_lib.dump_to_file(filename='mgxs', directory='.') 22 | -------------------------------------------------------------------------------- /sample-input/sph-factors/slab/mgxs.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/sample-input/sph-factors/slab/mgxs.pkl -------------------------------------------------------------------------------- /sample-input/tiny-lattice/tiny-lattice-2d.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | import openmoc.log as log 3 | import openmoc.plotter as plotter 4 | from openmoc.options import Options 5 | from geometry import geometry 6 | 7 | ############################################################################### 8 | # Main Simulation Parameters 9 | ############################################################################### 10 | 11 | options = Options() 12 | 13 | num_threads = options.num_omp_threads 14 | azim_spacing = options.azim_spacing 15 | num_azim = options.num_azim 16 | polar_spacing = options.polar_spacing 17 | num_polar = options.num_polar 18 | tolerance = options.tolerance 19 | max_iters = options.max_iters 20 | 21 | 22 | ############################################################################### 23 | ######################## Creating the TrackGenerator ###################### 24 | ############################################################################### 25 | 26 | log.py_printf('NORMAL', 'Initializing the track generator...') 27 | 28 | track_generator = openmoc.TrackGenerator(geometry, num_azim, azim_spacing) 29 | track_generator.setNumThreads(num_threads) 30 | track_generator.generateTracks() 31 | 32 | 33 | ############################################################################### 34 | ########################### Running a Simulation ########################## 35 | ############################################################################### 36 | 37 | solver = openmoc.CPUSolver(track_generator) 38 | solver.setNumThreads(num_threads) 39 | solver.setConvergenceThreshold(tolerance) 40 | solver.computeEigenvalue(max_iters) 41 | solver.printTimerReport() 42 | 43 | log.py_printf('TITLE', 'Finished') 44 | -------------------------------------------------------------------------------- /sample-input/tiny-lattice/tiny-lattice-3d.py: -------------------------------------------------------------------------------- 1 | import openmoc 2 | import openmoc.log as log 3 | import openmoc.plotter as plotter 4 | from openmoc.options import Options 5 | from geometry import geometry 6 | 7 | ############################################################################### 8 | # Main Simulation Parameters 9 | ############################################################################### 10 | 11 | options = Options() 12 | 13 | num_threads = options.num_omp_threads 14 | azim_spacing = options.azim_spacing 15 | num_azim = options.num_azim 16 | polar_spacing = options.polar_spacing 17 | num_polar = options.num_polar 18 | tolerance = options.tolerance 19 | max_iters = options.max_iters 20 | 21 | 22 | ############################################################################### 23 | ######################## Creating the TrackGenerator ###################### 24 | ############################################################################### 25 | 26 | log.py_printf('NORMAL', 'Initializing the track generator...') 27 | 28 | track_generator = openmoc.TrackGenerator3D(geometry, num_azim, num_polar, \ 29 | azim_spacing, polar_spacing) 30 | track_generator.setNumThreads(num_threads) 31 | track_generator.setSegmentFormation(openmoc.OTF_STACKS) 32 | track_generator.generateTracks() 33 | 34 | 35 | ############################################################################### 36 | ########################### Running a Simulation ########################## 37 | ############################################################################### 38 | 39 | solver = openmoc.CPUSolver(track_generator) 40 | solver.setNumThreads(num_threads) 41 | solver.setConvergenceThreshold(tolerance) 42 | solver.computeEigenvalue(max_iters) 43 | solver.printTimerReport() 44 | 45 | 46 | log.py_printf('TITLE', 'Finished') 47 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.rst -------------------------------------------------------------------------------- /src/Point.cpp: -------------------------------------------------------------------------------- 1 | #include "Point.h" 2 | 3 | 4 | /** 5 | * @brief Constructor initializes an empty Point. 6 | */ 7 | Point::Point() { 8 | _xyz[0] = 0.0; 9 | _xyz[1] = 0.0; 10 | _xyz[2] = 0.0; 11 | } 12 | 13 | 14 | /** 15 | * @brief Destructor. 16 | */ 17 | Point::~Point() { 18 | } 19 | 20 | 21 | /** 22 | * @brief Converts this Point to a character representation of its attributes. 23 | * @details The character array includes the x-coordinate, y-coordinate, 24 | * and z-coordinate 25 | * @return a character array of this Point's attributes 26 | */ 27 | std::string Point::toString() { 28 | std::stringstream string; 29 | string << "Point: x = " << _xyz[0] << ", y = " << _xyz[1] << ", z = " << _xyz[2]; 30 | return string.str(); 31 | } 32 | -------------------------------------------------------------------------------- /src/Progress.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Progress.h 3 | * @brief An object to track progress 4 | * @date January 11, 2016 5 | * @author Samuel Shaner, MIT, Course 22 (shaner@mit.edu) 6 | */ 7 | 8 | #ifndef PROGRESS_H_ 9 | #define PROGRESS_H_ 10 | 11 | 12 | #ifdef __cplusplus 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "log.h" 25 | #endif 26 | 27 | #ifdef MPIx 28 | #include 29 | #endif 30 | 31 | class Geometry; 32 | 33 | class Progress { 34 | 35 | private: 36 | 37 | std::string _name; 38 | long _counter; 39 | long _num_iterations; 40 | int _curr_interval; 41 | std::vector _intervals; 42 | Geometry* _geometry; 43 | bool _mpi_comm; 44 | 45 | public: 46 | Progress(long num_iterations, std::string name, double interval=0.1, 47 | Geometry* geometry=NULL, bool mpi_comm=false); 48 | virtual ~Progress(); 49 | 50 | /* Worker functions */ 51 | void incrementCounter(); 52 | void reset(); 53 | }; 54 | 55 | #endif /* PROGRESS_H_ */ 56 | -------------------------------------------------------------------------------- /src/accel/cuda/GPUQuery.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GPUQuery.h 3 | * @brief Routines to check machine for an NVIDIA GPU and print GPU 4 | * and CUDA hardware characteristics to the screen. 5 | * @author May 30, 2013 6 | * @author William Boyd, MIT, Course 22 (wboyd@mit.edu) 7 | */ 8 | 9 | 10 | #ifndef GPUQUERY_H_ 11 | #define GPUQUERY_H_ 12 | 13 | #ifdef __cplusplus 14 | #ifdef SWIG 15 | #include "Python.h" 16 | #endif 17 | #include "../../log.h" 18 | #endif 19 | 20 | bool machine_contains_gpu(); 21 | void attach_gpu(int id=0); 22 | void print_basic_gpu_info(); 23 | void print_detailed_gpu_info(); 24 | int get_num_threads_per_warp(); 25 | 26 | /* Cuda error handling macro */ 27 | #define getLastCudaError() getLastCudaError_inline(__FILE__, __LINE__) 28 | inline void getLastCudaError_inline(const char* file, const int line) { 29 | cudaError_t err = cudaGetLastError(); 30 | 31 | if (err != cudaSuccess) { 32 | log_printf(ERROR, "%s:%i getLastCudaError() CUDA error:\n" 33 | "Error code %i: %s.\n", file, line, static_cast(err), 34 | cudaGetErrorString(err)); 35 | } 36 | } 37 | 38 | 39 | #endif /* GPUQUERY_H_ */ 40 | -------------------------------------------------------------------------------- /src/accel/cuda/clone.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file clone.h 3 | * @brief Routines to copy Material and Track objects to the GPU from CPU. 4 | * @author May 30, 2013 5 | * @author William Boyd, MIT, Course 22 (wboyd@mit.edu) 6 | */ 7 | 8 | 9 | #include "../DeviceMaterial.h" 10 | #include "../DeviceTrack.h" 11 | #include "GPUQuery.h" 12 | #include 13 | 14 | void clone_material(Material* material_h, dev_material* material_d); 15 | void clone_track(Track* track_h, dev_track* track_d, 16 | std::map &material_IDs_to_indices); 17 | -------------------------------------------------------------------------------- /src/boundary_type.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file boundary_type.h 3 | * @details The boundaryType enum. 4 | * @date January 10, 2015 5 | * @author William Boyd, MIT, Course 22 (wboyd@mit.edu) 6 | */ 7 | 8 | #ifndef BOUNDARY_TYPE_H_ 9 | #define BOUNDARY_TYPE_H_ 10 | 11 | /** 12 | * @enum boundaryType 13 | * @brief The types of boundary conditions supported by OpenMOC for Surfaces. 14 | */ 15 | enum boundaryType { 16 | /** A vacuum boundary condition */ 17 | VACUUM, 18 | 19 | /** A reflective boundary condition */ 20 | REFLECTIVE, 21 | 22 | /** A periodic boundary condition */ 23 | PERIODIC, 24 | 25 | /* Boundary between two domains (only in domain-decomposed geometry) */ 26 | INTERFACE, 27 | 28 | /** No boundary type (typically an interface between flat source regions) */ 29 | BOUNDARY_NONE 30 | }; 31 | 32 | #endif /* BOUNDARY_TYPE_H_ */ 33 | -------------------------------------------------------------------------------- /src/pairwise_sum.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file pairwise_sum.h 3 | * @brief Utility function for the accurate pairwise sum of a list of floating 4 | * point numbers. 5 | * @author William Boyd (wboyd@mit.edu) 6 | * @date June 13, 2013 7 | */ 8 | 9 | /** 10 | * @brief Performs a pairwise sum of an array of numbers. 11 | * @details This type of summation uses a divide-and-conquer algorithm which 12 | * is necessary to bound the error for summations of large sequences 13 | * of numbers. 14 | * @param vector an array of numbers 15 | * @param length the length of the array 16 | * @return the sum of all numbers in the array 17 | */ 18 | template 19 | inline double pairwise_sum(T* vector, L length) { 20 | 21 | double sum = 0; 22 | 23 | /* Base case: if length is less than SIMD vector length, perform summation */ 24 | if (length < VEC_LENGTH) { 25 | 26 | #pragma omp simd reduction(+:sum) 27 | for (L i=0; i < length; i++) 28 | sum += vector[i]; 29 | } 30 | 31 | else { 32 | L offset = length % 2; 33 | length = floor(length / 2); 34 | sum = pairwise_sum(&vector[0], length) + 35 | pairwise_sum(&vector[length], length+offset); 36 | } 37 | 38 | return sum; 39 | } 40 | -------------------------------------------------------------------------------- /src/segmentation_type.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file segmentation_type.h 3 | * @details The segmentationType enum. 4 | * @date January 27, 2016 5 | * @author Geoffrey Gunow, MIT, Course 22 (geogunow@mit.edu) 6 | */ 7 | 8 | #ifndef SEGMENTATION_TYPE_H_ 9 | #define SEGMENTATION_TYPE_H_ 10 | 11 | /** 12 | * @enum segmentationType 13 | * @brief The types of Track segmentation supported by OpenMOC. 14 | */ 15 | enum segmentationType { 16 | 17 | /** Explicit 2D segments (required for 2D simulations) */ 18 | EXPLICIT_2D, 19 | 20 | /** Explicit 3D segments */ 21 | EXPLICIT_3D, 22 | 23 | /** Axial on-the-fly 3D segment formation by 3D track */ 24 | OTF_TRACKS, 25 | 26 | /** Axial on-the-fly 3D segment formation by z-stack */ 27 | OTF_STACKS 28 | }; 29 | 30 | #endif /* SEGMENTATION_TYPE_H_ */ 31 | -------------------------------------------------------------------------------- /tests/.coveragerc: -------------------------------------------------------------------------------- 1 | # .coveragerc to control coverage.py 2 | [run] 3 | source=openmoc, tests 4 | 5 | [report] 6 | # Files to exclude from coverage testing 7 | omit = 8 | tests/openmoc/openmoc/openmoc.py 9 | openmoc/openmoc/openmoc.py 10 | openmoc/openmoc.py 11 | */openmc/* 12 | 13 | # Regexes for lines to exclude from consideration 14 | exclude_lines = 15 | # Have to re-enable the standard pragma 16 | pragma: no cover 17 | 18 | # Don't complain about missing debug-only code: 19 | def __repr__ 20 | if self\.debug 21 | 22 | # Don't complain if tests don't hit defensive assertion code: 23 | raise AssertionError 24 | raise NotImplementedError 25 | 26 | # Don't complain if non-runnable code isn't run: 27 | if 0: 28 | if __name__ == .__main__.: 29 | 30 | ignore_errors = True 31 | -------------------------------------------------------------------------------- /tests/cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This simple script ensures that all binary 4 | # output files have been deleted in all the 5 | # folders. This can occur if a previous error 6 | # occurred and the test suite was rerun without 7 | # deleting left over binary files. This will 8 | # cause an assertion error in some of the 9 | # tests. 10 | find . \( -name ".data" -o -name "*.h5" \) -exec rm -f {} \; 11 | -------------------------------------------------------------------------------- /tests/readme.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | OpenMOC Test Suite 3 | ================== 4 | 5 | The purpose of this test suite is to ensure that that all user input options 6 | can be used successfully without breaking the code. The test suite is based on 7 | regression or integrated testing where different types of input files are 8 | configured and the full OpenMOC code is executed. Results from simulations 9 | are compared with expected results. The test suite is comprised of many tests 10 | which reside in sub-directories in the tests directory. 11 | 12 | The test suite is designed to integrate with cmake using ctest_. To run the 13 | full test suite run: 14 | 15 | .. code-block:: sh 16 | 17 | python run_tests.py 18 | 19 | A subset of build configurations and/or tests can be run. To see how to use 20 | the script run: 21 | 22 | .. code-block:: sh 23 | 24 | python run_tests.py --help 25 | 26 | As an example, say we want to run all tests with that have "adjoint" and 27 | "pwr" in their name. Also, we wish to split the tests across 4 processors. 28 | We can run: 29 | 30 | .. code-block:: sh 31 | 32 | python run_tests.py -j 4 -R "adjoint|pwr" 33 | 34 | Note that standard regular expression syntax is used for selecting build 35 | configurations and tests. To print out a list of build configurations, we 36 | can run: 37 | 38 | .. code-block:: sh 39 | 40 | python run_tests.py -l 41 | 42 | Note that the test suite requires h5py, matplotlib (>=1.5) and Pandas (>=0.13). 43 | 44 | .. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html 45 | -------------------------------------------------------------------------------- /tests/test_1d_gradient/test_1d_gradient.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import HomInfMedInput 10 | import openmoc 11 | 12 | 13 | class OneDGradientTestHarness(TestHarness): 14 | """An eigenvalue calculation in a cube with vacuum BCs in x 15 | and reflective BCs in y with 2-group cross section data.""" 16 | 17 | def _create_geometry(self): 18 | """Put VACUUM boundary conditions on left and right boundaries.""" 19 | 20 | self.input_set.create_materials() 21 | self.input_set.create_geometry() 22 | 23 | # Get the root Cell 24 | cells = self.input_set.geometry.getAllCells() 25 | for cell_id in cells: 26 | cell = cells[cell_id] 27 | if cell.getName() == 'root cell': 28 | root_cell = cell 29 | 30 | # Apply VACUUM BCs on the min/max XPlane surfaces 31 | surfaces = root_cell.getSurfaces() 32 | for surface_id in surfaces: 33 | surface = surfaces[surface_id]._surface 34 | if len(surface.getName()) > 0: 35 | if surface.getName()[0] == 'x': 36 | surface.setBoundaryType(openmoc.VACUUM) 37 | 38 | def __init__(self): 39 | super(OneDGradientTestHarness, self).__init__() 40 | self.input_set = HomInfMedInput() 41 | 42 | 43 | if __name__ == '__main__': 44 | harness = OneDGradientTestHarness() 45 | harness.main() 46 | -------------------------------------------------------------------------------- /tests/test_2d_gradient/test_2d_gradient.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import HomInfMedInput 10 | import openmoc 11 | 12 | 13 | class TwoDGradientTestHarness(TestHarness): 14 | """An eigenvalue calculation in a cube with vacuum BCs along xmin and 15 | ymax and reflective BCs elsewhere with 2-group cross section data.""" 16 | 17 | def _create_geometry(self): 18 | """Put VACUUM boundary conditions on left and right boundaries.""" 19 | 20 | self.input_set.create_materials() 21 | self.input_set.create_geometry() 22 | 23 | # Get the root Cell 24 | cells = self.input_set.geometry.getAllCells() 25 | for cell_id in cells: 26 | cell = cells[cell_id] 27 | if cell.getName() == 'root cell': 28 | root_cell = cell 29 | 30 | # Apply VACUUM BCs on the xmin and ymax surfaces 31 | surfaces = root_cell.getSurfaces() 32 | for surface_id in surfaces: 33 | surface = surfaces[surface_id]._surface 34 | if surface.getName() == 'xmin': 35 | surface.setBoundaryType(openmoc.VACUUM) 36 | if surface.getName() == 'ymax': 37 | surface.setBoundaryType(openmoc.VACUUM) 38 | 39 | def __init__(self): 40 | super(TwoDGradientTestHarness, self).__init__() 41 | self.input_set = HomInfMedInput() 42 | 43 | 44 | if __name__ == '__main__': 45 | harness = TwoDGradientTestHarness() 46 | harness.main() 47 | -------------------------------------------------------------------------------- /tests/test_2d_gradient_linear_source/test_2d_gradient_linear_source.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import HomInfMedInput 10 | import openmoc 11 | 12 | 13 | class TwoDGradientTestHarness(TestHarness): 14 | """An eigenvalue calculation in a cube with vacuum BCs along xmin and 15 | ymax and reflective BCs elsewhere with 2-group cross section data.""" 16 | 17 | def _create_geometry(self): 18 | """Put VACUUM boundary conditions on left and right boundaries.""" 19 | 20 | self.input_set.create_materials() 21 | self.input_set.create_geometry() 22 | 23 | # Get the root Cell 24 | cells = self.input_set.geometry.getAllCells() 25 | for cell_id in cells: 26 | cell = cells[cell_id] 27 | if cell.getName() == 'root cell': 28 | root_cell = cell 29 | 30 | # Apply VACUUM BCs on the xmin and ymax surfaces 31 | surfaces = root_cell.getSurfaces() 32 | for surface_id in surfaces: 33 | surface = surfaces[surface_id]._surface 34 | if surface.getName() == 'xmin': 35 | surface.setBoundaryType(openmoc.VACUUM) 36 | if surface.getName() == 'ymax': 37 | surface.setBoundaryType(openmoc.VACUUM) 38 | 39 | def _create_solver(self): 40 | """Instantiate a CPULSSolver.""" 41 | self.solver = openmoc.CPULSSolver(self.track_generator) 42 | self.solver.setNumThreads(self.num_threads) 43 | self.solver.setConvergenceThreshold(self.tolerance) 44 | 45 | def __init__(self): 46 | super(TwoDGradientTestHarness, self).__init__() 47 | self.input_set = HomInfMedInput() 48 | 49 | 50 | if __name__ == '__main__': 51 | harness = TwoDGradientTestHarness() 52 | harness.main() 53 | -------------------------------------------------------------------------------- /tests/test_OTF_transport/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 20 2 | keff: 5.84272E-02 3 | -------------------------------------------------------------------------------- /tests/test_adjoint_hom_inf_medium/test_adjoint_hom_inf_medium.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import HomInfMedInput 10 | import openmoc 11 | 12 | 13 | class HomInfMedAdjointTestHarness(TestHarness): 14 | """An adjoint eigenvalue calculation in a reflected cube with 2-group 15 | cross section data.""" 16 | 17 | def __init__(self): 18 | super(HomInfMedAdjointTestHarness, self).__init__() 19 | self.input_set = HomInfMedInput() 20 | self.calculation_mode = openmoc.ADJOINT 21 | 22 | 23 | if __name__ == '__main__': 24 | harness = HomInfMedAdjointTestHarness() 25 | harness.main() 26 | -------------------------------------------------------------------------------- /tests/test_adjoint_pin_cell/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 331 2 | keff: 1.04641E+00 3 | fluxes: 4 | 6.414370E-01 5 | 6.315689E-01 6 | 6.337217E-01 7 | 6.403088E-01 8 | 6.573529E-01 9 | 6.611608E-01 10 | 6.589094E-01 11 | 6.509050E-01 12 | 6.303746E-01 13 | 6.259246E-01 14 | 6.068260E-01 15 | 6.649597E-01 16 | 7.140609E-01 17 | 7.868238E-01 18 | -------------------------------------------------------------------------------- /tests/test_adjoint_pin_cell/test_adjoint_pin_cell.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import PinCellInput 10 | import openmoc 11 | 12 | 13 | class PinCellAdjointTestHarness(TestHarness): 14 | """An adjoint eigenvalue calculation in a pin cell with 7-group C5G7 15 | cross section data.""" 16 | 17 | def __init__(self): 18 | super(PinCellAdjointTestHarness, self).__init__() 19 | self.input_set = PinCellInput() 20 | self.calculation_mode = openmoc.ADJOINT 21 | 22 | 23 | if __name__ == '__main__': 24 | harness = PinCellAdjointTestHarness() 25 | harness.main() 26 | -------------------------------------------------------------------------------- /tests/test_adjoint_simple_lattice/results_true.dat: -------------------------------------------------------------------------------- 1 | 17f7325eac1023427e7907964c2c41db16194238a6958be68af8cc246cb57b895ec756f557c607b631713af72045f435ef7df88bb07dfffd0c27b8ce055f0d4d -------------------------------------------------------------------------------- /tests/test_adjoint_simple_lattice/test_adjoint_simple_lattice.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import SimpleLatticeInput 10 | import openmoc 11 | 12 | 13 | class SimpleLatticeAdjointTestHarness(TestHarness): 14 | """An adjoint eigenvalue calculation for a 4x4 lattice with 7-group C5G7 15 | cross section data.""" 16 | 17 | def __init__(self): 18 | super(SimpleLatticeAdjointTestHarness, self).__init__() 19 | self.input_set = SimpleLatticeInput() 20 | self.calculation_mode = openmoc.ADJOINT 21 | 22 | # Change spacing to avoid having rays start on lattice planes 23 | # Those rays are problematic because they cross through fuel pins 24 | # parallelly to sector planes. 25 | self.spacing = 0.12 26 | 27 | def _get_results(self, num_iters=True, keff=True, fluxes=True, 28 | num_fsrs=False, num_tracks=False, num_segments=False, 29 | hash_output=True): 30 | """Digest info in the solver and return hash as a string.""" 31 | return super(SimpleLatticeAdjointTestHarness, self)._get_results( 32 | num_iters=num_iters, keff=keff, fluxes=fluxes, 33 | num_fsrs=num_fsrs, num_tracks=num_tracks, 34 | num_segments=num_segments, hash_output=hash_output) 35 | 36 | 37 | if __name__ == '__main__': 38 | harness = SimpleLatticeAdjointTestHarness() 39 | harness.main() 40 | -------------------------------------------------------------------------------- /tests/test_axial_segmentation/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 30 2 | keff: 5.06621E-01 3 | -------------------------------------------------------------------------------- /tests/test_calculate_boundaries/results_true.dat: -------------------------------------------------------------------------------- 1 | [ NORMAL ] MinX: -50.000000 2 | [ NORMAL ] MinXBoundaryType: PERIODIC 3 | [SEPARATOR] ******************************************************************* 4 | [ NORMAL ] MinY: -50.000000 5 | [ NORMAL ] MinYBoundaryType: PERIODIC 6 | [SEPARATOR] ******************************************************************* 7 | [ NORMAL ] MinZ: -50.000000 8 | [ NORMAL ] MinZBoundaryType: PERIODIC 9 | [SEPARATOR] ******************************************************************* 10 | [ NORMAL ] MaxX: 50.000000 11 | [ NORMAL ] MaxXBoundaryType: PERIODIC 12 | [SEPARATOR] ******************************************************************* 13 | [ NORMAL ] MaxY: 50.000000 14 | [ NORMAL ] MaxYBoundaryType: PERIODIC 15 | [SEPARATOR] ******************************************************************* 16 | [ NORMAL ] MaxZ: 50.000000 17 | [ NORMAL ] MaxZBoundaryType: PERIODIC 18 | [SEPARATOR] ******************************************************************* 19 | [ NORMAL ] MinX: 10.000000 20 | [ NORMAL ] MinXBoundaryType: 0 21 | [ NORMAL ] MinY: 30.000000 22 | [ NORMAL ] MinYBoundaryType: 0 23 | [ NORMAL ] MinZ: 50.000000 24 | [ NORMAL ] MinZBoundaryType: 2 25 | [ NORMAL ] MaxX: 20.000000 26 | [ NORMAL ] MaxXBoundaryType: 1 27 | [ NORMAL ] MaxY: 40.000000 28 | [ NORMAL ] MaxYBoundaryType: 1 29 | [ NORMAL ] MaxZ: 60.000000 30 | [ NORMAL ] MaxZBoundaryType: 1 31 | -------------------------------------------------------------------------------- /tests/test_cmfd_axial_interpolation_average/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 15 2 | keff: 1.26899E+00 3 | # FSRs: 2137 4 | -------------------------------------------------------------------------------- /tests/test_cmfd_axial_interpolation_centroid/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 15 2 | keff: 1.26899E+00 3 | # FSRs: 2137 4 | -------------------------------------------------------------------------------- /tests/test_cmfd_check_balance/results_true.dat: -------------------------------------------------------------------------------- 1 | 2015cffe1c17a1a9e0ea8a2ad84e3642d58440280175c8fe6e32dc928855678ed11b79c40e058227237cfa869d05e0a7c5c1e32202fd6f1b2d7fad830b22bd8a -------------------------------------------------------------------------------- /tests/test_cmfd_linear_source/results_true.dat: -------------------------------------------------------------------------------- 1 | cf65e2859f9e84313c58c181447643dd69e78cb3179f0d47da4231f85f5066f51601752378f68fa0650f2aa6d732aea79495a22805ee433572e53b117f607b7f -------------------------------------------------------------------------------- /tests/test_cmfd_periodic_boundaries/results_true.dat: -------------------------------------------------------------------------------- 1 | b810e6b9e9b2c9bb841536afbdd0ef9c84d05583dbcb4196cf0209bd8e92e14843618bdfde49d6cfe62f425c7c5d37f69b8e90d1698b261034c4635fb8759ec6 -------------------------------------------------------------------------------- /tests/test_cmfd_print_ratios/results_true.dat: -------------------------------------------------------------------------------- 1 | keff: 1.17982E+00 2 | -------------------------------------------------------------------------------- /tests/test_cmfd_pwr_assembly/results_true.dat: -------------------------------------------------------------------------------- 1 | d7afb20a76105ba1248d1e7a2b7883faf51956e155d4cf321f364c91ccc7826e5786a1b2fdc83abac848992051fc275c90d22b71ccd0059d8944ee0e422df25c -------------------------------------------------------------------------------- /tests/test_cmfd_pwr_assembly/test_cmfd_pwr_assembly.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PwrAssemblyInput 9 | import openmoc 10 | 11 | 12 | class CmfdPwrAssemblyTestHarness(TestHarness): 13 | """An eigenvalue calculation for a 17x17 lattice with 7-group C5G7 14 | cross section data.""" 15 | 16 | def __init__(self): 17 | super(CmfdPwrAssemblyTestHarness, self).__init__() 18 | self.input_set = PwrAssemblyInput() 19 | self.spacing = 0.12 20 | 21 | def _create_geometry(self): 22 | """Initialize CMFD and add it to the Geometry.""" 23 | 24 | super(CmfdPwrAssemblyTestHarness, self)._create_geometry() 25 | 26 | # Initialize CMFD 27 | cmfd = openmoc.Cmfd() 28 | cmfd.setCMFDRelaxationFactor(1.0) 29 | cmfd.setSORRelaxationFactor(1.5) 30 | cmfd.setLatticeStructure(17,17) 31 | cmfd.setGroupStructure([[1,2,3], [4,5,6,7]]) 32 | cmfd.setKNearest(3) 33 | 34 | # Add CMFD to the Geometry 35 | self.input_set.geometry.setCmfd(cmfd) 36 | 37 | def _get_results(self, num_iters=True, keff=True, fluxes=True, 38 | num_fsrs=False, num_tracks=False, num_segments=False, 39 | hash_output=True): 40 | """Digest info in the solver and return hash as a string.""" 41 | return super(CmfdPwrAssemblyTestHarness, self)._get_results( 42 | num_iters=num_iters, keff=keff, fluxes=fluxes, 43 | num_fsrs=num_fsrs, num_tracks=num_tracks, 44 | num_segments=num_segments, hash_output=hash_output) 45 | 46 | 47 | if __name__ == '__main__': 48 | harness = CmfdPwrAssemblyTestHarness() 49 | harness.main() 50 | -------------------------------------------------------------------------------- /tests/test_cmfd_restart/results_true.dat: -------------------------------------------------------------------------------- 1 | b6007f87da1addd297fe2ed191432e84cd0c2488cc7c76f5b40d0e1af20d457698b789173a105d907708665347e6a9f5474c55d771b8efd0fe82ea50162f0954 -------------------------------------------------------------------------------- /tests/test_cmfd_vacuum_boundary/results_true.dat: -------------------------------------------------------------------------------- 1 | 30732f2a4b46fdd545538dc11eba523e50c828c12e1ce7bf71c423911fd542f6b0a69e53576e034de49a201b8be4cb0dc0dc79044071f019b4cd2b5bb738cc36 -------------------------------------------------------------------------------- /tests/test_forward_3D_lattice/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 116 2 | keff: 5.02744E-01 3 | -------------------------------------------------------------------------------- /tests/test_forward_3D_lattice_70g/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 258 2 | keff: 8.84474E-01 3 | -------------------------------------------------------------------------------- /tests/test_forward_3D_lattice_CMFD/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 24 2 | keff: 8.37390E-01 3 | # FSRs: 2048 4 | -------------------------------------------------------------------------------- /tests/test_forward_3D_lattice_linear/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 156 2 | keff: 6.89615E-01 3 | # FSRs: 480 4 | -------------------------------------------------------------------------------- /tests/test_forward_3D_lattice_linear_70g/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 186 2 | keff: 8.71566E-01 3 | -------------------------------------------------------------------------------- /tests/test_forward_3D_lattice_symmetry/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 44 2 | keff: 4.03117E-01 3 | # FSRs: 256 4 | -------------------------------------------------------------------------------- /tests/test_forward_hom_inf_medium/test_forward_hom_inf_medium.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import HomInfMedInput 9 | 10 | 11 | class HomInfMedTestHarness(TestHarness): 12 | """An eigenvalue calculation in a homogeneous infinite medium with 2-group 13 | cross section data.""" 14 | 15 | def __init__(self): 16 | super(HomInfMedTestHarness, self).__init__() 17 | self.input_set = HomInfMedInput() 18 | 19 | 20 | if __name__ == '__main__': 21 | harness = HomInfMedTestHarness() 22 | harness.main() 23 | -------------------------------------------------------------------------------- /tests/test_forward_pin_cell/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 261 2 | keff: 1.04666E+00 3 | fluxes: 4 | 6.428760E-01 5 | 1.099273E+00 6 | 5.710249E-01 7 | 2.507108E-01 8 | 1.962766E-01 9 | 4.993489E-01 10 | 1.287533E+00 11 | 1.104038E+00 12 | 1.411933E+00 13 | 5.559559E-01 14 | 2.268887E-01 15 | 1.900581E-01 16 | 4.444841E-01 17 | 9.440460E-01 18 | -------------------------------------------------------------------------------- /tests/test_forward_pin_cell/test_forward_pin_cell.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PinCellInput 9 | 10 | 11 | class PinCellTestHarness(TestHarness): 12 | """An eigenvalue calculation in a pin cell with 7-group C5G7 data.""" 13 | 14 | def __init__(self): 15 | super(PinCellTestHarness, self).__init__() 16 | self.input_set = PinCellInput() 17 | 18 | 19 | if __name__ == '__main__': 20 | harness = PinCellTestHarness() 21 | harness.main() 22 | -------------------------------------------------------------------------------- /tests/test_forward_pin_cell_70g/test_forward_pin_cell_70g.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | import numpy as np 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TestHarness 9 | from input_set import PinCellInput 10 | import openmoc 11 | 12 | class PinCellTestHarness(TestHarness): 13 | """An eigenvalue calculation in a pin cell with 70-group cross sections.""" 14 | 15 | def __init__(self): 16 | super(PinCellTestHarness, self).__init__() 17 | self.input_set = PinCellInput() 18 | 19 | def _run_openmoc(self): 20 | # Extract UO2 material from input set, set 70-g cross sections 21 | material = self.input_set.materials['UO2'] 22 | material.setNumEnergyGroups(70) 23 | material.setNuSigmaF(np.linspace(0, 1, 70) * 7) 24 | material.setSigmaS(np.linspace(0, 1, 4900) / 1000) 25 | material.setChi(1/70. * np.ones(70)) 26 | material.setSigmaT(np.linspace(2, 3, 70)) 27 | 28 | # Extract water material from input set, set 70-g cross sections 29 | material = self.input_set.materials['Water'] 30 | material.setNumEnergyGroups(70) 31 | material.setNuSigmaF(np.linspace(0, 0, 70)) 32 | material.setSigmaS(np.linspace(1, 2, 4900) / 1000) 33 | material.setChi(0/70. * np.ones(70)) 34 | material.setSigmaT(np.linspace(3, 4, 70)) 35 | 36 | self.solver.computeEigenvalue(res_type=openmoc.SCALAR_FLUX) 37 | 38 | if __name__ == '__main__': 39 | harness = PinCellTestHarness() 40 | harness.main() 41 | -------------------------------------------------------------------------------- /tests/test_forward_simple_lattice/results_true.dat: -------------------------------------------------------------------------------- 1 | 1870a1362b1735ef57e19dd8e3ca3fc6b8e1bd2581221c9a8e0373798665bf32e4e7ba2941d354e4a0eed796885b15f6f3747f06c76d8dfa9e9e35cf03a730ff -------------------------------------------------------------------------------- /tests/test_forward_simple_lattice/test_forward_simple_lattice.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import SimpleLatticeInput 9 | 10 | 11 | class SimpleLatticeTestHarness(TestHarness): 12 | """An eigenvalue calculation for a 4x4 lattice with 7-group C5G7 13 | cross section data.""" 14 | 15 | def __init__(self): 16 | super(SimpleLatticeTestHarness, self).__init__() 17 | self.input_set = SimpleLatticeInput() 18 | 19 | # Change spacing to avoid having rays start on lattice planes 20 | # Those rays are problematic because they cross through fuel pins 21 | # parallelly to sector planes. 22 | self.spacing = 0.12 23 | 24 | def _get_results(self, num_iters=True, keff=True, fluxes=True, 25 | num_fsrs=False, num_tracks=False, num_segments=False, 26 | hash_output=True): 27 | """Digest info in the solver and return hash as a string.""" 28 | return super(SimpleLatticeTestHarness, self)._get_results( 29 | num_iters=num_iters, keff=keff, fluxes=fluxes, 30 | num_fsrs=num_fsrs, num_tracks=num_tracks, 31 | num_segments=num_segments, hash_output=hash_output) 32 | 33 | 34 | if __name__ == '__main__': 35 | harness = SimpleLatticeTestHarness() 36 | harness.main() 37 | -------------------------------------------------------------------------------- /tests/test_geometry_dump/results_true.dat: -------------------------------------------------------------------------------- 1 | dummy -------------------------------------------------------------------------------- /tests/test_geometry_load_non_uniform_lattice/non-uniform-lattice.geo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_geometry_load_non_uniform_lattice/non-uniform-lattice.geo -------------------------------------------------------------------------------- /tests/test_geometry_load_non_uniform_lattice/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 27 2 | keff: 1.27201E+00 3 | # FSRs: 216 4 | # tracks: 3032 5 | # segments: 25608 6 | -------------------------------------------------------------------------------- /tests/test_geometry_print/geometry_true.txt: -------------------------------------------------------------------------------- 1 | 2 | Cells: 3 | Cell ID = 1000000, name = root cell, # rings = 0, # sectors = 0, type = FILL, , fill id = 1000001, # surfaces = 2, Surfaces: 4 | halfspace = +1, Surface ID = 1000000, name = zmin, type = ZPLANE , A = 0, B = 0, C = 1, D = 2, z = -2 5 | halfspace = -1, Surface ID = 1000001, name = zmax, type = ZPLANE , A = 0, B = 0, C = 1, D = -2, z = 2 6 | Cell ID = 1000001, name = intersection cell, # rings = 0, # sectors = 0, type = MATERIAL, fill id = 49930, (rotation = 0, 0, 90), # surfaces = 3, Surfaces: 7 | halfspace = +1, Surface ID = 1000002, name = xmin, type = XPLANE , A = 1, B = 0, C = 0, D = 2, x = -2 8 | halfspace = +1, Surface ID = 1000003, name = ymin, type = YPLANE , A = 0, B = 1, C = 0, D = 2, y = -2 9 | halfspace = -1, Surface ID = 1000004, name = cylinder, type = ZCYLINDER , A = 1, B = 1, C = -0, D = -0, E = -6.25, x0 = 0, y0 = 0, radius = 2.5 10 | Cell ID = 1000002, name = union cell, # rings = 0, # sectors = 0, type = FILL, , fill id = 1000002, (translation = 0.25, 0.25, 0.1), # surfaces = 2, Surfaces: 11 | halfspace = -1, Surface ID = 1000005, name = zmax, type = ZPLANE , A = 0, B = 0, C = 1, D = -4, z = 4 12 | halfspace = -1, Surface ID = 1000006, name = general plane, type = PLANE , A = 0, B = 1, C = 4, D = 3 13 | Cell ID = 1000003, name = union cell 2, # rings = 0, # sectors = 0, type = UNFILLED, # surfaces = 1, Surfaces: 14 | halfspace = +1, Surface ID = 1000002, name = xmin, type = XPLANE , A = 1, B = 0, C = 0, D = 2, x = -2 15 | Cell ID = 1000004, name = unbound cell, # rings = 0, # sectors = 0, type = UNFILLED, # surfaces = 0, Surfaces: 16 | 17 | Universes: 18 | Universe ID = 1000000, name = root universe, type = SIMPLE, # cells = 1, cell IDs = 1000000, 19 | Universe ID = 1000001, name = universe 1, type = SIMPLE, # cells = 3, cell IDs = 1000001, 1000002, 1000004, 20 | Universe ID = 1000002, name = universe 2 in c2, type = SIMPLE, # cells = 1, cell IDs = 1000003, -------------------------------------------------------------------------------- /tests/test_geometry_print/results_true.dat: -------------------------------------------------------------------------------- 1 | dummy -------------------------------------------------------------------------------- /tests/test_get_num_cells/results_true.dat: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /tests/test_get_num_cells/test_num_cells.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PinCellInput 9 | 10 | 11 | class GetNumCellsTestHarness(TestHarness): 12 | """A unit test for the GetNumCells routine.""" 13 | 14 | def __init__(self): 15 | super(GetNumCellsTestHarness, self).__init__() 16 | self.input_set = PinCellInput() 17 | 18 | def _get_results(self, num_iters=True, keff=True, fluxes=False, 19 | num_fsrs=False, num_tracks=False, num_segments=False, 20 | hash_output=False): 21 | result_str = str(self.input_set.geometry.getNumCells()) 22 | return result_str 23 | 24 | def _create_trackgenerator(self): 25 | pass 26 | 27 | def _generate_tracks(self): 28 | pass 29 | 30 | def _run_openmoc(self): 31 | pass 32 | 33 | 34 | if __name__ == '__main__': 35 | harness = GetNumCellsTestHarness() 36 | harness.main() 37 | -------------------------------------------------------------------------------- /tests/test_krylov_adjoint/results_true.dat: -------------------------------------------------------------------------------- 1 | [(0.0212367123+0j)] -------------------------------------------------------------------------------- /tests/test_krylov_forward/results_true.dat: -------------------------------------------------------------------------------- 1 | [(0.0212279426+0j), (5.9462e-06+0j)] -------------------------------------------------------------------------------- /tests/test_logger/results_true.dat: -------------------------------------------------------------------------------- 1 | [ NORMAL ] This is a normal message 2 | [SEPARATOR] ******************************************************************* 3 | [ HEADER ] ******************* This is a header message ******************** 4 | [ TITLE ] ******************************************************************* 5 | [ TITLE ] This is a title message 6 | [ TITLE ] ******************************************************************* 7 | [ WARNING ] This is a warning message 8 | [ CRITICAL] This is a critical message 9 | [ RESULT ] This is a result message 10 | [ NORMAL ] This is a normal message 11 | [SEPARATOR] ******************************************************************* 12 | [ HEADER ] ******************* This is a header message ******************** 13 | [ TITLE ] ******************************************************************* 14 | [ TITLE ] This is a title message 15 | [ TITLE ] ******************************************************************* 16 | [ WARNING ] This is a warning message 17 | [ CRITICAL] This is a critical message 18 | [ RESULT ] This is a result message: 5 19 | -------------------------------------------------------------------------------- /tests/test_mesh_from_lattice/results_true.dat: -------------------------------------------------------------------------------- 1 | Mesh 1: 2 | [3, 2, 1] 3 | [ 2. 2. inf] 4 | [ -3. -2. -inf] 5 | [ 3. 2. inf] 6 | Mesh 2: 7 | [6, 4, 2] 8 | [ 2. 2. inf] 9 | [ -3. -2. -inf] 10 | [ 3. 2. inf] 11 | -------------------------------------------------------------------------------- /tests/test_mesh_reaction_rate_tally/results_true.dat: -------------------------------------------------------------------------------- 1 | Fission Rate Mesh Tally 2 | 1.700257E+01 3 | 1.686555E+01 4 | 1.666160E+01 5 | 1.652459E+01 6 | 5.474809E+00 7 | 1.071834E+01 8 | 5.339276E+00 9 | 1.044931E+01 10 | 1.913624E+01 11 | 1.885791E+01 12 | 1.851315E+01 13 | 1.825023E+01 14 | 6.152375E+00 15 | 1.198907E+01 16 | 5.919148E+00 17 | 1.153015E+01 18 | Flux Rate Mesh Tally 19 | 8.726223E+02 20 | 8.634812E+02 21 | 8.686418E+02 22 | 8.595111E+02 23 | 8.848778E+02 24 | 8.917966E+02 25 | 8.731983E+02 26 | 8.802993E+02 27 | 8.882733E+02 28 | 8.712914E+02 29 | 8.912080E+02 30 | 8.744287E+02 31 | 9.026128E+02 32 | 9.014825E+02 33 | 8.974726E+02 34 | 8.965494E+02 35 | Total Rate Mesh Tally 36 | 5.257791E+02 37 | 5.211360E+02 38 | 5.199985E+02 39 | 5.153769E+02 40 | 7.092685E+02 41 | 6.345329E+02 42 | 6.956167E+02 43 | 6.226894E+02 44 | 5.609354E+02 45 | 5.520012E+02 46 | 5.528987E+02 47 | 5.441993E+02 48 | 7.668876E+02 49 | 6.782863E+02 50 | 7.473445E+02 51 | 6.620433E+02 52 | Nu-Fission Rate Mesh Tally 53 | 4.159060E+01 54 | 4.124817E+01 55 | 4.076170E+01 56 | 4.041924E+01 57 | 1.338649E+01 58 | 2.622115E+01 59 | 1.305413E+01 60 | 2.556120E+01 61 | 4.678116E+01 62 | 4.608526E+01 63 | 4.527465E+01 64 | 4.461641E+01 65 | 1.503502E+01 66 | 2.930684E+01 67 | 1.446764E+01 68 | 2.819036E+01 69 | Scatter Rate Mesh Tally 70 | 4.966738E+02 71 | 4.922394E+02 72 | 4.914170E+02 73 | 4.870042E+02 74 | 6.949362E+02 75 | 6.135040E+02 76 | 6.816273E+02 77 | 6.021479E+02 78 | 5.285728E+02 79 | 5.200567E+02 80 | 5.214879E+02 81 | 5.131836E+02 82 | 7.508463E+02 83 | 6.549594E+02 84 | 7.318907E+02 85 | 6.395445E+02 86 | -------------------------------------------------------------------------------- /tests/test_mesh_tally_process/results_true.dat: -------------------------------------------------------------------------------- 1 | Fission Rate Mesh Tally 2 | 1.700257E+01 3 | 1.686555E+01 4 | 1.666160E+01 5 | 1.652459E+01 6 | 5.474809E+00 7 | 1.071834E+01 8 | 5.339276E+00 9 | 1.044931E+01 10 | 1.913624E+01 11 | 1.885791E+01 12 | 1.851315E+01 13 | 1.825023E+01 14 | 6.152375E+00 15 | 1.198907E+01 16 | 5.919148E+00 17 | 1.153015E+01 18 | Flux Rate Mesh Tally 19 | 8.726223E+02 20 | 8.634812E+02 21 | 8.686418E+02 22 | 8.595111E+02 23 | 8.848778E+02 24 | 8.917966E+02 25 | 8.731983E+02 26 | 8.802993E+02 27 | 8.882733E+02 28 | 8.712914E+02 29 | 8.912080E+02 30 | 8.744287E+02 31 | 9.026128E+02 32 | 9.014825E+02 33 | 8.974726E+02 34 | 8.965494E+02 35 | Total Rate Mesh Tally 36 | 5.257791E+02 37 | 5.211360E+02 38 | 5.199985E+02 39 | 5.153769E+02 40 | 7.092685E+02 41 | 6.345329E+02 42 | 6.956167E+02 43 | 6.226894E+02 44 | 5.609354E+02 45 | 5.520012E+02 46 | 5.528987E+02 47 | 5.441993E+02 48 | 7.668876E+02 49 | 6.782863E+02 50 | 7.473445E+02 51 | 6.620433E+02 52 | Nu-Fission Rate Mesh Tally 53 | 4.159060E+01 54 | 4.124817E+01 55 | 4.076170E+01 56 | 4.041924E+01 57 | 1.338649E+01 58 | 2.622115E+01 59 | 1.305413E+01 60 | 2.556120E+01 61 | 4.678116E+01 62 | 4.608526E+01 63 | 4.527465E+01 64 | 4.461641E+01 65 | 1.503502E+01 66 | 2.930684E+01 67 | 1.446764E+01 68 | 2.819036E+01 69 | Scatter Rate Mesh Tally 70 | 4.966738E+02 71 | 4.922394E+02 72 | 4.914170E+02 73 | 4.870042E+02 74 | 6.949362E+02 75 | 6.135040E+02 76 | 6.816273E+02 77 | 6.021479E+02 78 | 5.285728E+02 79 | 5.200567E+02 80 | 5.214879E+02 81 | 5.131836E+02 82 | 7.508463E+02 83 | 6.549594E+02 84 | 7.318907E+02 85 | 6.395445E+02 86 | -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_angular_legendre.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_angular_legendre.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_by_nuclide.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_by_nuclide.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_consistent.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_consistent.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_consistent_nuscatter.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_consistent_nuscatter.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_isotropic.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_isotropic.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_materials.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_materials.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/mgxs_transport_corrected.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_mgxs_openmc/mgxs_transport_corrected.pkl -------------------------------------------------------------------------------- /tests/test_mgxs_openmc/results_true.dat: -------------------------------------------------------------------------------- 1 | File: mgxs_isotropic keff: 6.15174E-01 2 | File: mgxs_transport_corrected keff: 5.23838E-01 3 | File: mgxs_consistent keff: 6.14988E-01 4 | File: mgxs_consistent_nuscatter keff: 6.14997E-01 5 | File: mgxs_materials keff: 6.15174E-01 6 | File: mgxs_angular_legendre keff: 6.15174E-01 7 | -------------------------------------------------------------------------------- /tests/test_modular_domains/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 28 2 | keff: 8.58048E-01 3 | # FSRs: 7392 4 | # tracks: 13344 5 | # segments: 270592 6 | -------------------------------------------------------------------------------- /tests/test_mpi_2D/2D_lattice.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | from mpi4py import MPI 6 | 7 | sys.path.insert(0, os.pardir) 8 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 9 | from testing_harness import TestHarness 10 | from input_set import SimpleLatticeInput 11 | import openmoc 12 | 13 | 14 | 15 | class PwrAssemblyTestHarness(TestHarness): 16 | """An eigenvalue calculation for a 4x4 lattice with 7-group C5G7 17 | cross section data.""" 18 | 19 | def __init__(self): 20 | super(PwrAssemblyTestHarness, self).__init__() 21 | self.input_set = SimpleLatticeInput(num_dimensions=2) 22 | self.spacing = 0.12 23 | self.max_iters = 50 24 | 25 | def _create_geometry(self): 26 | """Initialize CMFD and add it to the Geometry.""" 27 | 28 | super(PwrAssemblyTestHarness, self)._create_geometry() 29 | self.input_set.geometry.setDomainDecomposition(3, 2, 1, MPI.COMM_WORLD) 30 | 31 | def _get_results(self, num_iters=True, keff=True, fluxes=True, 32 | num_fsrs=False, num_tracks=False, num_segments=False, 33 | hash_output=False): 34 | """Digest info in the solver and return hash as a string.""" 35 | return super(PwrAssemblyTestHarness, self)._get_results( 36 | num_iters=num_iters, keff=keff, fluxes=fluxes, 37 | num_fsrs=num_fsrs, num_tracks=num_tracks, 38 | num_segments=num_segments, hash_output=hash_output) 39 | 40 | 41 | if __name__ == '__main__': 42 | harness = PwrAssemblyTestHarness() 43 | harness.main() 44 | -------------------------------------------------------------------------------- /tests/test_mpi_2D/test_mpi_2D.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | # This test should only be collected if OpenMOC was installed with an MPI 4 | # wrapped compiler 5 | output = subprocess.call(["mpirun", "-n", "6", "--oversubscribe", "python", "2D_lattice.py"]) 6 | 7 | if output != 0: 8 | raise RuntimeError("Test failed") 9 | -------------------------------------------------------------------------------- /tests/test_mpi_2D_CMFD/2D_lattice.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | from mpi4py import MPI 6 | 7 | sys.path.insert(0, os.pardir) 8 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 9 | from testing_harness import TestHarness 10 | from input_set import SimpleLatticeInput 11 | import openmoc 12 | 13 | 14 | 15 | class PwrAssemblyTestHarness(TestHarness): 16 | """An eigenvalue calculation for a 4x4 lattice with 7-group C5G7 17 | cross section data.""" 18 | 19 | def __init__(self): 20 | super(PwrAssemblyTestHarness, self).__init__() 21 | self.input_set = SimpleLatticeInput(num_dimensions=2) 22 | self.spacing = 0.12 23 | self.max_iters = 1 24 | 25 | def _create_geometry(self): 26 | """Initialize CMFD and add it to the Geometry.""" 27 | 28 | super(PwrAssemblyTestHarness, self)._create_geometry() 29 | self.input_set.geometry.setDomainDecomposition(3, 2, 1, MPI.COMM_WORLD) 30 | 31 | # Initialize CMFD 32 | cmfd = openmoc.Cmfd() 33 | cmfd.setLatticeStructure(6,4) 34 | cmfd.setGroupStructure([[1,2,3], [4,5,6,7]]) 35 | 36 | # Add CMFD to the Geometry 37 | self.input_set.geometry.setCmfd(cmfd) 38 | 39 | def _get_results(self, num_iters=True, keff=True, fluxes=True, 40 | num_fsrs=False, num_tracks=False, num_segments=False, 41 | hash_output=False): 42 | """Digest info in the solver and return hash as a string.""" 43 | return super(PwrAssemblyTestHarness, self)._get_results( 44 | num_iters=num_iters, keff=keff, fluxes=fluxes, 45 | num_fsrs=num_fsrs, num_tracks=num_tracks, 46 | num_segments=num_segments, hash_output=hash_output) 47 | 48 | 49 | if __name__ == '__main__': 50 | harness = PwrAssemblyTestHarness() 51 | harness.main() 52 | -------------------------------------------------------------------------------- /tests/test_mpi_2D_CMFD/test_mpi_2D_CMFD.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | # This test should only be collected if OpenMOC was installed with an MPI 4 | # wrapped compiler 5 | output = subprocess.call(["mpirun", "-n", "6", "--oversubscribe", "python", "2D_lattice.py"]) 6 | 7 | if output != 0: 8 | raise RuntimeError("Test failed") 9 | -------------------------------------------------------------------------------- /tests/test_mpi_3D/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 50 2 | keff: 5.52713E-01 3 | # FSRs: 120 4 | # tracks: 784 5 | # segments: 5712 6 | -------------------------------------------------------------------------------- /tests/test_mpi_3D/test_mpi_3D.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | # This test should only be collected if OpenMOC was installed with an MPI 4 | # wrapped compiler 5 | output = subprocess.call(["mpirun", "-n", "12", "--oversubscribe", "python", "3D_lattice.py"]) 6 | 7 | if output != 0: 8 | raise RuntimeError("Test failed") 9 | -------------------------------------------------------------------------------- /tests/test_mpi_3D_CMFD/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 1 2 | keff: 8.69593E-01 3 | -------------------------------------------------------------------------------- /tests/test_mpi_3D_CMFD/test_mpi_3D_CMFD.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | # This test should only be collected if OpenMOC was installed with an MPI 4 | # wrapped compiler 5 | output = subprocess.call(["mpirun", "-n", "12", "--oversubscribe", "python", "3D_lattice.py"]) 6 | 7 | if output != 0: 8 | raise RuntimeError("Test failed") 9 | -------------------------------------------------------------------------------- /tests/test_mpi_flux_checker/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 4 2 | keff: 6.31925E-01 3 | -------------------------------------------------------------------------------- /tests/test_mpi_flux_checker/test_mpi_flux_checker.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | # This test should only be collected if OpenMOC was installed with an MPI 4 | # wrapped compiler 5 | output = subprocess.call(["mpirun", "-n", "12", "--oversubscribe", "python", "3D_lattice.py"]) 6 | 7 | if output != 0: 8 | raise RuntimeError("Test failed") 9 | -------------------------------------------------------------------------------- /tests/test_multisim_cmfd/results_true.dat: -------------------------------------------------------------------------------- 1 | Iters: 5 keff: 1.21914E+00 2 | Iters: 5 keff: 1.21914E+00 3 | Iters: 5 keff: 1.21914E+00 4 | -------------------------------------------------------------------------------- /tests/test_multisim_cmfd/test_multisim_cmfd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import MultiSimTestHarness 8 | from input_set import PwrAssemblyInput 9 | import openmoc 10 | 11 | 12 | class MultiSimCmfdTestHarness(MultiSimTestHarness): 13 | """A multi-simulation eigenvalue calculation with CMFD for a 17x17 14 | lattice with 7-group C5G7 cross section data.""" 15 | 16 | def __init__(self): 17 | super(MultiSimCmfdTestHarness, self).__init__() 18 | self.input_set = PwrAssemblyInput() 19 | self.max_iters = 5 20 | 21 | def _create_geometry(self): 22 | """Initialize CMFD and add it to the Geometry.""" 23 | 24 | super(MultiSimCmfdTestHarness, self)._create_geometry() 25 | 26 | # Initialize CMFD 27 | cmfd = openmoc.Cmfd() 28 | cmfd.setCMFDRelaxationFactor(1.0) 29 | cmfd.setSORRelaxationFactor(1.5) 30 | cmfd.setLatticeStructure(17,17) 31 | cmfd.setGroupStructure([[1,2,3], [4,5,6,7]]) 32 | cmfd.setKNearest(3) 33 | 34 | # Add CMFD to the Geometry 35 | self.input_set.geometry.setCmfd(cmfd) 36 | 37 | 38 | if __name__ == '__main__': 39 | harness = MultiSimCmfdTestHarness() 40 | harness.main() 41 | -------------------------------------------------------------------------------- /tests/test_multisim_fixed_source/results_true.dat: -------------------------------------------------------------------------------- 1 | 4dbc1f11da0cc48e3cf86fef5ad8daa88907f9e29437a043158a86bd2710b7d4509d218e054ee785b2b87c9646f325c45c81bfdf0888a51a4aeb20564b0fe032 -------------------------------------------------------------------------------- /tests/test_multisim_linear_source/results_true.dat: -------------------------------------------------------------------------------- 1 | Iters: 261 keff: 1.04666E+00 2 | Iters: 261 keff: 1.04666E+00 3 | Iters: 261 keff: 1.04666E+00 4 | -------------------------------------------------------------------------------- /tests/test_multisim_linear_source/test_multisim_linear.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import MultiSimTestHarness 8 | from input_set import PinCellInput 9 | import openmoc 10 | 11 | 12 | class MultiSimSimpleTestHarness(MultiSimTestHarness): 13 | """A multi-simulation eigenvalue calculation for a pin cell problem 14 | with C5G7 7-group cross section data.""" 15 | 16 | def __init__(self): 17 | super(MultiSimSimpleTestHarness, self).__init__() 18 | self.input_set = PinCellInput() 19 | 20 | def _create_solver(self): 21 | """Instantiate a CPULSSolver.""" 22 | self.solver = openmoc.CPULSSolver(self.track_generator) 23 | self.solver.setNumThreads(self.num_threads) 24 | self.solver.setConvergenceThreshold(self.tolerance) 25 | 26 | if __name__ == '__main__': 27 | harness = MultiSimSimpleTestHarness() 28 | harness.main() 29 | -------------------------------------------------------------------------------- /tests/test_multisim_materials/results_true.dat: -------------------------------------------------------------------------------- 1 | Iters: 261 keff: 1.04666E+00 2 | Iters: 261 keff: 1.04666E+00 3 | Iters: 261 keff: 1.04666E+00 4 | -------------------------------------------------------------------------------- /tests/test_multisim_materials/test_multisim_materials.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import MultiSimTestHarness 8 | from input_set import PinCellInput 9 | import openmoc 10 | 11 | 12 | class MultiSimMaterialsTestHarness(MultiSimTestHarness): 13 | """A multi-simulation eigenvalue calculation with different materials in 14 | a pin cell problem with C5G7 7-group cross section data.""" 15 | 16 | def __init__(self): 17 | super(MultiSimMaterialsTestHarness, self).__init__() 18 | self.input_set = PinCellInput() 19 | 20 | def _run_openmoc(self): 21 | """Run multiple OpenMOC eigenvalue calculations with different 22 | materials.""" 23 | 24 | for i in range(self.num_simulations): 25 | 26 | # Extract all of the Material-filled Cells in the Geometry 27 | cells = self.input_set.geometry.getAllMaterialCells() 28 | materials = self.input_set.geometry.getAllMaterials() 29 | 30 | # Exchange all of the Materials for their clones 31 | for cell_id in cells: 32 | material = cells[cell_id].getFillMaterial() 33 | clone = material.clone() 34 | cells[cell_id].setFill(clone) 35 | 36 | # Turn on SWIG flag to register old Materials 37 | # with Python garbage collector 38 | for material_id in materials: 39 | materials[material_id].thisown = 1 40 | 41 | # Run eigenvalue calculation and store the results 42 | self.num_simulations = 1 43 | super(MultiSimMaterialsTestHarness, self)._run_openmoc() 44 | 45 | 46 | if __name__ == '__main__': 47 | harness = MultiSimMaterialsTestHarness() 48 | harness.main() 49 | -------------------------------------------------------------------------------- /tests/test_multisim_materials_cmfd/results_true.dat: -------------------------------------------------------------------------------- 1 | Iters: 11 keff: 7.52494E-01 2 | Iters: 11 keff: 7.52494E-01 3 | Iters: 11 keff: 7.52494E-01 4 | -------------------------------------------------------------------------------- /tests/test_multisim_num_azim/results_true.dat: -------------------------------------------------------------------------------- 1 | # tracks: 116 # segments: 196 2 | # tracks: 212 # segments: 380 3 | # tracks: 420 # segments: 748 4 | Iters: 261 keff: 1.04666E+00 5 | Iters: 257 keff: 1.04413E+00 6 | Iters: 256 keff: 1.04574E+00 7 | -------------------------------------------------------------------------------- /tests/test_multisim_num_groups/results_true.dat: -------------------------------------------------------------------------------- 1 | Iters: 111 keff: 1.43249E+00 2 | Iters: 108 keff: 1.72307E+00 3 | -------------------------------------------------------------------------------- /tests/test_multisim_simple/results_true.dat: -------------------------------------------------------------------------------- 1 | Iters: 261 keff: 1.04666E+00 2 | Iters: 261 keff: 1.04666E+00 3 | Iters: 261 keff: 1.04666E+00 4 | -------------------------------------------------------------------------------- /tests/test_multisim_simple/test_multisim_simple.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import MultiSimTestHarness 8 | from input_set import PinCellInput 9 | import openmoc 10 | 11 | 12 | class MultiSimSimpleTestHarness(MultiSimTestHarness): 13 | """A multi-simulation eigenvalue calculation for a pin cell problem 14 | with C5G7 7-group cross section data.""" 15 | 16 | def __init__(self): 17 | super(MultiSimSimpleTestHarness, self).__init__() 18 | self.input_set = PinCellInput() 19 | 20 | 21 | if __name__ == '__main__': 22 | harness = MultiSimSimpleTestHarness() 23 | harness.main() 24 | -------------------------------------------------------------------------------- /tests/test_non_uniform_lattice_geometry/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 27 2 | keff: 1.27201E+00 3 | # FSRs: 216 4 | -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/test_plot_3D_cells.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import NonUniformLatticeInput 9 | from openmoc.plotter import plot_cells 10 | import openmoc 11 | 12 | 13 | class PlotCellsTestHarness(PlottingTestHarness): 14 | """Test cell plotting with a 4x4 lattice.""" 15 | 16 | def __init__(self): 17 | super(PlotCellsTestHarness, self).__init__() 18 | self.input_set = NonUniformLatticeInput() 19 | 20 | def _run_openmoc(self): 21 | """Plot the cells in the geometry.""" 22 | 23 | # Create a series of Matplotlib Figures / PIL Images for different 24 | # plotting parameters and append to figures list 25 | self.figures.append( 26 | plot_cells(self.input_set.geometry, gridsize=100, offset=0.1, 27 | get_figure=True)) 28 | self.figures.append( 29 | plot_cells(self.input_set.geometry, gridsize=100, offset=0.1, 30 | get_figure=True)) 31 | self.figures.append( 32 | plot_cells(self.input_set.geometry, gridsize=100, offset=0.1, 33 | get_figure=True, xlim=(0., 2.), ylim=(0., 2.))) 34 | self.figures.append( 35 | plot_cells(self.input_set.geometry, gridsize=100, offset=0.1, 36 | get_figure=True, library='pil')) 37 | self.figures.append( 38 | plot_cells(self.input_set.geometry, gridsize=100, plane="yz", 39 | offset=0.6, get_figure=True)) 40 | self.figures.append( 41 | plot_cells(self.input_set.geometry, gridsize=100, plane="xz", 42 | offset=0.6, get_figure=True)) 43 | 44 | 45 | if __name__ == '__main__': 46 | harness = PlotCellsTestHarness() 47 | harness.main() 48 | -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cells/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cells/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cells/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cells/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cells/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cells/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cells/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cmfd_cells/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cmfd_cells/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cmfd_cells/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cmfd_cells/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cmfd_cells/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cmfd_cells/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cmfd_cells/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cmfd_cells/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_3D_cmfd_cells/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_cmfd_cells/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fission_rates/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fission_rates/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fission_rates/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fission_rates/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fission_rates/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fission_rates/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fission_rates/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fission_rates/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fsrs/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fsrs/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fsrs/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fsrs/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fsrs/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fsrs/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_3D_fsrs/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_fsrs/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_3D_materials/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_materials/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_materials/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_materials/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_3D_materials/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_materials/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_3D_materials/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_materials/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_3D_materials/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_materials/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_3D_materials/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_materials/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_3D_segments/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_segments/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-10.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-11.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-12.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-13.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-14.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-15.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-16.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-17.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-18.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-19.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-6.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-7.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-8.png -------------------------------------------------------------------------------- /tests/test_plot_3D_spatial_fluxes/true-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_spatial_fluxes/true-9.png -------------------------------------------------------------------------------- /tests/test_plot_3D_tracks/test_plot_3D_tracks.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import AxialExtendedInput 9 | from openmoc.plotter import plot_tracks 10 | import openmoc 11 | 12 | class PlotTracksTestHarness(PlottingTestHarness): 13 | """Test track plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotTracksTestHarness, self).__init__() 17 | self.input_set = AxialExtendedInput() 18 | self.num_polar = 4 19 | self.azim_spacing = 0.5 20 | self.z_spacing = 2.0 21 | self.max_iters = 1 22 | 23 | def _create_trackgenerator(self): 24 | """Instantiate a TrackGenerator.""" 25 | geometry = self.input_set.geometry 26 | geometry.initializeFlatSourceRegions() 27 | self.track_generator = \ 28 | openmoc.TrackGenerator3D(geometry, self.num_azim, self.num_polar, 29 | self.azim_spacing, self.z_spacing) 30 | self.track_generator.setSegmentFormation(openmoc.OTF_STACKS) 31 | 32 | def _create_solver(self): 33 | super(PlotTracksTestHarness, self)._create_solver() 34 | # Use only 1 thread for FSR numbering reproducibility 35 | # and for OTF ray tracing 36 | self.solver.setNumThreads(1) 37 | 38 | def _run_openmoc(self): 39 | """Plot the tracks.""" 40 | 41 | # Run an eigenvalue calculation to setup track generator 42 | super(PlotTracksTestHarness, self)._run_openmoc() 43 | 44 | # Create Matplotlib Figures for the tracks 45 | self.figures = \ 46 | [plot_tracks(self.track_generator, get_figure=True, plot_3D=True)] 47 | 48 | 49 | if __name__ == '__main__': 50 | harness = PlotTracksTestHarness() 51 | harness.main() 52 | -------------------------------------------------------------------------------- /tests/test_plot_3D_tracks/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_3D_tracks/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_cells/test_plot_cells.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import SimpleLatticeInput 9 | from openmoc.plotter import plot_cells 10 | 11 | 12 | class PlotCellsTestHarness(PlottingTestHarness): 13 | """Test cell plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotCellsTestHarness, self).__init__() 17 | self.input_set = SimpleLatticeInput(num_dimensions=3) 18 | 19 | def _run_openmoc(self): 20 | """Plot the cells in the geometry.""" 21 | 22 | # Create a series of Matplotlib Figures / PIL Images for different 23 | # plotting parameters and append to figures list 24 | self.figures.append( 25 | plot_cells(self.input_set.geometry, gridsize=100, 26 | get_figure=True)) 27 | self.figures.append( 28 | plot_cells(self.input_set.geometry, gridsize=100, 29 | offset=2.5, get_figure=True)) 30 | self.figures.append( 31 | plot_cells(self.input_set.geometry, gridsize=100, 32 | get_figure=True, xlim=(0., 2.), ylim=(0., 2.))) 33 | self.figures.append( 34 | plot_cells(self.input_set.geometry, gridsize=100, 35 | get_figure=True, library='pil')) 36 | self.figures.append( 37 | plot_cells(self.input_set.geometry, gridsize=100, plane="yz", 38 | get_figure=True)) 39 | self.figures.append( 40 | plot_cells(self.input_set.geometry, gridsize=100, plane="xz", 41 | get_figure=True)) 42 | 43 | 44 | if __name__ == '__main__': 45 | harness = PlotCellsTestHarness() 46 | harness.main() 47 | -------------------------------------------------------------------------------- /tests/test_plot_cells/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cells/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_cells/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cells/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_cells/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cells/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_cells/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cells/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_cells/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cells/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_cells/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cells/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_cmfd_cells/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cmfd_cells/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_cmfd_cells/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cmfd_cells/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_cmfd_cells/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_cmfd_cells/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_energy_fluxes/test_plot_energy_fluxes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import PinCellInput 9 | from openmoc.plotter import plot_energy_fluxes 10 | 11 | 12 | class PlotEnergyFluxesTestHarness(PlottingTestHarness): 13 | """Test spatial flux plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotEnergyFluxesTestHarness, self).__init__() 17 | self.input_set = PinCellInput() 18 | 19 | def _run_openmoc(self): 20 | """Run OpenMOC and plot the spatial fluxes in the geometry.""" 21 | 22 | # Run an eigenvalue calculation 23 | super(PlotEnergyFluxesTestHarness, self)._run_openmoc() 24 | 25 | # Extract the FSR count from the geometry 26 | num_fsrs = self.input_set.geometry.getNumFSRs() 27 | fsrs = tuple(range(num_fsrs)) 28 | 29 | # Create a series of Matplotlib Figures / PIL Images for different 30 | # plotting parameters and append to figures list 31 | self.figures.extend(plot_energy_fluxes(self.solver, fsrs, 32 | get_figure=True)) 33 | self.figures.extend(plot_energy_fluxes(self.solver, fsrs, 34 | get_figure=True, loglog=True)) 35 | 36 | 37 | if __name__ == '__main__': 38 | harness = PlotEnergyFluxesTestHarness() 39 | harness.main() 40 | -------------------------------------------------------------------------------- /tests/test_plot_energy_fluxes/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_energy_fluxes/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_energy_fluxes/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_energy_fluxes/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_energy_fluxes/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_energy_fluxes/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_energy_fluxes/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_energy_fluxes/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_fission_rates/test_plot_fission_rates.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import SimpleLatticeInput 9 | from openmoc.plotter import plot_fission_rates 10 | 11 | 12 | class PlotFissionRatesTestHarness(PlottingTestHarness): 13 | """Test fission rate plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotFissionRatesTestHarness, self).__init__() 17 | self.input_set = SimpleLatticeInput() 18 | 19 | def _run_openmoc(self): 20 | """Run OpenMOC and plot the fission rates in the geometry.""" 21 | 22 | # Run an eigenvalue calculation 23 | super(PlotFissionRatesTestHarness, self)._run_openmoc() 24 | 25 | # Create a series of Matplotlib Figures / PIL Images for different 26 | # plotting parameters and append to figures list 27 | self.figures.append( 28 | plot_fission_rates(self.solver, gridsize=100, 29 | get_figure=True)) 30 | self.figures.append( 31 | plot_fission_rates(self.solver, gridsize=100, get_figure=True, 32 | xlim=(0., 2.), ylim=(0., 2.))) 33 | self.figures.append( 34 | plot_fission_rates(self.solver, gridsize=100, get_figure=True, 35 | norm=False, transparent_zeros=False)) 36 | self.figures.append( 37 | plot_fission_rates(self.solver, gridsize=100, get_figure=True, 38 | library='pil')) 39 | 40 | 41 | if __name__ == '__main__': 42 | harness = PlotFissionRatesTestHarness() 43 | harness.main() 44 | -------------------------------------------------------------------------------- /tests/test_plot_fission_rates/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fission_rates/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_fission_rates/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fission_rates/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_fission_rates/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fission_rates/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_fission_rates/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fission_rates/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_fsrs/test_plot_fsrs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import SimpleLatticeInput 9 | from openmoc.plotter import plot_flat_source_regions 10 | 11 | 12 | class PlotFSRsTestHarness(PlottingTestHarness): 13 | """Test flat source region plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotFSRsTestHarness, self).__init__() 17 | self.input_set = SimpleLatticeInput() 18 | 19 | def _run_openmoc(self): 20 | """Plot the flat source regions in the geometry.""" 21 | 22 | # Run an eigenvalue calculation to setup FSR centroids 23 | super(PlotFSRsTestHarness, self)._run_openmoc() 24 | 25 | # Create a series of Matplotlib Figures / PIL Images for different 26 | # plotting parameters and append to figures list 27 | self.figures.append( 28 | plot_flat_source_regions(self.input_set.geometry, gridsize=100, 29 | get_figure=True)) 30 | self.figures.append( 31 | plot_flat_source_regions(self.input_set.geometry, gridsize=100, 32 | get_figure=True, xlim=(0., 2.), ylim=(0., 2.))) 33 | self.figures.append( 34 | plot_flat_source_regions(self.input_set.geometry, gridsize=100, 35 | get_figure=True, centroids=True, marker_size=3)) 36 | self.figures.append( 37 | plot_flat_source_regions(self.input_set.geometry, gridsize=100, 38 | get_figure=True, centroids=True, library='pil')) 39 | 40 | 41 | if __name__ == '__main__': 42 | harness = PlotFSRsTestHarness() 43 | harness.main() 44 | -------------------------------------------------------------------------------- /tests/test_plot_fsrs/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fsrs/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_fsrs/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fsrs/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_fsrs/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fsrs/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_fsrs/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_fsrs/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_materials/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_materials/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_materials/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_materials/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_materials/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_materials/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_materials/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_materials/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_materials/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_materials/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_materials/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_materials/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_quadrature/test_plot_quadrature.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import PinCellInput 9 | from openmoc.plotter import plot_quadrature 10 | 11 | 12 | class PlotQuadratureTestHarness(PlottingTestHarness): 13 | """Test quadrature plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotQuadratureTestHarness, self).__init__() 17 | self.input_set = PinCellInput() 18 | 19 | def _run_openmoc(self): 20 | """Plot the polar quadrature.""" 21 | 22 | # Run an eigenvalue calculation to setup polar quadrature 23 | super(PlotQuadratureTestHarness, self)._run_openmoc() 24 | 25 | # Create Matplotlib Figures for the polar quadrature 26 | self.figures = [plot_quadrature(self.solver, get_figure=True)] 27 | 28 | 29 | if __name__ == '__main__': 30 | harness = PlotQuadratureTestHarness() 31 | harness.main() 32 | -------------------------------------------------------------------------------- /tests/test_plot_quadrature/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_quadrature/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_segments/test_plot_segments.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import PinCellInput 9 | from openmoc.plotter import plot_segments 10 | 11 | 12 | class PlotSegmentsTestHarness(PlottingTestHarness): 13 | """Test segment plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotSegmentsTestHarness, self).__init__() 17 | self.input_set = PinCellInput() 18 | 19 | def _run_openmoc(self): 20 | """Plot the tracks.""" 21 | 22 | # Run an eigenvalue calculation to setup track generator 23 | super(PlotSegmentsTestHarness, self)._run_openmoc() 24 | 25 | # Create Matplotlib Figures for the tracks 26 | self.figures = [plot_segments(self.track_generator, get_figure=True), 27 | plot_segments(self.track_generator, plot_3D=True, get_figure=True)] 28 | 29 | 30 | if __name__ == '__main__': 31 | harness = PlotSegmentsTestHarness() 32 | harness.main() 33 | -------------------------------------------------------------------------------- /tests/test_plot_segments/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_segments/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_segments/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_segments/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_data/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_data/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_data/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_data/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_data/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_data/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_data/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_data/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_data/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_data/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_data/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_data/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/test_plot_spatial_fluxes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import SimpleLatticeInput 9 | from openmoc.plotter import plot_spatial_fluxes 10 | 11 | 12 | class PlotSpatialFluxesTestHarness(PlottingTestHarness): 13 | """Test spatial flux plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotSpatialFluxesTestHarness, self).__init__() 17 | self.input_set = SimpleLatticeInput() 18 | 19 | def _run_openmoc(self): 20 | """Run OpenMOC and plot the spatial fluxes in the geometry.""" 21 | 22 | # Run an eigenvalue calculation 23 | super(PlotSpatialFluxesTestHarness, self)._run_openmoc() 24 | 25 | # Specify energy groups for which to plot the spatial flux 26 | energy_groups = [1, 3, 5, 7] 27 | 28 | # Create a series of Matplotlib Figures / PIL Images for different 29 | # plotting parameters and append to figures list 30 | self.figures.extend( 31 | plot_spatial_fluxes(self.solver, gridsize=100, 32 | get_figure=True, energy_groups=energy_groups)) 33 | self.figures.extend( 34 | plot_spatial_fluxes(self.solver, gridsize=100, get_figure=True, 35 | xlim=(0., 2.), ylim=(0., 2.), 36 | energy_groups=energy_groups)) 37 | self.figures.extend( 38 | plot_spatial_fluxes(self.solver, gridsize=100, get_figure=True, 39 | energy_groups=energy_groups, library='pil')) 40 | 41 | 42 | if __name__ == '__main__': 43 | harness = PlotSpatialFluxesTestHarness() 44 | harness.main() 45 | -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-1.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-10.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-11.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-2.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-3.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-4.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-5.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-6.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-7.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-8.png -------------------------------------------------------------------------------- /tests/test_plot_spatial_fluxes/true-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_spatial_fluxes/true-9.png -------------------------------------------------------------------------------- /tests/test_plot_tracks/test_plot_tracks.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import PlottingTestHarness 8 | from input_set import PinCellInput 9 | from openmoc.plotter import plot_tracks 10 | 11 | 12 | class PlotTracksTestHarness(PlottingTestHarness): 13 | """Test track plotting with a 4x4 lattice.""" 14 | 15 | def __init__(self): 16 | super(PlotTracksTestHarness, self).__init__() 17 | self.input_set = PinCellInput() 18 | 19 | def _run_openmoc(self): 20 | """Plot the tracks.""" 21 | 22 | # Run an eigenvalue calculation to setup track generator 23 | super(PlotTracksTestHarness, self)._run_openmoc() 24 | 25 | # Create Matplotlib Figures for the tracks 26 | self.figures = [plot_tracks(self.track_generator, get_figure=True), 27 | plot_tracks(self.track_generator, get_figure=True, plot_3D=True)] 28 | 29 | 30 | if __name__ == '__main__': 31 | harness = PlotTracksTestHarness() 32 | harness.main() 33 | -------------------------------------------------------------------------------- /tests/test_plot_tracks/true-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_tracks/true-0.png -------------------------------------------------------------------------------- /tests/test_plot_tracks/true-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_plot_tracks/true-1.png -------------------------------------------------------------------------------- /tests/test_quadrature/results_true.dat: -------------------------------------------------------------------------------- 1 | All Quadrature sets correctly summed their weights to 4 PI with tolerance 0.005 and calculated the integral of sine as 9.8696 with tolerance 0.5 -------------------------------------------------------------------------------- /tests/test_ray_tracing_method/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 143 2 | keff: 6.47840E-01 3 | # FSRs: 416 4 | # tracks: 1504 5 | # segments: 25536 6 | -------------------------------------------------------------------------------- /tests/test_rings/results_true.dat: -------------------------------------------------------------------------------- 1 | # FSRs: 7 2 | # tracks: 116 3 | # segments: 620 4 | -------------------------------------------------------------------------------- /tests/test_rings/test_rings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PinCellInput 9 | 10 | 11 | class RingTestHarness(TestHarness): 12 | """Tests cell radial discretization.""" 13 | 14 | def __init__(self): 15 | super(RingTestHarness, self).__init__() 16 | self.input_set = PinCellInput() 17 | 18 | def _create_geometry(self): 19 | """Discretize fuel and moderator into rings.""" 20 | 21 | self.input_set.create_materials() 22 | self.input_set.create_geometry() 23 | 24 | # Create different rings for each Cell 25 | cells = self.input_set.geometry.getAllMaterialCells() 26 | for i, cell_id in enumerate(cells): 27 | cells[cell_id].setNumRings(i*2 + 3) 28 | 29 | # Create rings starting from a given radius in the moderator 30 | if i==1: 31 | cells[cell_id].setNumRings(i*2 + 3, 0.3) 32 | 33 | def _get_results(self, num_iters=False, keff=False, fluxes=False, 34 | num_fsrs=True, num_segments=True, num_tracks=True, 35 | hash_output=False): 36 | """Digest info from geometry and return as a string.""" 37 | return super(RingTestHarness, self)._get_results( 38 | num_iters=num_iters, keff=keff, fluxes=fluxes, 39 | num_fsrs=num_fsrs, num_segments=num_segments, 40 | num_tracks=num_tracks, hash_output=hash_output) 41 | 42 | 43 | if __name__ == '__main__': 44 | harness = RingTestHarness() 45 | harness.main() 46 | -------------------------------------------------------------------------------- /tests/test_runtime/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 9 2 | keff: 8.57668E-01 3 | # FSRs: 1912 4 | # tracks: 6024 5 | # segments: 99484 6 | -------------------------------------------------------------------------------- /tests/test_sectors/results_true.dat: -------------------------------------------------------------------------------- 1 | # FSRs: 8 2 | # tracks: 116 3 | # segments: 315 4 | -------------------------------------------------------------------------------- /tests/test_sectors/test_sectors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PinCellInput 9 | 10 | 11 | class SectorTestHarness(TestHarness): 12 | """Tests cell angular discretization.""" 13 | 14 | def __init__(self): 15 | super(SectorTestHarness, self).__init__() 16 | self.input_set = PinCellInput() 17 | 18 | def _create_geometry(self): 19 | """Discretize fuel and moderator into sectors.""" 20 | 21 | self.input_set.create_materials() 22 | self.input_set.create_geometry() 23 | 24 | # Create different sectors for each Cell 25 | cells = self.input_set.geometry.getAllMaterialCells() 26 | for i, cell_id in enumerate(cells): 27 | cells[cell_id].setNumSectors(i*2 + 3) 28 | 29 | #self._create_trackgenerator() 30 | #self._generate_tracks() 31 | 32 | def _get_results(self, num_iters=False, keff=False, fluxes=False, 33 | num_fsrs=True, num_segments=True, num_tracks=True, 34 | hash_output=False): 35 | """Digest info from geometry and return as a string.""" 36 | 37 | return super(SectorTestHarness, self)._get_results( 38 | num_iters=num_iters, keff=keff, fluxes=fluxes, 39 | num_fsrs=num_fsrs, num_segments=num_segments, 40 | num_tracks=num_tracks, hash_output=hash_output) 41 | 42 | 43 | if __name__ == '__main__': 44 | harness = SectorTestHarness() 45 | harness.main() 46 | -------------------------------------------------------------------------------- /tests/test_split_segments/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 262 2 | # segments: 1560 3 | -------------------------------------------------------------------------------- /tests/test_split_segments/test_split_segments.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PinCellInput 9 | 10 | 11 | class SplitSegmentsTestHarness(TestHarness): 12 | """Test segment splitting based on max optical path length.""" 13 | 14 | def __init__(self): 15 | super(SplitSegmentsTestHarness, self).__init__() 16 | self.input_set = PinCellInput() 17 | 18 | def _run_openmoc(self): 19 | """Set a small max optical path length to ensure segments are split.""" 20 | 21 | # Set a small max optical path length so segments are split 22 | self.solver.setMaxOpticalLength(0.5) 23 | 24 | super(SplitSegmentsTestHarness, self)._run_openmoc() 25 | 26 | def _get_results(self): 27 | """Digest info in the results and return as a string.""" 28 | return super(SplitSegmentsTestHarness, self).\ 29 | _get_results(num_segments=True, fluxes=False, keff=False) 30 | 31 | 32 | if __name__ == '__main__': 33 | harness = SplitSegmentsTestHarness() 34 | harness.main() 35 | -------------------------------------------------------------------------------- /tests/test_split_segments_cmfd/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 11 2 | # segments: 1616 3 | -------------------------------------------------------------------------------- /tests/test_split_segments_cmfd/test_split_segments_cmfd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.pardir) 6 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 7 | from testing_harness import TestHarness 8 | from input_set import PinCellInput 9 | import openmoc 10 | 11 | class SplitSegmentsCMFDTestHarness(TestHarness): 12 | """Test segment splitting based on max optical path length with 13 | CMFD turned on.""" 14 | 15 | def __init__(self): 16 | super(SplitSegmentsCMFDTestHarness, self).__init__() 17 | self.input_set = PinCellInput() 18 | 19 | def _setup(self): 20 | """Build materials, geometry, CMFD, and perform ray tracing.""" 21 | self._create_geometry() 22 | 23 | # Overlay simple CMFD mesh 24 | cmfd = openmoc.Cmfd() 25 | cmfd.setLatticeStructure(2, 2) 26 | self.input_set.geometry.setCmfd(cmfd) 27 | 28 | # Create track generator after setting CMFD to generate FSRs 29 | self._create_trackgenerator() 30 | 31 | self._generate_tracks() 32 | self._create_solver() 33 | 34 | def _run_openmoc(self): 35 | """Set a small max optical path length to ensure segments are split.""" 36 | 37 | # Set a small max optical path length so segments are split 38 | self.solver.setMaxOpticalLength(0.5) 39 | 40 | super(SplitSegmentsCMFDTestHarness, self)._run_openmoc() 41 | 42 | def _get_results(self): 43 | """Digest info in the results and return as a string.""" 44 | return super(SplitSegmentsCMFDTestHarness, self).\ 45 | _get_results(num_segments=True, fluxes=False, keff=False) 46 | 47 | 48 | if __name__ == '__main__': 49 | harness = SplitSegmentsCMFDTestHarness() 50 | harness.main() 51 | -------------------------------------------------------------------------------- /tests/test_superhomogenization_cell/mgxs.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_superhomogenization_cell/mgxs.pkl -------------------------------------------------------------------------------- /tests/test_superhomogenization_cell/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 11 2 | keff: 1.00000E+00 3 | fluxes: 4 | 7.146684E+00 5 | 9.128003E+00 6 | 6.170314E+00 7 | 8.337279E-01 8 | 9.268479E-02 9 | 3.473123E-02 10 | 5.499369E-02 11 | 3.693077E-02 12 | 1.036168E-01 13 | 2.459859E-01 14 | 5.176244E-01 15 | 2.468408E-01 16 | 1.285071E+00 17 | 2.038721E+00 18 | 8.483761E-01 19 | 4.951097E-01 20 | 6.815290E+00 21 | 9.109734E+00 22 | 6.154182E+00 23 | 8.328808E-01 24 | 9.249601E-02 25 | 3.462699E-02 26 | 5.483847E-02 27 | 3.684715E-02 28 | 1.033937E-01 29 | 2.454408E-01 30 | 5.156099E-01 31 | 2.449298E-01 32 | 1.271953E+00 33 | 2.001289E+00 34 | 8.189594E-01 35 | 4.593033E-01 36 | 6.236545E+00 37 | 8.982143E+00 38 | 6.207941E+00 39 | 8.354727E-01 40 | 9.300953E-02 41 | 3.493906E-02 42 | 5.525279E-02 43 | 3.704532E-02 44 | 1.039638E-01 45 | 2.467479E-01 46 | 5.196884E-01 47 | 2.481578E-01 48 | 1.288770E+00 49 | 2.034616E+00 50 | 8.373347E-01 51 | 4.738520E-01 52 | 8.138270E+00 53 | 9.450544E+00 54 | 6.001460E+00 55 | 8.257787E-01 56 | 9.107099E-02 57 | 3.375557E-02 58 | 5.368321E-02 59 | 3.629527E-02 60 | 1.018101E-01 61 | 2.418027E-01 62 | 5.041009E-01 63 | 2.355747E-01 64 | 1.222414E+00 65 | 1.899157E+00 66 | 7.592730E-01 67 | 4.070196E-01 68 | -------------------------------------------------------------------------------- /tests/test_superhomogenization_eigenvalue/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 270 2 | keff: 1.22658E+00 3 | fluxes: 4 | 2.143110E+01 5 | 2.915087E+01 6 | 1.994787E+01 7 | 2.681630E+00 8 | 2.972356E-01 9 | 1.121411E-01 10 | 1.757503E-01 11 | 1.156831E-01 12 | 3.304022E-01 13 | 7.682437E-01 14 | 1.492454E+00 15 | 5.652336E-01 16 | 2.000447E+00 17 | 3.698957E+00 18 | 2.318516E+00 19 | 1.705476E+00 20 | 2.044544E+01 21 | 2.909324E+01 22 | 1.989693E+01 23 | 2.678775E+00 24 | 2.966264E-01 25 | 1.117823E-01 26 | 1.752120E-01 27 | 1.154327E-01 28 | 3.296156E-01 29 | 7.665709E-01 30 | 1.486575E+00 31 | 5.607461E-01 32 | 1.978223E+00 33 | 3.608203E+00 34 | 2.201856E+00 35 | 1.511702E+00 36 | 1.870192E+01 37 | 2.867510E+01 38 | 2.007515E+01 39 | 2.687796E+00 40 | 2.983583E-01 41 | 1.128623E-01 42 | 1.766394E-01 43 | 1.161644E-01 44 | 3.315735E-01 45 | 7.710442E-01 46 | 1.499263E+00 47 | 5.686661E-01 48 | 2.007802E+00 49 | 3.689786E+00 50 | 2.275177E+00 51 | 1.586379E+00 52 | 2.444651E+01 53 | 3.021651E+01 54 | 1.938847E+01 55 | 2.653913E+00 56 | 2.917970E-01 57 | 1.087467E-01 58 | 1.711983E-01 59 | 1.133912E-01 60 | 3.241297E-01 61 | 7.540697E-01 62 | 1.450527E+00 63 | 5.376086E-01 64 | 1.889458E+00 65 | 3.341279E+00 66 | 1.933208E+00 67 | 1.172293E+00 68 | -------------------------------------------------------------------------------- /tests/test_superhomogenization_material/mgxs.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mit-crpg/OpenMOC/c9ac4e1ecc9c13bacb44fd470f7fce8c9355606f/tests/test_superhomogenization_material/mgxs.pkl -------------------------------------------------------------------------------- /tests/test_superhomogenization_material/results_true.dat: -------------------------------------------------------------------------------- 1 | # Iterations: 289 2 | keff: 1.17247E+00 3 | fluxes: 4 | 2.285873E+01 5 | 3.061948E+01 6 | 2.127701E+01 7 | 2.864684E+00 8 | 3.179046E-01 9 | 1.200798E-01 10 | 1.881729E-01 11 | 1.238153E-01 12 | 3.536791E-01 13 | 8.227058E-01 14 | 1.602380E+00 15 | 6.118036E-01 16 | 2.290623E+00 17 | 5.054521E+00 18 | 3.555439E+00 19 | 2.834854E+00 20 | 2.179849E+01 21 | 3.056046E+01 22 | 2.122586E+01 23 | 2.861813E+00 24 | 3.172893E-01 25 | 1.197189E-01 26 | 1.876294E-01 27 | 1.235646E-01 28 | 3.528842E-01 29 | 8.210268E-01 30 | 1.596464E+00 31 | 6.073229E-01 32 | 2.268415E+00 33 | 4.962172E+00 34 | 3.436411E+00 35 | 2.639397E+00 36 | 1.992542E+01 37 | 3.012956E+01 38 | 2.140535E+01 39 | 2.870880E+00 40 | 3.190326E-01 41 | 1.208064E-01 42 | 1.890646E-01 43 | 1.243008E-01 44 | 3.548508E-01 45 | 8.255268E-01 46 | 1.609235E+00 47 | 6.153201E-01 48 | 2.298506E+00 49 | 5.047139E+00 50 | 3.515147E+00 51 | 2.725142E+00 52 | 2.609517E+01 53 | 3.171368E+01 54 | 2.071826E+01 55 | 2.837000E+00 56 | 3.124658E-01 57 | 1.166884E-01 58 | 1.836269E-01 59 | 1.215274E-01 60 | 3.474170E-01 61 | 8.085540E-01 62 | 1.560516E+00 63 | 5.842519E-01 64 | 2.180215E+00 65 | 4.702565E+00 66 | 3.182233E+00 67 | 2.334311E+00 68 | -------------------------------------------------------------------------------- /tests/test_tracking_grid/results_true.dat: -------------------------------------------------------------------------------- 1 | Diagonal Track 3 2 | 0: 2.82842712, 0, -1, -1, Water, 10083 3 | 1: 2.82842712, 1, -1, -1, UO2, 49930 4 | 2: 2.82842712, 2, -1, -1, Water, 10083 5 | Nudged Diagonal Track 5 6 | 0: 2.82841298, 0, -1, -1, Water, 10083 7 | 1: 1.414e-05, 3, -1, -1, Water, 10083 8 | 2: 2.82841298, 1, -1, -1, UO2, 49930 9 | 3: 1.414e-05, 4, -1, -1, Water, 10083 10 | 4: 2.82841298, 2, -1, -1, Water, 10083 11 | Horizontal Track 3 12 | 0: 2.0, 5, -1, -1, Water, 10083 13 | 1: 2.0, 1, -1, -1, UO2, 49930 14 | 2: 2.0, 4, -1, -1, Water, 10083 15 | Vertical Track 3 16 | 0: 2.0, 3, -1, -1, Water, 10083 17 | 1: 2.0, 1, -1, -1, UO2, 49930 18 | 2: 2.0, 6, -1, -1, Water, 10083 19 | Reverse Diagonal Track 3 20 | 0: 2.82842712, 2, -1, -1, Water, 10083 21 | 1: 2.82842712, 1, -1, -1, UO2, 49930 22 | 2: 2.82842712, 0, -1, -1, Water, 10083 23 | -------------------------------------------------------------------------------- /tests/test_tracking_grid/test_tracking_grid.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | import math 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | from testing_harness import TrackingTestHarness 9 | from input_set import GridInput 10 | 11 | import openmoc 12 | 13 | class TrackingGridTestHarness(TrackingTestHarness): 14 | """Tests tracking over a grid geometry.""" 15 | 16 | def __init__(self): 17 | super(TrackingGridTestHarness, self).__init__() 18 | self.input_set = GridInput() 19 | 20 | def _setup(self): 21 | """Initialize the materials, geometry, and tracks.""" 22 | super(TrackingGridTestHarness, self)._create_geometry() 23 | super(TrackingGridTestHarness, self)._create_trackgenerator() 24 | 25 | # Initialize track objects 26 | self.tracks['Diagonal Track'] = openmoc.Track() 27 | self.tracks['Nudged Diagonal Track'] = openmoc.Track() 28 | self.tracks['Horizontal Track'] = openmoc.Track() 29 | self.tracks['Vertical Track'] = openmoc.Track() 30 | self.tracks['Reverse Diagonal Track'] = openmoc.Track() 31 | 32 | # Set track trajectories and locations 33 | self.tracks['Diagonal Track'].setValues(-3, -3, 3, 3, math.atan(1)) 34 | nudge = 1e-5 35 | self.tracks['Nudged Diagonal Track'].setValues(-3+nudge, -3, 3,\ 36 | 3-nudge, math.atan(1)) 37 | self.tracks['Horizontal Track'].setValues(-3, 0, 3, 0, 0) 38 | self.tracks['Vertical Track'].setValues(0, -3, 0, 3, math.pi/2) 39 | self.tracks['Reverse Diagonal Track'].setValues(3, 3, -3, -3,\ 40 | math.pi + math.atan(1)) 41 | 42 | if __name__ == '__main__': 43 | harness = TrackingGridTestHarness() 44 | harness.main() 45 | -------------------------------------------------------------------------------- /tests/test_tracking_lattice/results_true.dat: -------------------------------------------------------------------------------- 1 | Diagonal Track 3 2 | 0: 2.82842712, 0, -1, -1, Water, 10083 3 | 1: 2.82842712, 1, -1, -1, UO2, 49930 4 | 2: 2.82842712, 2, -1, -1, Water, 10083 5 | Nudged Diagonal Track 5 6 | 0: 2.82841298, 0, -1, -1, Water, 10083 7 | 1: 1.414e-05, 3, -1, -1, Water, 10083 8 | 2: 2.82841298, 1, -1, -1, UO2, 49930 9 | 3: 1.414e-05, 4, -1, -1, Water, 10083 10 | 4: 2.82841298, 2, -1, -1, Water, 10083 11 | Horizontal Track 3 12 | 0: 2.0, 5, -1, -1, Water, 10083 13 | 1: 2.0, 1, -1, -1, UO2, 49930 14 | 2: 2.0, 4, -1, -1, Water, 10083 15 | Vertical Track 3 16 | 0: 2.0, 3, -1, -1, Water, 10083 17 | 1: 2.0, 1, -1, -1, UO2, 49930 18 | 2: 2.0, 6, -1, -1, Water, 10083 19 | Reverse Diagonal Track 3 20 | 0: 2.82842712, 2, -1, -1, Water, 10083 21 | 1: 2.82842712, 1, -1, -1, UO2, 49930 22 | 2: 2.82842712, 0, -1, -1, Water, 10083 23 | -------------------------------------------------------------------------------- /tests/test_tracking_pin_cell/results_true.dat: -------------------------------------------------------------------------------- 1 | Diagonal Track 3 2 | 0: 1.82842712, 0, -1, -1, Water, 10083 3 | 1: 2.0, 1, -1, -1, UO2, 49930 4 | 2: 1.82842712, 0, -1, -1, Water, 10083 5 | Tangent Track 2 6 | 0: 1.82842712, 0, -1, -1, Water, 10083 7 | 1: 1.82842712, 0, -1, -1, Water, 10083 8 | Nudged Tangent Track 3 9 | 0: 1.82723862, 0, -1, -1, Water, 10083 10 | 1: 0.00237841, 1, -1, -1, UO2, 49930 11 | 2: 1.82723862, 0, -1, -1, Water, 10083 12 | Horizontal Track 3 13 | 0: 1.0, 0, -1, -1, Water, 10083 14 | 1: 2.0, 1, -1, -1, UO2, 49930 15 | 2: 1.0, 0, -1, -1, Water, 10083 16 | Vertical Track 3 17 | 0: 1.0, 0, -1, -1, Water, 10083 18 | 1: 2.0, 1, -1, -1, UO2, 49930 19 | 2: 1.0, 0, -1, -1, Water, 10083 20 | Reverse Diagonal Track 3 21 | 0: 1.82842712, 0, -1, -1, Water, 10083 22 | 1: 2.0, 1, -1, -1, UO2, 49930 23 | 2: 1.82842712, 0, -1, -1, Water, 10083 24 | -------------------------------------------------------------------------------- /tests/test_transport_stabilization/negative_sources_reference: -------------------------------------------------------------------------------- 1 | [NORMAL] Group-wise distribution of negative sources: 2 | [NORMAL] Group 0: 0 3 | [NORMAL] Group 1: 0 4 | [NORMAL] Group 2: 0 5 | [NORMAL] Group 3: 622 6 | [NORMAL] Group 4: 0 7 | [NORMAL] Group 5: 0 8 | [NORMAL] Group 6: 0 9 | [NORMAL] Spatial distribution of negative sources: 10 | -------- z = 0 ---------- 11 | 2 1 2 2 4 2 2 2 4 2 2 2 4 2 2 1 2 12 | 1 0 0 1 2 2 2 2 2 1 0 1 2 2 3 2 1 13 | 2 0 0 2 4 3 2 2 4 1 0 0 4 2 2 3 2 14 | 2 1 2 2 3 2 2 2 2 2 2 2 3 2 2 2 2 15 | 4 2 4 3 8 2 4 3 8 3 4 2 8 3 4 2 4 16 | 2 1 0 2 2 2 2 2 2 2 0 2 2 2 1 2 2 17 | 2 0 0 2 4 2 0 2 4 1 0 0 4 2 0 0 2 18 | 2 1 1 2 3 2 2 2 2 2 1 2 3 2 1 2 2 19 | 4 2 4 2 8 2 4 2 8 2 4 2 8 2 4 2 4 20 | 2 1 1 2 3 2 2 2 2 2 1 2 3 2 2 2 2 21 | 2 0 0 2 4 2 0 2 4 1 0 0 4 2 2 2 2 22 | 2 1 0 2 2 2 2 2 2 2 0 2 2 2 3 2 2 23 | 4 2 4 3 8 2 4 3 8 3 4 2 8 3 4 2 4 24 | 2 1 2 2 3 2 2 2 2 2 2 2 3 2 2 1 2 25 | 2 0 0 2 4 1 0 1 4 1 0 0 4 2 0 1 2 26 | 1 0 0 1 2 2 0 2 2 1 0 1 2 1 1 2 1 27 | 2 1 2 2 4 2 2 2 4 2 2 2 4 2 2 1 2 28 | -------------------------------------------------------------------------------- /tests/test_transport_stabilization/results_true.dat: -------------------------------------------------------------------------------- 1 | a2bd38b1f13ec3d405f692bc21f261391b4d5db467ac089fd5c9a013f8d876c48500f95e4fbcc2e8ca3342dd234a01e82a3ffbf3b85946a2faaf25ce9c564e76 -------------------------------------------------------------------------------- /tests/travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ev 4 | 5 | # Run all tests 6 | ./run_tests.py --coverage --verbose 7 | -------------------------------------------------------------------------------- /tests/unit_tests/test_cmfd_parameters.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy 3 | 4 | import os 5 | import sys 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | import openmoc 9 | 10 | 11 | class TestCmfdParameters(unittest.TestCase): 12 | 13 | def test_cmfd_parameters(self): 14 | ''' Check default CMFD parameters and getters.''' 15 | 16 | cmfd = openmoc.Cmfd() 17 | 18 | # Check flux update 19 | self.assertEqual(cmfd.isFluxUpdateOn(), True) 20 | cmfd.setFluxUpdateOn(False) 21 | self.assertEqual(cmfd.isFluxUpdateOn(), False) 22 | 23 | # Check sigmaT rebalance 24 | self.assertEqual(cmfd.isSigmaTRebalanceOn(), False) 25 | cmfd.rebalanceSigmaT(True) 26 | self.assertEqual(cmfd.isSigmaTRebalanceOn(), True) 27 | 28 | # Check centroid update 29 | self.assertEqual(cmfd.isCentroidUpdateOn(), False) 30 | cmfd.setCentroidUpdateOn(True) 31 | self.assertEqual(cmfd.isCentroidUpdateOn(), True) 32 | 33 | def test_cmfd_group_structure(self): 34 | 35 | cmfd = openmoc.Cmfd() 36 | 37 | # CMFD number of groups getter test 38 | cmfd.setGroupStructure([[1, 2, 3], [4, 5]]) 39 | self.assertEqual(cmfd.getNumCmfdGroups(), 2) 40 | 41 | # Check exception raising for non-monotonic group structure 42 | with self.assertRaises(Exception): cmfd.setGroupStructure([[1, 2, 6], 43 | [4, 5]]) 44 | 45 | # Check exception raising for non-continuous group structure 46 | with self.assertRaises(Exception): cmfd.setGroupStructure([[1, 2, 3], 47 | [6, 7]]) 48 | 49 | if __name__ == '__main__': 50 | unittest.main() 51 | -------------------------------------------------------------------------------- /tests/unit_tests/test_rectangular_prism.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy as np 3 | 4 | import os 5 | import sys 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | import openmoc 9 | 10 | class TestRectangularPrism(unittest.TestCase): 11 | 12 | def test_constructor(self): 13 | rectprism = openmoc.RectangularPrism(1, 2, .5, 1.5, 3, 2.5) 14 | 15 | self.assertEqual(rectprism.getMinX(), 0) 16 | self.assertEqual(rectprism.getMinY(), .5) 17 | self.assertEqual(rectprism.getMinZ(), 1) 18 | self.assertEqual(rectprism.getMaxX(), 1) 19 | self.assertEqual(rectprism.getMaxY(), 2.5) 20 | self.assertEqual(rectprism.getMaxZ(), 4) 21 | 22 | def test_boundary_type_setter(self): 23 | rectprism = openmoc.RectangularPrism(1, 2, .5, 1.5, 3, 2.5) 24 | 25 | rectprism.setBoundaryType(openmoc.VACUUM) 26 | min_btx = rectprism.getMinXBoundaryType() 27 | 28 | self.assertEqual(min_btx, openmoc.VACUUM) 29 | 30 | if __name__ == '__main__': 31 | unittest.main() -------------------------------------------------------------------------------- /tests/unit_tests/test_track3D.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy as np 3 | 4 | import os 5 | import sys 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | import openmoc 9 | 10 | class TestTrack3D(unittest.TestCase): 11 | 12 | def test_setters_getters(self): 13 | 14 | # Set track3D components 15 | track = openmoc.Track3D() 16 | track.setTheta(0.5) 17 | track.setPolarIndex(1) 18 | track.setZIndex(2) 19 | track.setLZIndex(3) 20 | track.setCycleIndex(4) 21 | track.setCycleTrackIndex(5) 22 | track.setTrainIndex(6) 23 | 24 | # Use getter to check that setter worked 25 | self.assertEqual(track.getTheta(), 0.5) 26 | self.assertEqual(track.getPolarIndex(), 1) 27 | self.assertEqual(track.getZIndex(), 2) 28 | self.assertEqual(track.getLZIndex(), 3) 29 | self.assertEqual(track.getCycleIndex(), 4) 30 | self.assertEqual(track.getCycleTrackIndex(), 5) 31 | self.assertEqual(track.getTrainIndex(), 6) 32 | 33 | if __name__ == '__main__': 34 | unittest.main() 35 | -------------------------------------------------------------------------------- /tests/unit_tests/test_universes.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import numpy as np 3 | 4 | import os 5 | import sys 6 | sys.path.insert(0, os.pardir) 7 | sys.path.insert(0, os.path.join(os.pardir, 'openmoc')) 8 | import openmoc 9 | 10 | class TestUniverse(unittest.TestCase): 11 | 12 | def setUp(self): 13 | self.universe = openmoc.Universe(id=12, name="test universe") 14 | self.cell = openmoc.Cell(name="test cell") 15 | self.universe.addCell(self.cell) 16 | 17 | def test_getters(self): 18 | 19 | self.assertEqual(self.universe.getId(), 12) 20 | self.assertEqual(self.universe.getName(), "test universe") 21 | self.assertEqual(self.universe.getUid(), 4) 22 | 23 | def test_ids(self): 24 | 25 | openmoc.reset_universe_id() 26 | universe_2 = openmoc.Universe() 27 | self.assertEqual(universe_2.getId(), 1000001) 28 | openmoc.maximize_universe_id(10000000) 29 | universe_3 = openmoc.Universe() 30 | self.assertEqual(universe_3.getId(), 10000000) 31 | 32 | def test_cells(self): 33 | 34 | self.assertEqual(self.universe.getNumCells(), 1) 35 | self.assertEqual(self.universe.getCell(self.cell.getId()).getId(), 36 | self.cell.getId()) 37 | self.universe.removeCell(self.cell) 38 | self.assertEqual(self.universe.getNumCells(), 0) 39 | self.universe.printString() 40 | 41 | def test_clone(self): 42 | 43 | self.cell.setFill(openmoc.Material()) 44 | clone = self.universe.clone() 45 | self.assertEqual(self.universe.getCell(self.cell.getId()).getName(), 46 | "test cell") 47 | 48 | def test_fissionable(self): 49 | 50 | self.assertEqual(self.universe.isFissionable(), False) 51 | self.universe.setFissionability(True) 52 | self.assertEqual(self.universe.isFissionable(), True) 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /tools/ci/travis-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | # Handle Python third-party packages 5 | if [ -d "$HOME/miniconda" ] && [ -d "$HOME/miniconda/bin" ]; then 6 | echo "Using cached Miniconda" 7 | export PATH="$HOME/miniconda/bin:$PATH" 8 | else 9 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh 10 | rm -rf $HOME/miniconda 11 | bash miniconda.sh -b -p $HOME/miniconda 12 | export PATH="$HOME/miniconda/bin:$PATH" 13 | hash -r 14 | conda config --set always_yes yes --set changeps1 no 15 | conda config --add channels conda-forge 16 | # conda update -q --force conda 17 | conda info -a 18 | conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy h5py pandas matplotlib pillow uncertainties pandas 19 | fi 20 | source activate test-environment 21 | sudo apt-get install swig 22 | 23 | # For coverage testing of C++ and Python source files 24 | pip install coverage 25 | pip install cpp-coveralls 26 | pip install coveralls 27 | 28 | # Install openmc for Superhomogeneization test 29 | if [ -d "$HOME/openmc" ] && [ -d "$HOME/openmc/openmc" ]; then 30 | echo "Using cached OpenMC" 31 | else 32 | git clone --depth=50 --branch=develop https://github.com/openmc-dev/openmc.git $HOME/openmc 33 | fi 34 | export PYTHONPATH="$HOME/openmc/:$PYTHONPATH" 35 | 36 | # Install mpi4py and MPI-wrapped compilers for MPI configurations 37 | if [[ $MPI == 'y' ]]; then 38 | conda config --add channels conda-forge 39 | conda install -y mpi4py openmpi-mpicc openmpi-mpicxx 40 | export LD_PRELOAD="$HOME/miniconda/envs/test-environment/lib/libmpi_cxx.so" 41 | # Get regular C++11-compatible compiler for non-MPI configurations 42 | else 43 | sudo apt-get install -qq gcc-6 g++-6 44 | sudo rm /usr/bin/gcc 45 | sudo rm /usr/bin/g++ 46 | sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc 47 | sudo ln -s /usr/bin/g++-6 /usr/bin/g++ 48 | fi 49 | --------------------------------------------------------------------------------