www.mooseframework.org
ElementQualityAux.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 "ElementQualityAux.h"
11 
12 #include "ElementQualityChecker.h"
13 
15 
18 {
20 
21  params.addClassDescription("Generates a field containing the quality metric for each element. "
22  "Useful for visualizing mesh quality.");
23 
25  "metric", ElementQualityChecker::QualityMetricType(), "The quality metric to use.");
26 
27  return params;
28 }
29 
31  : AuxKernel(parameters), _metric_type(getParam<MooseEnum>("metric").getEnum<ElemQuality>())
32 {
33  if (isNodal())
34  mooseError("ElementQualityAux only works on elemental fields.");
35 }
36 
37 Real
39 {
40  return _current_elem->quality(_metric_type);
41 }
Calculates element quality for each element.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
registerMooseObject("MooseApp", ElementQualityAux)
ElementQualityAux(const InputParameters &parameters)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
ElemQuality
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeValue() override
Compute and return the value of the aux variable.
ElemQuality _metric_type
The metric type to use.
static MooseEnum QualityMetricType()
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
Definition: AuxKernel.h:204
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...
static InputParameters validParams()
Definition: AuxKernel.C:27
bool isNodal() const
Nodal or elemental kernel?
Definition: AuxKernel.h:86