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 "AddModelModifiersAction.h" 22 : #include "OpenMCCellAverageProblem.h" 23 : #include "ModelModifiersBase.h" 24 : 25 : registerMooseAction("CardinalApp", AddModelModifiersAction, "add_model_modifiers"); 26 : 27 : InputParameters 28 34 : AddModelModifiersAction::validParams() 29 : { 30 34 : auto params = MooseObjectAction::validParams(); 31 34 : params.addClassDescription("Adds a modifier that changes the OpenMC model prior to execution"); 32 34 : return params; 33 0 : } 34 : 35 34 : AddModelModifiersAction::AddModelModifiersAction(const InputParameters & parameters) 36 34 : : MooseObjectAction(parameters) 37 : { 38 34 : } 39 : 40 : void 41 34 : AddModelModifiersAction::act() 42 : { 43 34 : if (_current_task == "add_model_modifiers") 44 : { 45 34 : auto openmc_problem = dynamic_cast<OpenMCCellAverageProblem *>(_problem.get()); 46 : 47 34 : if (!openmc_problem) 48 2 : mooseError("The [ModelModifiers] block can only be used with wrapped OpenMC cases! " 49 : "You need to change the [Problem] block to 'OpenMCCellAverageProblem'."); 50 : 51 56 : openmc_problem->addObject<ModelModifiersBase>(_type, _name, _moose_object_pars, false); 52 : } 53 24 : } 54 : #endif