Line data Source code
1 : //* This file is part of the RACCOON application 2 : //* being developed at Dolbow lab at Duke University 3 : //* http://dolbow.pratt.duke.edu 4 : 5 : #include "SolutionChangeNorm.h" 6 : #include "MathUtils.h" 7 : 8 : registerMooseObject("raccoonApp", SolutionChangeNorm); 9 : 10 : InputParameters 11 136 : SolutionChangeNorm::validParams() 12 : { 13 136 : InputParameters params = ElementIntegralPostprocessor::validParams(); 14 136 : params.addClassDescription( 15 : "This class computes the solution change (L2) norm of selected variables."); 16 272 : params.addRequiredCoupledVar("variable", 17 : "The names of the variables that this object operates on"); 18 136 : return params; 19 0 : } 20 : 21 0 : SolutionChangeNorm::SolutionChangeNorm(const InputParameters & parameters) 22 : : ElementIntegralPostprocessor(parameters), 23 0 : _us(coupledValues("variable")), 24 0 : _us_old(coupledValuesOld("variable")) 25 : { 26 0 : } 27 : 28 : Real 29 0 : SolutionChangeNorm::getValue() const 30 : { 31 0 : return std::sqrt(ElementIntegralPostprocessor::getValue()); 32 : } 33 : 34 : Real 35 0 : SolutionChangeNorm::computeQpIntegral() 36 : { 37 : Real value = 0; 38 0 : for (unsigned int i = 0; i < _us.size(); i++) 39 0 : value += MathUtils::pow((*_us[i])[_qp] - (*_us_old[i])[_qp], 2); 40 0 : return value; 41 : }