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 140 : SolutionChangeNorm::validParams() 12 : { 13 140 : InputParameters params = ElementIntegralPostprocessor::validParams(); 14 140 : params.addClassDescription( 15 : "This class computes the solution change (L2) norm of selected variables."); 16 280 : params.addRequiredCoupledVar("variable", 17 : "The names of the variables that this object operates on"); 18 140 : return params; 19 0 : } 20 : 21 1 : SolutionChangeNorm::SolutionChangeNorm(const InputParameters & parameters) 22 : : ElementIntegralPostprocessor(parameters), 23 1 : _us(coupledValues("variable")), 24 2 : _us_old(coupledValuesOld("variable")) 25 : { 26 1 : } 27 : 28 : Real 29 39 : SolutionChangeNorm::getValue() const 30 : { 31 39 : return std::sqrt(ElementIntegralPostprocessor::getValue()); 32 : } 33 : 34 : Real 35 1560000 : SolutionChangeNorm::computeQpIntegral() 36 : { 37 : Real value = 0; 38 3120000 : for (unsigned int i = 0; i < _us.size(); i++) 39 1560000 : value += MathUtils::pow((*_us[i])[_qp] - (*_us_old[i])[_qp], 2); 40 1560000 : return value; 41 : }