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 
16 template <>
19 {
21 
22  params.addClassDescription("Generates a field containing the quality metric for each element. "
23  "Useful for visualizing mesh quality.");
24 
26  "metric", ElementQualityChecker::QualityMetricType(), "The quality metric to use.");
27 
28  return params;
29 }
30 
32  : AuxKernel(parameters), _metric_type(getParam<MooseEnum>("metric").getEnum<ElemQuality>())
33 {
34  if (isNodal())
35  mooseError("ElementQualityAux only works on elemental fields.");
36 }
37 
38 Real
40 {
41  return _current_elem->quality(_metric_type);
42 }
Calculates element quality for each element.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
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)
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:25
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
bool isNodal()
Nodal or elemental kernel?
Definition: AuxKernel.h:84
virtual Real computeValue() override
Compute and return the value of the aux variable.
ElemQuality _metric_type
The metric type to use.
static MooseEnum QualityMetricType()
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
Definition: AuxKernel.h:203
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...
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:33
InputParameters validParams< ElementQualityAux >()