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 "ElementArrayL2Norm.h" 11 : 12 : registerMooseObject("MooseApp", ElementArrayL2Norm); 13 : 14 : InputParameters 15 14571 : ElementArrayL2Norm::validParams() 16 : { 17 14571 : InputParameters params = ElementIntegralArrayVariablePostprocessor::validParams(); 18 14571 : params.addClassDescription("Evaluates L2-norm of a component of an array variable"); 19 14571 : return params; 20 0 : } 21 : 22 159 : ElementArrayL2Norm::ElementArrayL2Norm(const InputParameters & parameters) 23 159 : : ElementIntegralArrayVariablePostprocessor(parameters) 24 : { 25 159 : } 26 : 27 : Real 28 132 : ElementArrayL2Norm::getValue() const 29 : { 30 132 : return std::sqrt(ElementIntegralArrayVariablePostprocessor::getValue()); 31 : } 32 : 33 : Real 34 6732 : ElementArrayL2Norm::computeQpIntegral() 35 : { 36 6732 : Real val = _u[_qp](_component); 37 6732 : return val * val; 38 : }