https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ErrorToleranceMarker.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
12#include "libmesh/error_vector.h"
13
15
18{
20 params.addParam<Real>("coarsen", 0, "Elements with error less than this will be coarsened.");
21 params.addParam<Real>("refine",
22 std::numeric_limits<Real>::max(),
23 "Elements with error more than this will be refined.");
24 params.addClassDescription("Coarsen or refine elements based on an absolute tolerance allowed "
25 "from the supplied indicator.");
26 return params;
27}
28
30 : IndicatorMarker(parameters),
31 _coarsen(parameters.get<Real>("coarsen")),
32 _refine(parameters.get<Real>("refine"))
33{
34}
35
38{
39 Real error = _error_vector[_current_elem->id()];
40
41 if (error > _refine)
42 return REFINE;
43 else if (error < _coarsen)
44 return COARSEN;
45
46 return DO_NOTHING;
47}
registerMooseObject("MooseApp", ErrorToleranceMarker)
ErrorToleranceMarker(const InputParameters &parameters)
virtual MarkerValue computeElementMarker() override
static InputParameters validParams()
ErrorVector & _error_vector
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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.
const Elem *const & _current_elem
Pointer to the current element being considered in the marker element-based loop.
Definition Marker.h:122
MarkerValue
This mirrors the main refinement flag values in libMesh in Elem::RefinementState but adds "dont_mark"...
Definition Marker.h:60
@ REFINE
Definition Marker.h:64
@ DO_NOTHING
Definition Marker.h:63
@ COARSEN
Definition Marker.h:62