https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ExtraElementIDAux.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 "ExtraElementIDAux.h"
11
13registerMooseObjectRenamed("MooseApp", ElemExtraIDAux, "01/30/2022 24:00", ExtraElementIDAux);
14
17{
19 params.addRequiredParam<std::vector<ExtraElementIDName>>("extra_id_name",
20 "The extra ID name in the mesh");
21 params.addClassDescription("Puts element extra IDs into an aux variable.");
22 return params;
23}
24
26 : AuxKernel(parameters), _id(getElementID("extra_id_name"))
27{
28 if (isNodal())
29 paramError("variable", "This AuxKernel only supports Elemental fields");
30}
31
32Real
34{
35 return (_id == DofObject::invalid_id) ? -1.0 : _id;
36}
registerMooseObjectRenamed("MooseApp", ElemExtraIDAux, "01/30/2022 24:00", ExtraElementIDAux)
registerMooseObject("MooseApp", ExtraElementIDAux)
bool isNodal() const
Nodal or elemental kernel?
Definition AuxKernel.h:43
static InputParameters validParams()
Definition AuxKernel.C:27
virtual Real computeValue() override
Compute and return the value of the aux variable.
const dof_id_type & _id
ExtraElementIDAux(const InputParameters &parameters)
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...
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.
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