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 "RelativeSolutionDifferenceNorm.h" 11 : #include "TransientBase.h" 12 : 13 : registerMooseObject("MooseApp", RelativeSolutionDifferenceNorm); 14 : 15 : InputParameters 16 14289 : RelativeSolutionDifferenceNorm::validParams() 17 : { 18 14289 : InputParameters params = GeneralPostprocessor::validParams(); 19 : 20 14289 : params.addClassDescription( 21 : "Computes the relative norm of the solution difference of two consecutive time steps."); 22 : 23 14289 : return params; 24 0 : } 25 : 26 12 : RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(const InputParameters & params) 27 12 : : GeneralPostprocessor(params), _trex(dynamic_cast<TransientBase *>(_app.getExecutioner())) 28 : { 29 12 : if (!_trex) 30 0 : mooseError("RelativeSolutionDifferenceNorm postprocessor is only for transient calculations"); 31 12 : } 32 : 33 : Real 34 22 : RelativeSolutionDifferenceNorm::getValue() const 35 : { 36 22 : return _trex->relativeSolutionDifferenceNorm(); 37 : }