www.mooseframework.org
src
postprocessors
RelativeSolutionDifferenceNorm.C
Go to the documentation of this file.
1
//* This file is part of the MOOSE framework
2
//* https://www.mooseframework.org
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 "
Transient.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
return
params;
24
}
25
26
RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm
(
const
InputParameters
& params)
27
:
GeneralPostprocessor
(params), _trex(dynamic_cast<
Transient
*>(_app.getExecutioner()))
28
{
29
if
(!
_trex
)
30
mooseError
(
"RelativeSolutionDifferenceNorm postprocessor is only for transient calculations"
);
31
}
32
33
Real
34
RelativeSolutionDifferenceNorm::getValue
()
const
35
{
36
return
_trex
->
relativeSolutionDifferenceNorm
();
37
}
Transient
Transient executioners usually loop through a number of timesteps...
Definition:
Transient.h:26
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Definition:
InputParameters.h:48
GeneralPostprocessor
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
Definition:
GeneralPostprocessor.h:21
Transient.h
GeneralPostprocessor::validParams
static InputParameters validParams()
Definition:
GeneralPostprocessor.C:13
RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm
RelativeSolutionDifferenceNorm(const InputParameters ¶meters)
Class constructor.
Definition:
RelativeSolutionDifferenceNorm.C:26
RelativeSolutionDifferenceNorm
Gets the relative solution norm from the transient executioner.
Definition:
RelativeSolutionDifferenceNorm.h:19
RelativeSolutionDifferenceNorm.h
registerMooseObject
registerMooseObject("MooseApp", RelativeSolutionDifferenceNorm)
RelativeSolutionDifferenceNorm::getValue
virtual Real getValue() const override
Returns the relative solution norm taken from the transient executioner.
Definition:
RelativeSolutionDifferenceNorm.C:34
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RelativeSolutionDifferenceNorm::_trex
Transient * _trex
Transient executioner.
Definition:
RelativeSolutionDifferenceNorm.h:46
Transient::relativeSolutionDifferenceNorm
virtual Real relativeSolutionDifferenceNorm()
The relative L2 norm of the difference between solution and old solution vector.
Definition:
Transient.C:717
MooseBaseErrorInterface::mooseError
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
Definition:
MooseBaseErrorInterface.h:38
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:76
Generated on Mon Mar 18 2024 22:58:51 for www.mooseframework.org by
1.8.14