www.mooseframework.org
ElementIntegralVariableUserObject.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 
16 
17 template <>
20 {
22  params.addRequiredCoupledVar("variable", "The name of the variable that this object operates on");
23  return params;
24 }
25 
27  const InputParameters & parameters)
28  : ElementIntegralUserObject(parameters),
29  MooseVariableInterface(this, false),
30  _u(coupledValue("variable")),
31  _grad_u(coupledGradient("variable"))
32 {
34 }
35 
36 Real
38 {
39  return _u[_qp];
40 }
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...
void addMooseVariableDependency(MooseVariable *var)
Call this function to add the passed in MooseVariable as a variable that this object depends on...
MooseVariable * mooseVariable()
Get the variable that this object is using.
InputParameters validParams< ElementIntegralVariableUserObject >()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
ElementIntegralVariableUserObject(const InputParameters &parameters)
const VariableValue & _u
Holds the solution at current quadrature points.
Interface for objects that need to get values of MooseVariables.
InputParameters validParams< ElementIntegralUserObject >()