LCOV - code coverage report
Current view: top level - src/variables - MooseVariableFieldBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: d8769b Lines: 17 19 89.5 %
Date: 2025-11-07 20:01:30 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          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 "MooseVariableFieldBase.h"
      11             : #include "SubProblem.h"
      12             : #include "SystemBase.h"
      13             : #include "libmesh/system.h"
      14             : #include "libmesh/variable.h"
      15             : 
      16             : InputParameters
      17      213630 : MooseVariableFieldBase::validParams()
      18             : {
      19      213630 :   return MooseVariableBase::validParams();
      20             : }
      21             : 
      22      189548 : MooseVariableFieldBase::MooseVariableFieldBase(const InputParameters & parameters)
      23      189548 :   : MooseVariableBase(parameters)
      24             : {
      25      189548 : }
      26             : 
      27             : const std::string &
      28         536 : MooseVariableFieldBase::componentName(const unsigned int comp) const
      29             : {
      30         536 :   if (comp >= _count)
      31           0 :     mooseError("componentName(): Component index is not less than the number of components");
      32         536 :   if (isArray())
      33         536 :     return this->arrayVariableComponent(comp);
      34             :   else
      35           0 :     return name();
      36             : }
      37             : 
      38             : const std::set<SubdomainID> &
      39     1358644 : MooseVariableFieldBase::activeSubdomains() const
      40             : {
      41     1358644 :   return this->_sys.system().variable(_var_num).active_subdomains();
      42             : }
      43             : 
      44             : bool
      45    69201207 : MooseVariableFieldBase::activeOnSubdomain(SubdomainID subdomain) const
      46             : {
      47    69201207 :   return this->_sys.system().variable(_var_num).active_on_subdomain(subdomain);
      48             : }
      49             : 
      50             : bool
      51       16726 : MooseVariableFieldBase::activeOnSubdomains(const std::set<SubdomainID> & subdomains) const
      52             : {
      53       16726 :   const auto & active_subs = activeSubdomains();
      54       16726 :   return std::includes(
      55       16726 :       active_subs.begin(), active_subs.end(), subdomains.begin(), subdomains.end());
      56             : }

Generated by: LCOV version 1.14