https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MeshDivisionAux.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 "MeshDivisionAux.h"
11#include "MeshDivision.h"
12
14
17{
20 "Returns the value of the mesh division index for each element / node");
21 params.addRequiredParam<MeshDivisionName>("mesh_division",
22 "The mesh division providing the value");
23 params.addParam<int>(
24 "output_invalid_value_as", -1, "Convert the invalid value index for output purposes");
25 return params;
26}
27
29 : AuxKernel(parameters),
30 _mesh_division(
31 _c_fe_problem.getMeshDivision(getParam<MeshDivisionName>("mesh_division"), _tid)),
32 _invalid_bin_value(getParam<int>("output_invalid_value_as"))
33{
34 // Check family types for reasonable choices
35 if (!_var.isNodal() && _var.feType().order != CONSTANT)
36 paramError("Variable order " + Moose::stringify(_var.feType().order) + " unsupported");
37}
38
39Real
registerMooseObject("MooseApp", MeshDivisionAux)
void ErrorVector unsigned int
bool isNodal() const
Nodal or elemental kernel?
Definition AuxKernel.h:43
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
Definition AuxKernel.h:133
const Node *const & _current_node
Current node (valid only for nodal kernels)
Definition AuxKernel.h:143
MooseVariableField< Real > & _var
This is a regular kernel so we cast to a regular MooseVariable, hides base _var.
Definition AuxKernel.h:113
static InputParameters validParams()
Definition AuxKernel.C:27
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
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...
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.
Returns the index of the mesh division for each element / node.
const MeshDivision & _mesh_division
Mesh division to evaluate.
static InputParameters validParams()
const int _invalid_bin_value
Number to use for the invalid value.
MeshDivisionAux(const InputParameters &parameters)
virtual Real computeValue() override
Compute and return the value of the aux variable.
virtual unsigned int divisionIndex(const Point &pt) const =0
Return the index of the division to which the point belongs.
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457
const libMesh::FEType & feType() const
Get the type of finite element object.
virtual bool isNodal() const
Is this variable nodal.
virtual const OutputTools< T >::VariableValue & value()
The value of the variable this object is operating on.
OrderWrapper order
unsigned int INVALID_DIVISION_INDEX
Invalid subdomain id to return when outside the mesh division.
std::string stringify(const T &t)
conversion to string
Definition Conversion.h:64