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 "VectorVariableMagnitudeAux.h" 11 : 12 : registerMooseObject("MooseApp", VectorVariableMagnitudeAux); 13 : 14 : InputParameters 15 14340 : VectorVariableMagnitudeAux::validParams() 16 : { 17 14340 : InputParameters params = AuxKernel::validParams(); 18 14340 : params.addClassDescription("Creates a field consisting of the magnitude of a " 19 : "coupled vector variable."); 20 14340 : params.addRequiredCoupledVar("vector_variable", 21 : "The variable from which to compute the component"); 22 14340 : return params; 23 0 : } 24 : 25 39 : VectorVariableMagnitudeAux::VectorVariableMagnitudeAux(const InputParameters & parameters) 26 39 : : AuxKernel(parameters), _variable_value(coupledVectorValue("vector_variable")) 27 : { 28 39 : } 29 : 30 : Real 31 71712 : VectorVariableMagnitudeAux::computeValue() 32 : { 33 71712 : return std::sqrt(Utility::pow<2>(_variable_value[_qp](0)) + 34 71712 : Utility::pow<2>(_variable_value[_qp](1)) + 35 71712 : Utility::pow<2>(_variable_value[_qp](2))); 36 : }