https://mooseframework.inl.gov
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 
20  params.addClassDescription(
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 
42 Real
44 {
46 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
RelativeSolutionDifferenceNorm(const InputParameters &parameters)
Class constructor.
Gets the relative solution norm from the transient executioner.
registerMooseObject("MooseApp", RelativeSolutionDifferenceNorm)
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
Definition: TransientBase.h:27
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.
virtual Real relativeSolutionDifferenceNorm(bool check_aux) const =0
The relative L2 norm of the difference between solution and old solution vector.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
TransientBase * _trex
Transient executioner.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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...
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...