LCOV - code coverage report
Current view: top level - src/interfaces - MappingInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: #31405 (292dce) with base fef103 Lines: 16 17 94.1 %
Date: 2025-09-04 07:57:52 Functions: 4 4 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 "MappingInterface.h"
      11             : #include "MooseTypes.h"
      12             : 
      13             : InputParameters
      14         242 : MappingInterface::validParams()
      15             : {
      16         242 :   return emptyInputParameters();
      17             : }
      18             : 
      19         231 : MappingInterface::MappingInterface(const MooseObject * moose_object)
      20         231 :   : _smi_params(moose_object->parameters()),
      21         231 :     _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base"))
      22             : {
      23         231 : }
      24             : 
      25             : VariableMappingBase &
      26         220 : MappingInterface::getMappingByName(const UserObjectName & name) const
      27             : {
      28             :   std::vector<VariableMappingBase *> models;
      29         220 :   _smi_feproblem.theWarehouse()
      30         220 :       .query()
      31         220 :       .condition<AttribName>(name)
      32         220 :       .condition<AttribSystem>("VariableMappingBase")
      33             :       .queryInto(models);
      34         220 :   if (models.empty())
      35           0 :     mooseError("Unable to find a Mapping object with the name '" + name + "'");
      36         220 :   return *(models[0]);
      37         220 : }
      38             : 
      39             : VariableMappingBase &
      40         121 : MappingInterface::getMapping(const std::string & name) const
      41             : {
      42         121 :   return getMappingByName(_smi_params.get<UserObjectName>(name));
      43             : }

Generated by: LCOV version 1.14