LCOV - code coverage report
Current view: top level - src/variablemappings - VariableMappingBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: f45d79 Lines: 17 18 94.4 %
Date: 2025-07-25 05:00:46 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        6990 : VariableMappingBase::validParams()
      14             : {
      15        6990 :   InputParameters params = MooseObject::validParams();
      16        6990 :   params += RestartableModelInterface::validParams();
      17        6990 :   params.addClassDescription("Base class for mapping objects.");
      18        6990 :   params.registerBase("VariableMappingBase");
      19        6990 :   params.registerSystemAttributeName("VariableMappingBase");
      20       13980 :   params.addParam<std::vector<VariableName>>("variables",
      21             :                                              "The names of the variables which need a mapping.");
      22        6990 :   return params;
      23           0 : }
      24             : 
      25         170 : VariableMappingBase::VariableMappingBase(const InputParameters & parameters)
      26             :   : MooseObject(parameters),
      27         170 :     RestartableModelInterface(*this, /*read_only=*/false, _type + "_" + name()),
      28         510 :     _variable_names(isParamValid("filename")
      29         340 :                         ? getModelData<std::vector<VariableName>>("variables")
      30         530 :                         : declareModelData<std::vector<VariableName>>(
      31             :                               "variables", getParam<std::vector<VariableName>>("variables"))),
      32         850 :     _mapping_ready_to_use(declareModelData<std::map<VariableName, bool>>("mapping_ready_to_use"))
      33             : {
      34         170 : }
      35             : 
      36             : void
      37         750 : 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         750 : }

Generated by: LCOV version 1.14