LCOV - code coverage report
Current view: top level - src/interfaces - MappingInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: f45d79 Lines: 15 16 93.8 %
Date: 2025-07-25 05:00:46 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         220 : MappingInterface::validParams()
      15             : {
      16         220 :   return emptyInputParameters();
      17             : }
      18             : 
      19         210 : MappingInterface::MappingInterface(const MooseObject * moose_object)
      20         210 :   : _smi_params(moose_object->parameters()),
      21         210 :     _smi_feproblem(*_smi_params.get<FEProblemBase *>("_fe_problem_base"))
      22             : {
      23         210 : }
      24             : 
      25             : VariableMappingBase &
      26         200 : MappingInterface::getMappingByName(const UserObjectName & name) const
      27             : {
      28             :   std::vector<VariableMappingBase *> models;
      29         200 :   _smi_feproblem.theWarehouse()
      30         200 :       .query()
      31         200 :       .condition<AttribName>(name)
      32         200 :       .condition<AttribSystem>("VariableMappingBase")
      33             :       .queryInto(models);
      34         200 :   if (models.empty())
      35           0 :     mooseError("Unable to find a Mapping object with the name '" + name + "'");
      36         200 :   return *(models[0]);
      37             : }
      38             : 
      39             : VariableMappingBase &
      40         110 : MappingInterface::getMapping(const std::string & name) const
      41             : {
      42         110 :   return getMappingByName(_smi_params.get<UserObjectName>(name));
      43             : }

Generated by: LCOV version 1.14