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 "ArrayVariableComponent.h" 11 : 12 : registerMooseObject("MooseApp", ArrayVariableComponent); 13 : 14 : InputParameters 15 14315 : ArrayVariableComponent::validParams() 16 : { 17 14315 : InputParameters params = AuxKernel::validParams(); 18 14315 : params.addRequiredCoupledVar("array_variable", "The name of the array variable"); 19 14315 : params.addParam<unsigned int>("component", 0, "Component of the array variable to be extracted"); 20 14315 : params.addClassDescription("Copy a component of an array variable."); 21 14315 : return params; 22 0 : } 23 : 24 26 : ArrayVariableComponent::ArrayVariableComponent(const InputParameters & parameters) 25 : : AuxKernel(parameters), 26 26 : _u(coupledArrayValue("array_variable")), 27 52 : _component(getParam<unsigned int>("component")) 28 : { 29 26 : } 30 : 31 : Real 32 2096 : ArrayVariableComponent::computeValue() 33 : { 34 2096 : return _u[_qp](_component); 35 : }