Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* Swift, a Fourier spectral solver for MOOSE */ 4 : /* */ 5 : /* Copyright 2024 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "AddLBMStencilAction.h" 10 : #include "LatticeBoltzmannProblem.h" 11 : 12 : registerMooseAction("SwiftApp", AddLBMStencilAction, "add_stencil"); 13 : 14 : InputParameters 15 0 : AddLBMStencilAction::validParams() 16 : { 17 0 : InputParameters params = MooseObjectAction::validParams(); 18 0 : params.addClassDescription("Add LBM stencil object to the simulation."); 19 0 : return params; 20 0 : } 21 : 22 0 : AddLBMStencilAction::AddLBMStencilAction(const InputParameters & parameters) 23 0 : : MooseObjectAction(parameters) 24 : { 25 0 : } 26 : 27 : void 28 0 : AddLBMStencilAction::act() 29 : { 30 0 : auto lb_problem = std::dynamic_pointer_cast<LatticeBoltzmannProblem>(_problem); 31 0 : if (!lb_problem) 32 0 : mooseError( 33 : "LBM Stencils are only supported if the problem class is set to `LatticeBoltzmannProblem`"); 34 : 35 0 : if (_current_task == "add_stencil") 36 0 : lb_problem->addStencil(_type, _name, _moose_object_pars); 37 0 : }