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 : #ifdef ENABLE_OPENMC_COUPLING 20 : 21 : #include "CellIDAux.h" 22 : 23 : registerMooseObject("CardinalApp", CellIDAux); 24 : 25 : InputParameters 26 3134 : CellIDAux::validParams() 27 : { 28 3134 : InputParameters params = OpenMCAuxKernel::validParams(); 29 3134 : params.addClassDescription("Display the OpenMC cell ID mapped to each MOOSE element"); 30 3134 : return params; 31 0 : } 32 : 33 1576 : CellIDAux::CellIDAux(const InputParameters & parameters) : OpenMCAuxKernel(parameters) {} 34 : 35 : Real 36 38376736 : CellIDAux::computeValue() 37 : { 38 : // if the element doesn't map to an OpenMC cell, return a cell ID of -1; otherwise, we would 39 : // get an error in the call to cellID, since it relies on a valid cell instance, index pair being 40 : // passed to OpenMC's C-API 41 38376736 : if (!mappedElement()) 42 : return OpenMCCellAverageProblem::UNMAPPED; 43 : 44 35211136 : return _openmc_problem->elemToCellID(_current_elem->id()); 45 : } 46 : 47 : #endif