https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseVariableFieldBase.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
11#include "SubProblem.h"
12
18
23
24const std::string &
25MooseVariableFieldBase::componentName(const unsigned int comp) const
26{
27 if (comp >= _count)
28 mooseError("componentName(): Component index is not less than the number of components");
29 if (isArray())
30 return this->arrayVariableComponent(comp);
31 else
32 return name();
33}
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
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:271
Base variable class.
virtual bool isArray() const
static InputParameters validParams()
const std::string & arrayVariableComponent(const unsigned int i) const
Returns the variable name of a component of an array variable.
const unsigned int _count
Number of variables in the array.
const std::string & componentName(const unsigned int comp) const
Get the variable name of a component in libMesh.
static InputParameters validParams()
MooseVariableFieldBase(const InputParameters &parameters)