https://mooseframework.inl.gov
src
postprocessors
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
10
#include "
RelativeSolutionDifferenceNorm.h
"
11
#include "
TransientBase.h
"
12
13
registerMooseObject
(
"MooseApp"
,
RelativeSolutionDifferenceNorm
);
14
15
InputParameters
16
RelativeSolutionDifferenceNorm::validParams
()
17
{
18
InputParameters
params =
GeneralPostprocessor::validParams
();
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
32
RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm
(
const
InputParameters
& params)
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
43
RelativeSolutionDifferenceNorm::getValue
()
const
44
{
45
return
_trex
->
relativeSolutionDifferenceNorm
(
_use_aux
);
46
}
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Definition:
InputParameters.h:66
GeneralPostprocessor
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
Definition:
GeneralPostprocessor.h:21
GeneralPostprocessor::validParams
static InputParameters validParams()
Definition:
GeneralPostprocessor.C:13
RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm
RelativeSolutionDifferenceNorm(const InputParameters ¶meters)
Class constructor.
Definition:
RelativeSolutionDifferenceNorm.C:32
RelativeSolutionDifferenceNorm
Gets the relative solution norm from the transient executioner.
Definition:
RelativeSolutionDifferenceNorm.h:19
RelativeSolutionDifferenceNorm.h
registerMooseObject
registerMooseObject("MooseApp", RelativeSolutionDifferenceNorm)
TransientBase
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
Definition:
TransientBase.h:27
RelativeSolutionDifferenceNorm::_use_aux
const bool _use_aux
Whether to use the aux system variables for the norm instead of the solution variables.
Definition:
RelativeSolutionDifferenceNorm.h:49
RelativeSolutionDifferenceNorm::getValue
virtual Real getValue() const override
Returns the relative solution norm taken from the transient executioner.
Definition:
RelativeSolutionDifferenceNorm.C:43
TransientBase::relativeSolutionDifferenceNorm
virtual Real relativeSolutionDifferenceNorm(bool check_aux) const =0
The relative L2 norm of the difference between solution and old solution vector.
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RelativeSolutionDifferenceNorm::_trex
TransientBase * _trex
Transient executioner.
Definition:
RelativeSolutionDifferenceNorm.h:46
TransientBase.h
MooseBaseErrorInterface::mooseError
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
Definition:
MooseBaseErrorInterface.h:29
RelativeSolutionDifferenceNorm::validParams
static InputParameters validParams()
Definition:
RelativeSolutionDifferenceNorm.C:16
InputParameters::addClassDescription
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...
Definition:
InputParameters.C:82
InputParameters::addParam
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...
Definition:
InputParameters.h:1654
Generated on Sat Aug 2 2025 20:05:30 for https://mooseframework.inl.gov by
1.8.14