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

Generated by: LCOV version 1.14