www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FeatureFloodCountAux Class Reference

Function auxiliary value. More...

#include <FeatureFloodCountAux.h>

Inheritance diagram for FeatureFloodCountAux:
[legend]

Public Member Functions

 FeatureFloodCountAux (const InputParameters &parameters)
 Factory constructor, takes parameters so that all derived classes can be built using the same constructor. More...
 
virtual ~FeatureFloodCountAux ()
 

Protected Member Functions

virtual Real computeValue ()
 
virtual void precalculateValue ()
 

Protected Attributes

const FeatureFloodCount_flood_counter
 Function being used to compute the value of this kernel. More...
 
const std::size_t _var_idx
 
const MooseEnum _field_display
 
bool _var_coloring
 
const FeatureFloodCount::FieldType _field_type
 
Real _value
 precalculated element value More...
 

Detailed Description

Function auxiliary value.

Definition at line 26 of file FeatureFloodCountAux.h.

Constructor & Destructor Documentation

◆ FeatureFloodCountAux()

FeatureFloodCountAux::FeatureFloodCountAux ( const InputParameters &  parameters)

Factory constructor, takes parameters so that all derived classes can be built using the same constructor.

Definition at line 47 of file FeatureFloodCountAux.C.

48  : AuxKernel(parameters),
49  _flood_counter(getUserObject<FeatureFloodCount>("flood_counter")),
50  _var_idx(isParamValid("map_index") ? getParam<unsigned int>("map_index")
51  : std::numeric_limits<std::size_t>::max()),
52  _field_display(getParam<MooseEnum>("field_display")),
53  _var_coloring(_field_display == "VARIABLE_COLORING"),
55 {
56  if (_flood_counter.isElemental() == isNodal() &&
57  (_field_display == "UNIQUE_REGION" || _field_display == "VARIABLE_COLORING" ||
58  _field_display == "GHOSTED_ENTITIES" || _field_display == "HALOS"))
59  mooseError("UNIQUE_REGION, VARIABLE_COLORING, GHOSTED_ENTITIES and HALOS must be on variable "
60  "types that match the entity mode of the FeatureFloodCounter");
61 
62  if (isNodal())
63  {
64  if (_field_display == "ACTIVE_BOUNDS")
65  mooseError("ACTIVE_BOUNDS is only available for elemental aux variables");
66 
67  if (_field_display == "CENTROID")
68  mooseError("CENTROID is only available for elemental aux variables");
69  }
70 }
const MooseEnum _field_display
const std::size_t _var_idx
const FeatureFloodCount::FieldType _field_type
const FeatureFloodCount & _flood_counter
Function being used to compute the value of this kernel.
bool isElemental() const

◆ ~FeatureFloodCountAux()

virtual FeatureFloodCountAux::~FeatureFloodCountAux ( )
inlinevirtual

Definition at line 35 of file FeatureFloodCountAux.h.

35 {}

Member Function Documentation

◆ computeValue()

Real FeatureFloodCountAux::computeValue ( )
protectedvirtual

Definition at line 101 of file FeatureFloodCountAux.C.

102 {
103  return _value;
104 }
Real _value
precalculated element value

◆ precalculateValue()

void FeatureFloodCountAux::precalculateValue ( )
protectedvirtual

Definition at line 73 of file FeatureFloodCountAux.C.

74 {
75  switch (_field_display)
76  {
77  case 0: // UNIQUE_REGION
78  case 1: // VARIABLE_COLORING
79  case 2: // GHOSTED_ENTITIES
80  case 3: // HALOS
81  case 4: // CENTROID
83  (isNodal() ? _current_node->id() : _current_elem->id()), _field_type, _var_idx);
84  break;
85  case 5: // ACTIVE_BOUNDS
86  {
87  const auto & var_to_features = _flood_counter.getVarToFeatureVector(_current_elem->id());
88  _value = std::count_if(
89  var_to_features.begin(), var_to_features.end(), [](unsigned int feature_id) {
90  return feature_id != FeatureFloodCount::invalid_id;
91  });
92 
93  break;
94  }
95  default:
96  mooseError("Unimplemented \"field_display\" type");
97  }
98 }
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const
Returns a list of active unique feature ids for a particular element.
const MooseEnum _field_display
Real _value
precalculated element value
const std::size_t _var_idx
const FeatureFloodCount::FieldType _field_type
static const unsigned int invalid_id
const FeatureFloodCount & _flood_counter
Function being used to compute the value of this kernel.
virtual Real getEntityValue(dof_id_type entity_id, FieldType field_type, std::size_t var_index=0) const

Member Data Documentation

◆ _field_display

const MooseEnum FeatureFloodCountAux::_field_display
protected

Definition at line 45 of file FeatureFloodCountAux.h.

Referenced by FeatureFloodCountAux(), and precalculateValue().

◆ _field_type

const FeatureFloodCount::FieldType FeatureFloodCountAux::_field_type
protected

Definition at line 48 of file FeatureFloodCountAux.h.

Referenced by precalculateValue().

◆ _flood_counter

const FeatureFloodCount& FeatureFloodCountAux::_flood_counter
protected

Function being used to compute the value of this kernel.

Definition at line 42 of file FeatureFloodCountAux.h.

Referenced by FeatureFloodCountAux(), and precalculateValue().

◆ _value

Real FeatureFloodCountAux::_value
protected

precalculated element value

Definition at line 51 of file FeatureFloodCountAux.h.

Referenced by computeValue(), and precalculateValue().

◆ _var_coloring

bool FeatureFloodCountAux::_var_coloring
protected

Definition at line 46 of file FeatureFloodCountAux.h.

◆ _var_idx

const std::size_t FeatureFloodCountAux::_var_idx
protected

Definition at line 44 of file FeatureFloodCountAux.h.

Referenced by precalculateValue().


The documentation for this class was generated from the following files: