www.mooseframework.org
ComboMarker.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 "ComboMarker.h"
16 
17 template <>
20 {
22  params.addRequiredParam<std::vector<MarkerName>>(
23  "markers", "A list of marker names to combine into a single marker.");
24  params.addClassDescription("A marker that converts many markers into a single marker by "
25  "considering the maximum value of the listed markers (i.e., "
26  "refinement takes precedent).");
27  return params;
28 }
29 
31  : Marker(parameters), _names(parameters.get<std::vector<MarkerName>>("markers"))
32 {
33  for (const auto & marker_name : _names)
34  _markers.push_back(&getMarkerValue(marker_name));
35 }
36 
39 {
40  // We start with DONT_MARK because it's -1
41  MarkerValue marker_value = DONT_MARK;
42 
43  for (const auto & var : _markers)
44  marker_value = std::max(marker_value, static_cast<MarkerValue>((*var)[0]));
45 
46  return marker_value;
47 }
InputParameters validParams< Marker >()
Definition: Marker.C:25
virtual MarkerValue computeElementMarker() override
Definition: ComboMarker.C:38
InputParameters validParams< ComboMarker >()
Combines multiple marker fields.
Definition: ComboMarker.C:19
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
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...
std::vector< MarkerName > _names
Definition: ComboMarker.h:36
ComboMarker(const InputParameters &parameters)
Definition: ComboMarker.C:30
std::vector< const VariableValue * > _markers
Definition: ComboMarker.h:38
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 VariableValue & getMarkerValue(std::string name)
This is used to get the values of other Markers.
Definition: Marker.C:93