www.mooseframework.org
BoxMarker.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 "BoxMarker.h"
16 
17 template <>
20 {
23  "bottom_left", "The bottom left point (in x,y,z with spaces in-between).");
25  "top_right", "The bottom left point (in x,y,z with spaces in-between).");
26 
27  MooseEnum marker_states = Marker::markerStates();
28 
30  "inside", marker_states, "How to mark elements inside the box.");
32  "outside", marker_states, "How to mark elements outside the box.");
33 
34  params.addClassDescription(
35  "Marks the region inside and outside of a 'box' domain for refinement or coarsening.");
36  return params;
37 }
38 
40  : Marker(parameters),
41  _inside((MarkerValue)(int)parameters.get<MooseEnum>("inside")),
42  _outside((MarkerValue)(int)parameters.get<MooseEnum>("outside")),
43  _bounding_box(parameters.get<RealVectorValue>("bottom_left"),
44  parameters.get<RealVectorValue>("top_right"))
45 {
46 }
47 
50 {
51  RealVectorValue centroid = _current_elem->centroid();
52 
53  if (_bounding_box.contains_point(centroid))
54  return _inside;
55 
56  return _outside;
57 }
InputParameters validParams< Marker >()
Definition: Marker.C:25
VectorValue< Real > RealVectorValue
Definition: Assembly.h:40
MarkerValue _inside
Definition: BoxMarker.h:35
Definition: Marker.h:42
BoundingBox _bounding_box
Definition: BoxMarker.h:38
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
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...
const Elem *& _current_elem
Definition: Marker.h:118
static MooseEnum markerStates()
Helper function for getting the valid refinement flag states a marker can use as a MooseEnum...
Definition: Marker.C:72
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
MarkerValue _outside
Definition: BoxMarker.h:36
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...
BoxMarker(const InputParameters &parameters)
Definition: BoxMarker.C:39
InputParameters validParams< BoxMarker >()
Definition: BoxMarker.C:19
virtual MarkerValue computeElementMarker() override
Definition: BoxMarker.C:49