www.mooseframework.org
AverageElementSize.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 "AverageElementSize.h"
16 
17 template <>
20 {
22  return params;
23 }
24 
26  : ElementAverageValue(parameters)
27 {
28 }
29 
30 void
32 {
34  _elems = 0;
35 }
36 
37 void
39 {
41  _elems++;
42 }
43 
44 Real
46 {
47  return _current_elem->hmax();
48 }
49 
50 Real
52 {
54 
56 
57  return integral / _elems;
58 }
59 
60 void
62 {
64  const AverageElementSize & pps = static_cast<const AverageElementSize &>(y);
65  _elems += pps._elems;
66 }
InputParameters validParams< AverageElementSize >()
This postprocessor computes an average element size (h) for the whole domain.
virtual Real getValue() override
This will get called to actually grab the final value the postprocessor has calculated.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real getValue() override
This will get called to actually grab the final value the postprocessor has calculated.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
AverageElementSize(const InputParameters &parameters)
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual Real computeIntegral() override
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Definition: UserObject.h:119
virtual void execute() override
Execute method.
virtual void threadJoin(const UserObject &y) override
Must override.
const Elem *& _current_elem
The current element pointer (available during execute())
InputParameters validParams< ElementAverageValue >()
This postprocessor computes a volume integral of the specified variable.
virtual void threadJoin(const UserObject &y) override
Must override.
Base class for user-specific data.
Definition: UserObject.h:42
virtual void execute() override
Execute method.