Line data Source code
1 : /********************************************************************/ 2 : /* SOFTWARE COPYRIGHT NOTIFICATION */ 3 : /* Cardinal */ 4 : /* */ 5 : /* (c) 2021 UChicago Argonne, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by UChicago Argonne, LLC */ 9 : /* Under Contract No. DE-AC02-06CH11357 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* Prepared by Battelle Energy Alliance, LLC */ 13 : /* Under Contract No. DE-AC07-05ID14517 */ 14 : /* With the U. S. Department of Energy */ 15 : /* */ 16 : /* See LICENSE for full restrictions */ 17 : /********************************************************************/ 18 : 19 : #pragma once 20 : 21 : #include "ModelModifiersBase.h" 22 : 23 : /** 24 : * Modifies the material filling an OpenMC cell prior to execution 25 : */ 26 : class OpenMCCellMaterialFill : public ModelModifiersBase 27 : { 28 : public: 29 : static InputParameters validParams(); 30 : 31 : OpenMCCellMaterialFill(const InputParameters & parameters); 32 : 33 : /** 34 : * Read data from hdf5 file to assign to _material_indices 35 : * @param[in] filename filename 36 : * @param[out] material_ids passed by reference to assign 37 : */ 38 : void extractMaterialIdsFromFile(std::string filename, std::vector<int32_t> & material_ids); 39 : 40 : virtual void modifyOpenMCModel() const override; 41 : 42 : // Accessor for the cell ID asociated with the OpenMCCellMaterialFill ModelModifier 43 : const int32_t & getCellId() const { return _cell_id; } 44 : 45 : // Accessor for the cell index asociated with the OpenMCCellMaterialFill ModelModifier 46 32 : const int32_t & getCellIndex() const { return _cell_index; } 47 : 48 : // Accessor for the material indices corresponding the OpenMCCellMaterialFill ModelModifier that 49 : // will be applied to the cell 50 0 : const std::vector<int32_t> & getMaterialIndices() const { return _material_indices; } 51 : 52 : protected: 53 : /// Cell to be modified 54 : const int32_t & _cell_id; 55 : 56 : /// Index of the cell to be modified 57 : int32_t _cell_index; 58 : 59 : /// Materials to be filled into the cell instances 60 : std::vector<int32_t> _material_indices; 61 : 62 : /// Name of a file containing material data to be assigned to _material_indices 63 : std::string _material_ids_file; 64 : };