www.mooseframework.org
VariableInnerProduct.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 "VariableInnerProduct.h"
16 
17 template <>
20 {
22  params.addRequiredCoupledVar(
23  "second_variable",
24  "The name of the second variable in the inner product (variable, second_variable)");
25  return params;
26 }
27 
29  : ElementIntegralVariablePostprocessor(parameters), _v(coupledValue("second_variable"))
30 {
31 }
32 
33 Real
35 {
36  return _u[_qp] * _v[_qp];
37 }
VariableInnerProduct(const InputParameters &parameters)
This postprocessor computes a volume integral of the specified variable.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real computeQpIntegral() override
const VariableValue & _u
Holds the solution at current quadrature points.
InputParameters validParams< VariableInnerProduct >()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
InputParameters validParams< ElementIntegralVariablePostprocessor >()
const VariableValue & _v
Holds the values of second_variable at current quadrature points.