Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "AddSecondarySpeciesAction.h" 11 : #include "FEProblem.h" 12 : 13 : registerMooseAction("ChemicalReactionsApp", AddSecondarySpeciesAction, "add_aux_variable"); 14 : 15 : InputParameters 16 284 : AddSecondarySpeciesAction::validParams() 17 : { 18 284 : InputParameters params = AddAuxVariableAction::validParams(); 19 568 : params.addParam<std::vector<AuxVariableName>>("secondary_species", 20 : "The list of secondary species to add"); 21 284 : params.addClassDescription("Adds AuxVariables for all secondary species"); 22 284 : return params; 23 0 : } 24 : 25 284 : AddSecondarySpeciesAction::AddSecondarySpeciesAction(const InputParameters & params) 26 : : AddAuxVariableAction(params), 27 568 : _secondary_species(getParam<std::vector<AuxVariableName>>("secondary_species")) 28 : { 29 284 : } 30 : 31 : void 32 284 : AddSecondarySpeciesAction::act() 33 : { 34 284 : auto fe_type = AddVariableAction::feType(_pars); 35 284 : auto type = AddVariableAction::variableType(fe_type); 36 284 : auto var_params = _factory.getValidParams(type); 37 : 38 284 : var_params.applySpecificParameters(_pars, {"family", "order"}); 39 : 40 1072 : for (auto & secondary_specimen : _secondary_species) 41 788 : _problem->addAuxVariable(type, secondary_specimen, var_params); 42 568 : }