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 "AddTensorOutputAction.h" 10 : #include "TensorProblem.h" 11 : 12 : registerMooseAction("SwiftApp", AddTensorOutputAction, "add_tensor_output"); 13 : 14 : InputParameters 15 12 : AddTensorOutputAction::validParams() 16 : { 17 12 : InputParameters params = MooseObjectAction::validParams(); 18 12 : params.addClassDescription("Add an TensorOutput object to the simulation."); 19 12 : return params; 20 0 : } 21 : 22 12 : AddTensorOutputAction::AddTensorOutputAction(const InputParameters & parameters) 23 12 : : MooseObjectAction(parameters) 24 : { 25 12 : } 26 : 27 : void 28 12 : AddTensorOutputAction::act() 29 : { 30 12 : auto tensor_problem = std::dynamic_pointer_cast<TensorProblem>(_problem); 31 12 : if (!tensor_problem) 32 0 : mooseError("Tensor objects are only supported if the problem class is set to `TensorProblem`"); 33 : 34 12 : tensor_problem->addTensorOutput(_type, _name, _moose_object_pars); 35 10 : }