www.mooseframework.org
AnalyticalIndicator.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "AnalyticalIndicator.h"
16 #include "Function.h"
17 
18 template <>
21 {
23  params.addRequiredParam<FunctionName>("function", "The analytic solution to compare against");
24  return params;
25 }
26 
28  : ElementIntegralIndicator(parameters), _func(getFunction("function"))
29 {
30 }
31 
32 Real
34 {
35  Real diff = _u[_qp] - _func.value(_t, _q_point[_qp]);
36  return diff * diff;
37 }
AnalyticalIndicator(const InputParameters &parameters)
virtual Real value(Real t, const Point &p)
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:43
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeQpIntegral() override
InputParameters validParams< AnalyticalIndicator >()
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
unsigned int _qp
const MooseArray< Point > & _q_point
const VariableValue & _u
Holds the solution at current quadrature points.
InputParameters validParams< ElementIntegralIndicator >()