forked from idaholab/moose
/
ElementVariablePostprocessor.C
45 lines (41 loc) · 1.76 KB
/
ElementVariablePostprocessor.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#include "ElementVariablePostprocessor.h"
#include "MooseVariable.h"
#include "SubProblem.h"
#include "MooseTypes.h"
template<>
InputParameters validParams<ElementVariablePostprocessor>()
{
InputParameters params = validParams<ElementPostprocessor>();
params.addRequiredParam<VariableName>("variable", "The name of the variable that this postprocessor operates on");
return params;
}
ElementVariablePostprocessor::ElementVariablePostprocessor(const std::string & name, InputParameters parameters) :
ElementPostprocessor(name, parameters),
MooseVariableInterface(parameters, false),
_var(_subproblem.getVariable(_tid, parameters.get<VariableName>("variable"))),
_u(_var.sln()),
_grad_u(_var.gradSln()),
_u_dot(_var.uDot()),
_qp(0)
{
addMooseVariableDependency(mooseVariable());
}
void
ElementVariablePostprocessor::execute()
{
for (_qp=0; _qp<_qrule->n_points(); _qp++)
computeQpValue();
}