Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "GradientComponentAux.h" 10 : 11 : registerMooseObject("MagpieApp", GradientComponentAux); 12 : 13 : InputParameters 14 12 : GradientComponentAux::validParams() 15 : { 16 12 : InputParameters params = AuxKernel::validParams(); 17 12 : params.addClassDescription("Return specified component of the gradient of a coupled variable."); 18 24 : params.addRequiredCoupledVar("v", "Coupled variable to extract gradient component of"); 19 : 20 24 : params.addRequiredParam<unsigned int>("component", 21 : "Component of the gradient of the coupled variable v"); 22 12 : return params; 23 0 : } 24 : 25 6 : GradientComponentAux::GradientComponentAux(const InputParameters & parameters) 26 : : AuxKernel(parameters), 27 6 : _grad_v(coupledGradient("v")), 28 18 : _component(getParam<unsigned int>("component")) 29 : { 30 6 : if (_component >= LIBMESH_DIM) 31 0 : paramError("component", "Component too large for LIBMESH_DIM"); 32 6 : } 33 : 34 : Real 35 60000 : GradientComponentAux::computeValue() 36 : { 37 60000 : return _grad_v[_qp](_component); 38 : }