www.mooseframework.org
MaterialTimeStepPostprocessor.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 #include "MooseVariable.h"
17 #include "SubProblem.h"
18 #include "MooseTypes.h"
19 
20 #include "libmesh/quadrature.h"
21 
22 #include <algorithm>
23 #include <limits>
24 
25 template <>
26 InputParameters
28 {
29  InputParameters params = validParams<ElementPostprocessor>();
30 
31  params.addClassDescription("This postprocessor estimates a timestep that reduces the increment "
32  "change in a aux variable below a given threshold.");
33 
34  return params;
35 }
36 
38  : ElementPostprocessor(parameters),
39  _matl_time_step(getMaterialPropertyByName<Real>("matl_timestep_limit"))
40 {
41 }
42 
43 void
45 {
46  _value = std::numeric_limits<Real>::max(); // start w/ the min
47 }
48 
49 void
51 {
52  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
53  _value = std::min(_value, _matl_time_step[_qp]);
54 }
55 
56 Real
58 {
59  gatherMin(_value);
60  return _value;
61 }
62 
63 void
65 {
66  const MaterialTimeStepPostprocessor & pps = static_cast<const MaterialTimeStepPostprocessor &>(y);
67  _value = std::min(_value, pps._value);
68 }
MaterialTimeStepPostprocessor(const InputParameters &parameters)
virtual void threadJoin(const UserObject &y)
const MaterialProperty< Real > & _matl_time_step
This postporocessor calculates an estimated timestep size that limits an auxiliary variable to below ...
InputParameters validParams< MaterialTimeStepPostprocessor >()