www.mooseframework.org
ElementLengthAux.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 // MOOSE includes
16 #include "ElementLengthAux.h"
17 #include "MooseMesh.h"
18 
19 template <>
22 {
24  params.addRequiredParam(
25  "method", MooseEnum("min max"), "The size calculation to perform ('min' or 'max').");
26  params.addClassDescription(
27  "Compute the element size using Elem::hmin() or Elem::hmax() from libMesh.");
28  return params;
29 }
30 
32  : AuxKernel(parameters), _use_min(getParam<MooseEnum>("method") == "min")
33 {
34 }
35 
36 Real
38 {
39  if (_use_min)
40  return _current_elem->hmin();
41  return _current_elem->hmax();
42 }
ElementLengthAux(const InputParameters &parameters)
virtual Real computeValue() override
Returns the min/max of the current element.
const Elem *& _current_elem
Current element (valid only for elemental kernels)
Definition: AuxKernel.h:176
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:30
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:51
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
InputParameters validParams< ElementLengthAux >()
const bool _use_min
The type of calculation to perform min or max.