LCOV - code coverage report
Current view: top level - src/variablemappings - VariableMappingBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: #32971 (54bef8) with base c6cf66 Lines: 17 18 94.4 %
Date: 2026-05-29 20:40:35 Functions: 3 3 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 "VariableMappingBase.h"
      11             : 
      12             : InputParameters
      13        3367 : VariableMappingBase::validParams()
      14             : {
      15        3367 :   InputParameters params = MooseObject::validParams();
      16        3367 :   params += RestartableModelInterface::validParams();
      17        3367 :   params.addClassDescription("Base class for mapping objects.");
      18        3367 :   params.registerBase("VariableMappingBase");
      19        3367 :   params.registerSystemAttributeName("VariableMappingBase");
      20        6734 :   params.addParam<std::vector<VariableName>>("variables",
      21             :                                              "The names of the variables which need a mapping.");
      22        3367 :   return params;
      23           0 : }
      24             : 
      25          84 : VariableMappingBase::VariableMappingBase(const InputParameters & parameters)
      26             :   : MooseObject(parameters),
      27          84 :     RestartableModelInterface(*this, /*read_only=*/false, _type + "_" + name()),
      28         252 :     _variable_names(isParamValid("filename")
      29         168 :                         ? getModelData<std::vector<VariableName>>("variables")
      30         260 :                         : declareModelData<std::vector<VariableName>>(
      31             :                               "variables", getParam<std::vector<VariableName>>("variables"))),
      32         420 :     _mapping_ready_to_use(declareModelData<std::map<VariableName, bool>>("mapping_ready_to_use"))
      33             : {
      34          84 : }
      35             : 
      36             : void
      37         372 : VariableMappingBase::checkIfReadyToUse(const VariableName & libmesh_dbg_var(vname)) const
      38             : {
      39             :   mooseAssert(_mapping_ready_to_use.find(vname) != _mapping_ready_to_use.end() &&
      40             :                   _mapping_ready_to_use[vname],
      41             :               "The mapping for variable " + vname + "is not ready to use!");
      42         372 : }

Generated by: LCOV version 1.14