https://mooseframework.inl.gov
ElementQualityAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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),
32  _metric_type(getParam<MooseEnum>("metric").getEnum<libMesh::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.
libMesh::ElemQuality _metric_type
The metric type to use.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
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:33
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.
static MooseEnum QualityMetricType()
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:267
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
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:36
bool isNodal() const
Nodal or elemental kernel?
Definition: AuxKernel.h:86