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#include "SystemBase.h"
13#include "libmesh/system.h"
14#include "libmesh/variable.h"
15
21
26
27const std::string &
28MooseVariableFieldBase::componentName(const unsigned int comp) const
29{
30 if (comp >= _count)
31 mooseError("componentName(): Component index is not less than the number of components");
32 if (isArray())
33 return this->arrayVariableComponent(comp);
34 else
35 return name();
36}
37
38const std::set<SubdomainID> &
43
44bool
49
50bool
51MooseVariableFieldBase::activeOnSubdomains(const std::set<SubdomainID> & subdomains) const
52{
53 const auto & active_subs = activeSubdomains();
54 return std::includes(
55 active_subs.begin(), active_subs.end(), subdomains.begin(), subdomains.end());
56}
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.
unsigned int _var_num
variable number (from libMesh)
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.
SystemBase & _sys
System this variable is part of.
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)
bool activeOnSubdomains(const std::set< SubdomainID > &subdomains) const
Is the variable active on the subdomains?
const std::set< SubdomainID > & activeSubdomains() const
The subdomains the variable is active on.
bool activeOnSubdomain(SubdomainID subdomain) const
Is the variable active on the subdomain?
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
const Variable & variable(unsigned int var) const
const std::set< subdomain_id_type > & active_subdomains() const
bool active_on_subdomain(subdomain_id_type sid) const