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 : #include "AddFilterAction.h" 21 : 22 : #include "OpenMCCellAverageProblem.h" 23 : 24 : registerMooseAction("CardinalApp", AddFilterAction, "add_filters"); 25 : 26 : InputParameters 27 400 : AddFilterAction::validParams() 28 : { 29 400 : auto params = MooseObjectAction::validParams(); 30 400 : params.addClassDescription("Adds filter(s) for use in simulations containing an " 31 : "OpenMCCellAverageProblem."); 32 : 33 400 : return params; 34 0 : } 35 : 36 400 : AddFilterAction::AddFilterAction(const InputParameters & parameters) : MooseObjectAction(parameters) 37 : { 38 400 : } 39 : 40 : void 41 400 : AddFilterAction::act() 42 : { 43 400 : if (_current_task == "add_filters") 44 : { 45 400 : auto openmc_problem = dynamic_cast<OpenMCCellAverageProblem *>(_problem.get()); 46 400 : if (!openmc_problem) 47 2 : mooseError( 48 : "The simulation must use an OpenMCCellAverageProblem when using the filter system!"); 49 : 50 398 : _moose_object_pars.set<OpenMCCellAverageProblem *>("_openmc_problem") = openmc_problem; 51 398 : openmc_problem->addFilter(_type, _name, _moose_object_pars); 52 : } 53 368 : } 54 : #endif