Line data Source code
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 : 12 : registerMooseObject("MooseApp", ExtraElementIDAux); 13 : registerMooseObjectRenamed("MooseApp", ElemExtraIDAux, "01/30/2022 24:00", ExtraElementIDAux); 14 : 15 : InputParameters 16 28939 : ExtraElementIDAux::validParams() 17 : { 18 28939 : InputParameters params = AuxKernel::validParams(); 19 28939 : params.addRequiredParam<std::vector<ExtraElementIDName>>("extra_id_name", 20 : "The extra ID name in the mesh"); 21 28939 : params.addClassDescription("Puts element extra IDs into an aux variable."); 22 28939 : return params; 23 0 : } 24 : 25 215 : ExtraElementIDAux::ExtraElementIDAux(const InputParameters & parameters) 26 215 : : AuxKernel(parameters), _id(getElementID("extra_id_name")) 27 : { 28 215 : if (isNodal()) 29 0 : paramError("variable", "This AuxKernel only supports Elemental fields"); 30 215 : } 31 : 32 : Real 33 26438 : ExtraElementIDAux::computeValue() 34 : { 35 26438 : return (_id == DofObject::invalid_id) ? -1.0 : _id; 36 : }