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_NEK_COUPLING 20 : 21 : #include "AddScalarTransferAction.h" 22 : #include "NekRSProblem.h" 23 : #include "ScalarTransferBase.h" 24 : 25 : registerMooseAction("CardinalApp", AddScalarTransferAction, "add_scalar_transfers"); 26 : 27 : InputParameters 28 49 : AddScalarTransferAction::validParams() 29 : { 30 49 : auto params = MooseObjectAction::validParams(); 31 49 : params.addClassDescription( 32 : "Adds a scalar transfer (a single number) for coupling NeKRS to MOOSE"); 33 49 : return params; 34 0 : } 35 : 36 49 : AddScalarTransferAction::AddScalarTransferAction(const InputParameters & parameters) 37 49 : : MooseObjectAction(parameters) 38 : { 39 49 : } 40 : 41 : void 42 46 : AddScalarTransferAction::act() 43 : { 44 46 : if (_current_task == "add_scalar_transfers") 45 : { 46 46 : auto nek_problem = dynamic_cast<NekRSProblem *>(_problem.get()); 47 : 48 46 : if (!nek_problem) 49 1 : mooseError("The [ScalarTransfers] block can only be used with wrapped Nek cases! " 50 : "You need to change the [Problem] block to 'NekRSProblem'."); 51 : 52 45 : _moose_object_pars.set<NekRSProblem *>("_nek_problem") = nek_problem; 53 88 : nek_problem->addObject<ScalarTransferBase>(_type, _name, _moose_object_pars, false); 54 : } 55 43 : } 56 : #endif