LCOV - code coverage report
Current view: top level - src/restart - Restartable.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 23 27 85.2 %
Date: 2025-08-08 20:01:16 Functions: 5 6 83.3 %
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 "InputParameters.h"
      11             : #include "Restartable.h"
      12             : #include "SubProblem.h"
      13             : #include "FEProblem.h"
      14             : #include "MooseObject.h"
      15             : #include "MooseMesh.h"
      16             : #include "MeshMetaDataInterface.h"
      17             : 
      18     1092527 : Restartable::Restartable(const MooseObject * moose_object, const std::string & system_name)
      19             :   : Restartable(moose_object->getMooseApp(),
      20     1092527 :                 moose_object->name(),
      21             :                 system_name,
      22     2185054 :                 moose_object->parameters().isParamValid("_tid")
      23     2185052 :                     ? moose_object->parameters().get<THREAD_ID>("_tid")
      24     4370106 :                     : 0)
      25             : {
      26     1092527 : }
      27             : 
      28           0 : Restartable::Restartable(const MooseObject * moose_object,
      29             :                          const std::string & system_name,
      30           0 :                          THREAD_ID tid)
      31           0 :   : Restartable(moose_object->getMooseApp(), moose_object->name(), system_name, tid)
      32             : {
      33           0 : }
      34             : 
      35     1101875 : Restartable::Restartable(MooseApp & moose_app,
      36             :                          const std::string & name,
      37             :                          const std::string & system_name,
      38             :                          THREAD_ID tid,
      39             :                          const bool read_only,
      40     1101875 :                          const RestartableDataMapName & metaname)
      41     1101875 :   : _restartable_app(moose_app),
      42     1101875 :     _restartable_system_name(system_name),
      43     1101875 :     _restartable_tid(tid),
      44     1101875 :     _restartable_read_only(read_only),
      45     1101875 :     _metaname(metaname),
      46     1101875 :     _restartable_name(name)
      47             : {
      48     1101875 : }
      49             : 
      50             : RestartableDataValue &
      51     2194436 : Restartable::registerRestartableDataOnApp(std::unique_ptr<RestartableDataValue> data,
      52             :                                           THREAD_ID tid) const
      53             : {
      54     4388872 :   return _restartable_app.registerRestartableData(
      55     6583308 :       std::move(data), tid, _restartable_read_only, _metaname);
      56             : }
      57             : 
      58             : void
      59      887340 : Restartable::registerRestartableNameWithFilterOnApp(const std::string & name,
      60             :                                                     Moose::RESTARTABLE_FILTER filter)
      61             : {
      62      887340 :   _restartable_app.registerRestartableNameWithFilter(name, filter);
      63      887340 : }
      64             : 
      65             : std::string
      66     3081776 : Restartable::restartableName(const std::string & data_name) const
      67             : {
      68     6163552 :   return _restartable_system_name + "/" + _restartable_name + "/" + data_name;
      69             : }

Generated by: LCOV version 1.14