LCOV - code coverage report
Current view: top level - src/variables - MooseVariableFieldBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: fef103 Lines: 17 19 89.5 %
Date: 2025-09-03 20:01:23 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             : 
      15             : InputParameters
      16      207581 : MooseVariableFieldBase::validParams()
      17             : {
      18      207581 :   return MooseVariableBase::validParams();
      19             : }
      20             : 
      21      186618 : MooseVariableFieldBase::MooseVariableFieldBase(const InputParameters & parameters)
      22      186618 :   : MooseVariableBase(parameters)
      23             : {
      24      186618 : }
      25             : 
      26             : const std::string &
      27         536 : MooseVariableFieldBase::componentName(const unsigned int comp) const
      28             : {
      29         536 :   if (comp >= _count)
      30           0 :     mooseError("componentName(): Component index is not less than the number of components");
      31         536 :   if (isArray())
      32         536 :     return this->arrayVariableComponent(comp);
      33             :   else
      34           0 :     return name();
      35             : }
      36             : 
      37             : const std::set<SubdomainID> &
      38     1330775 : MooseVariableFieldBase::activeSubdomains() const
      39             : {
      40     1330775 :   return this->_sys.system().variable(_var_num).active_subdomains();
      41             : }
      42             : 
      43             : bool
      44    68515331 : MooseVariableFieldBase::activeOnSubdomain(SubdomainID subdomain) const
      45             : {
      46    68515331 :   return this->_sys.system().variable(_var_num).active_on_subdomain(subdomain);
      47             : }
      48             : 
      49             : bool
      50       16726 : MooseVariableFieldBase::activeOnSubdomains(const std::set<SubdomainID> & subdomains) const
      51             : {
      52       16726 :   const auto & active_subs = activeSubdomains();
      53       16726 :   return std::includes(
      54       16726 :       active_subs.begin(), active_subs.end(), subdomains.begin(), subdomains.end());
      55             : }

Generated by: LCOV version 1.14