Cardinal
OpenMCCellMaterialFill.h
Go to the documentation of this file.
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 
27 {
28 public:
29  static InputParameters validParams();
30 
31  OpenMCCellMaterialFill(const InputParameters & parameters);
32 
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  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  const std::vector<int32_t> & getMaterialIndices() const { return _material_indices; }
51 
52 protected:
54  const int32_t & _cell_id;
55 
57  int32_t _cell_index;
58 
60  std::vector<int32_t> _material_indices;
61 
63  std::string _material_ids_file;
64 };
OpenMCCellMaterialFill(const InputParameters &parameters)
Definition: ModelModifiersBase.h:27
void extractMaterialIdsFromFile(std::string filename, std::vector< int32_t > &material_ids)
int32_t _cell_index
Index of the cell to be modified.
Definition: OpenMCCellMaterialFill.h:57
const int32_t & _cell_id
Cell to be modified.
Definition: OpenMCCellMaterialFill.h:54
const int32_t & getCellIndex() const
Definition: OpenMCCellMaterialFill.h:46
virtual void modifyOpenMCModel() const override
Modify the OpenMC model.
const std::vector< int32_t > & getMaterialIndices() const
Definition: OpenMCCellMaterialFill.h:50
std::vector< int32_t > _material_indices
Materials to be filled into the cell instances.
Definition: OpenMCCellMaterialFill.h:60
const int32_t & getCellId() const
Definition: OpenMCCellMaterialFill.h:43
std::string _material_ids_file
Name of a file containing material data to be assigned to _material_indices.
Definition: OpenMCCellMaterialFill.h:63
static InputParameters validParams()
Definition: OpenMCCellMaterialFill.h:26