www.mooseframework.org
OrientedBoxMarker.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 
23 #include "OrientedBoxMarker.h"
24 #include "OrientedBoxInterface.h"
25 
26 template <>
29 {
32 
33  MooseEnum marker_states = Marker::markerStates();
34 
35  params.addRequiredParam<MooseEnum>(
36  "inside", marker_states, "How to mark elements inside the box.");
37  params.addRequiredParam<MooseEnum>(
38  "outside", marker_states, "How to mark elements outside the box.");
39 
40  params.addClassDescription(
41  "Marks inside and outside a box that can have arbitrary orientation and center point.");
42  return params;
43 }
44 
46  : Marker(parameters),
47  OrientedBoxInterface(parameters),
48  _inside((MarkerValue)(int)parameters.get<MooseEnum>("inside")),
49  _outside((MarkerValue)(int)parameters.get<MooseEnum>("outside"))
50 {
51 }
52 
58 {
59  Point centroid = _current_elem->centroid();
60 
61  if (containsPoint(centroid))
62  return _inside;
63 
64  return _outside;
65 }
bool containsPoint(const Point &point)
Test if the supplied point is within the defined oriented bounding box.
InputParameters validParams< Marker >()
Definition: Marker.C:25
Definition: Marker.h:42
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
InputParameters validParams< OrientedBoxMarker >()
Creates a box of specified width, length and height, with its center at specified position...
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
virtual MarkerValue computeElementMarker() override
Marks elements inside and outside the box.
OrientedBoxMarker(const InputParameters &parameters)
InputParameters validParams< OrientedBoxInterface >()