LCOV - code coverage report
Current view: top level - src/interfaces - MeshMetaDataInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 18 20 90.0 %
Date: 2026-05-29 20:35:17 Functions: 6 7 85.7 %
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             : // MOOSE includes
      11             : #include "MeshMetaDataInterface.h"
      12             : #include "MooseApp.h"
      13             : 
      14      131446 : MeshMetaDataInterface::MeshMetaDataInterface(const MooseObject * moose_object)
      15      131446 :   : _meta_data_app(moose_object->getMooseApp()), _meta_data_object(moose_object)
      16             : {
      17      131446 : }
      18             : 
      19     3303907 : MeshMetaDataInterface::MeshMetaDataInterface(MooseApp & moose_app)
      20     3303907 :   : _meta_data_app(moose_app), _meta_data_object(nullptr)
      21             : {
      22     3303907 : }
      23             : 
      24             : #ifdef MOOSE_KOKKOS_ENABLED
      25        7931 : MeshMetaDataInterface::MeshMetaDataInterface(const MeshMetaDataInterface & object,
      26        7931 :                                              const Moose::Kokkos::FunctorCopy &)
      27        7931 :   : _meta_data_app(object._meta_data_app), _meta_data_object(object._meta_data_object)
      28             : {
      29        7931 : }
      30             : #endif
      31             : 
      32             : bool
      33      194296 : MeshMetaDataInterface::hasMeshProperty(const std::string & data_name,
      34             :                                        const std::string & prefix) const
      35             : {
      36      388592 :   return _meta_data_app.hasRestartableMetaData(meshPropertyName(data_name, prefix),
      37      388592 :                                                MooseApp::MESH_META_DATA);
      38             : }
      39             : 
      40             : std::string
      41      386203 : MeshMetaDataInterface::meshPropertyName(const std::string & data_name, const std::string & prefix)
      42             : {
      43      772406 :   return std::string(SYSTEM) + "/" + prefix + "/" + data_name;
      44             : }
      45             : 
      46             : std::string
      47           0 : MeshMetaDataInterface::meshPropertyPrefix(const std::string &) const
      48             : {
      49           0 :   mooseError("This object does not support obtaining a mesh property without a prefix.\n\nThis "
      50             :              "capability is upcoming.");
      51             : }
      52             : 
      53             : const RestartableDataValue &
      54        1067 : MeshMetaDataInterface::getMeshPropertyInternal(const std::string & data_name,
      55             :                                                const std::string & prefix) const
      56             : {
      57        1067 :   return _meta_data_app.getRestartableMetaData(
      58        2134 :       meshPropertyName(data_name, prefix), MooseApp::MESH_META_DATA, 0);
      59             : }

Generated by: LCOV version 1.14