www.mooseframework.org
ErrorToleranceMarker.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 "ErrorToleranceMarker.h"
16 
17 #include "libmesh/error_vector.h"
18 
19 template <>
22 {
24  params.addParam<Real>("coarsen", 0, "Elements with error less than this will be coarsened.");
25  params.addParam<Real>("refine",
26  std::numeric_limits<Real>::max(),
27  "Elements with error more than this will be refined.");
28  params.addClassDescription("Coarsen or refine elements based on an absolute tolerance allowed "
29  "from the supplied indicator.");
30  return params;
31 }
32 
34  : IndicatorMarker(parameters),
35  _coarsen(parameters.get<Real>("coarsen")),
36  _refine(parameters.get<Real>("refine"))
37 {
38 }
39 
42 {
43  Real error = _error_vector[_current_elem->id()];
44 
45  if (error > _refine)
46  return REFINE;
47  else if (error < _coarsen)
48  return COARSEN;
49 
50  return DO_NOTHING;
51 }
InputParameters validParams< ErrorToleranceMarker >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MarkerValue
This mirrors the main refinement flag values in libMesh in Elem::RefinementState but adds "dont_mark"...
Definition: Marker.h:58
virtual MarkerValue computeElementMarker() override
ErrorToleranceMarker(const InputParameters &parameters)
const Elem *& _current_elem
Definition: Marker.h:118
InputParameters validParams< IndicatorMarker >()
ErrorVector & _error_vector
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...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...