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 23 of file FeatureFloodCountAux.h.

Constructor & Destructor Documentation

FeatureFloodCountAux::FeatureFloodCountAux ( const InputParameters &  parameters)

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

Definition at line 44 of file FeatureFloodCountAux.C.

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

Definition at line 32 of file FeatureFloodCountAux.h.

32 {}

Member Function Documentation

Real FeatureFloodCountAux::computeValue ( )
protectedvirtual

Definition at line 98 of file FeatureFloodCountAux.C.

Referenced by ~FeatureFloodCountAux().

99 {
100  return _value;
101 }
Real _value
precalculated element value
void FeatureFloodCountAux::precalculateValue ( )
protectedvirtual

Definition at line 70 of file FeatureFloodCountAux.C.

Referenced by ~FeatureFloodCountAux().

71 {
72  switch (_field_display)
73  {
74  case 0: // UNIQUE_REGION
75  case 1: // VARIABLE_COLORING
76  case 2: // GHOSTED_ENTITIES
77  case 3: // HALOS
78  case 4: // CENTROID
80  (isNodal() ? _current_node->id() : _current_elem->id()), _field_type, _var_idx);
81  break;
82  case 5: // ACTIVE_BOUNDS
83  {
84  const auto & var_to_features = _flood_counter.getVarToFeatureVector(_current_elem->id());
85  _value = std::count_if(
86  var_to_features.begin(), var_to_features.end(), [](unsigned int feature_id) {
87  return feature_id != FeatureFloodCount::invalid_id;
88  });
89 
90  break;
91  }
92  default:
93  mooseError("Unimplemented \"field_display\" type");
94  }
95 }
virtual Real getEntityValue(dof_id_type entity_id, FieldType field_type, std::size_t var_index=0) const
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
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 FeatureFloodCount & _flood_counter
Function being used to compute the value of this kernel.

Member Data Documentation

const MooseEnum FeatureFloodCountAux::_field_display
protected

Definition at line 42 of file FeatureFloodCountAux.h.

Referenced by FeatureFloodCountAux(), and precalculateValue().

const FeatureFloodCount::FieldType FeatureFloodCountAux::_field_type
protected

Definition at line 45 of file FeatureFloodCountAux.h.

Referenced by precalculateValue().

const FeatureFloodCount& FeatureFloodCountAux::_flood_counter
protected

Function being used to compute the value of this kernel.

Definition at line 39 of file FeatureFloodCountAux.h.

Referenced by FeatureFloodCountAux(), and precalculateValue().

Real FeatureFloodCountAux::_value
protected

precalculated element value

Definition at line 48 of file FeatureFloodCountAux.h.

Referenced by computeValue(), and precalculateValue().

bool FeatureFloodCountAux::_var_coloring
protected

Definition at line 43 of file FeatureFloodCountAux.h.

const std::size_t FeatureFloodCountAux::_var_idx
protected

Definition at line 41 of file FeatureFloodCountAux.h.

Referenced by precalculateValue().


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