Shield4Fusion provides intelligent shielding design for fusion reactors using multi-objective GA optimization. It includes an inverse material design feature to investigates optimal shielding configurations based on input neutron flux and desired output parameters. For the time being the only geometry set up includes a 4 layers shielding cabinets, but it can be extended for different fusion application problems with few modifications to the template script. Depending on the desired output and input geometry modifications to the job generation and evolve scripts may be required as well.
- Multi-objective genetic algorithm for dataset generation
- Data visualization and Pareto analysis
- Inverse material design for shielding investigation from dataset
- Modular and pip-installable structure
Clone the repository and run:
pip install .The inverse design tool allows you to query pre-computed datasets to find optimal shielding configurations without needing OpenMC installed:
cd shield4fusion/shielding_cabinets/dataset
python ../inverse_design.pyThe tool will interactively prompt you to:
- Select neutron source type (DD or DT spectrum)
- Choose target property (flux or dose attenuation)
- Specify desired attenuation value
To generate a new dataset using the genetic algorithm optimization:
The first_gen.txt file contains the initial population. Modify if needed or use the provided default.
For HPC with SLURM:
cd shield4fusion/shielding_cabinets
python generate_slurm_jobs.py
# Submit generated job scripts to SLURMFor HPC with PBS:
python generate_pbs_jobs.py
# Submit generated job scripts to PBSFor local/serial execution:
python generate_serial_jobs.pyAfter simulations complete for generation N:
python postprocess_gen.py NThis reads tallies.out files and creates genN/results_gen.txt.
python evolve_generation.py NThis creates genN+1/encodings.txt with offspring configurations.
Continue until convergence (typically 100-120 simulations with current setup, ~4 generations).
python create_dataset.pyThis consolidates all generation results into a single CSV file, removing duplicates.
# Plot Pareto front
python plot_pareto.py --dataset your_dataset.csv
# Compare two datasets
python plot_pareto_diff.py --dataset1 dd_dataset.csv --dataset2 dt_dataset.csv
# Visualize search space coverage
python plot_search_space.py --dataset1 ga_dataset.csv --dataset2 uniform_dataset.csvshield4fusion/— Main package codeshielding_cabinets/— GA optimization scriptsdataset/— Pre-computed datasetstemplate_parametric.py— OpenMC simulation templatematerial_library.py— Material definitions
tests/— Unit testsdocs/— Documentation and paperREADME.md,setup.py,pyproject.toml— Project metadata
- For Inverse Design (query only):
- numpy
- pandas
- For Dataset Generation (full GA):
- OpenMC
- numpy
- pandas
- matplotlib
- seaborn
Contributions are welcome! Please submit issues or pull requests.
MIT
If you use Shield4Fusion in your research, please cite:
Di Giacomo, M. et al. (2026). Shield for Fusion (S4F): A Proof-of-Concept Neutronics Genetic Algorithm Optimization of Shielding Cabinets for Fusion Applications. GitHub repository.
https://github.com/digiacomo4/shield4fusion
Matteo Di Giacomo