https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ElementL2Difference.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 "ElementL2Difference.h"
11#include "Function.h"
12
14
17{
19 params.addRequiredCoupledVar("other_variable", "The variable to compare to");
20
21 params.addClassDescription("Computes the element-wise L2 difference between the current variable "
22 "and a coupled variable.");
23 return params;
24}
25
27 : ElementIntegralVariablePostprocessor(parameters), _other_var(coupledValue("other_variable"))
28{
29}
30
31Real
36
37Real
39{
40 Real diff = _u[_qp] - _other_var[_qp];
41 return diff * diff;
42}
registerMooseObject("MooseApp", ElementL2Difference)
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
This postprocessor computes a volume integral of the specified variable.
const VariableValue & _u
Holds the solution at current quadrature points.
Computes the L2-Norm difference between two solution fields.
ElementL2Difference(const InputParameters &parameters)
const VariableValue & _other_var
The variable to compare to.
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual Real computeQpIntegral() override
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
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.