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