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