https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RelativeSolutionDifferenceNorm.C
Go to the documentation of this file.
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
11#include "TransientBase.h"
12
14
17{
19
21 "Computes the relative norm of the solution difference of two consecutive time steps.");
22
23 params.addParam<bool>(
24 "use_aux",
25 "If true, use the auxiliary system variables for the norm instead of the solution variables. "
26 "If false, use the solution system variables only. If not provided, the executioner's value "
27 "for the 'check_aux' parameter is used.");
28
29 return params;
30}
31
33 : GeneralPostprocessor(params),
34 _trex(dynamic_cast<TransientBase *>(_app.getExecutioner())),
35 _use_aux(isParamValid("use_aux") ? getParam<bool>("use_aux")
36 : _trex->getParam<bool>("check_aux"))
37{
38 if (!_trex)
39 mooseError("RelativeSolutionDifferenceNorm postprocessor is only for transient calculations");
40}
41
42Real
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
registerMooseObject("MooseApp", RelativeSolutionDifferenceNorm)
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Gets the relative solution norm from the transient executioner.
const bool _use_aux
Whether to use the aux system variables for the norm instead of the solution variables.
virtual Real getValue() const override
Returns the relative solution norm taken from the transient executioner.
RelativeSolutionDifferenceNorm(const InputParameters &parameters)
Class constructor.
TransientBase * _trex
Transient executioner.
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
virtual Real relativeSolutionDifferenceNorm(bool check_aux) const =0
The relative L2 norm of the difference between solution and old solution vector.