LCOV - code coverage report
Current view: top level - src/restart - Restartable.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 23 27 85.2 %
Date: 2025-07-17 01:28:37 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     1014571 : Restartable::Restartable(const MooseObject * moose_object, const std::string & system_name)
      19             :   : Restartable(moose_object->getMooseApp(),
      20     1014571 :                 moose_object->name(),
      21             :                 system_name,
      22     2029142 :                 moose_object->parameters().isParamValid("_tid")
      23     2029140 :                     ? moose_object->parameters().get<THREAD_ID>("_tid")
      24     4058282 :                     : 0)
      25             : {
      26     1014571 : }
      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     1023193 : 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     1023193 :                          const RestartableDataMapName & metaname)
      41     1023193 :   : _restartable_app(moose_app),
      42     1023193 :     _restartable_system_name(system_name),
      43     1023193 :     _restartable_tid(tid),
      44     1023193 :     _restartable_read_only(read_only),
      45     1023193 :     _metaname(metaname),
      46     1023193 :     _restartable_name(name)
      47             : {
      48     1023193 : }
      49             : 
      50             : RestartableDataValue &
      51     1953933 : Restartable::registerRestartableDataOnApp(std::unique_ptr<RestartableDataValue> data,
      52             :                                           THREAD_ID tid) const
      53             : {
      54     3907866 :   return _restartable_app.registerRestartableData(
      55     5861799 :       std::move(data), tid, _restartable_read_only, _metaname);
      56             : }
      57             : 
      58             : void
      59      742265 : Restartable::registerRestartableNameWithFilterOnApp(const std::string & name,
      60             :                                                     Moose::RESTARTABLE_FILTER filter)
      61             : {
      62      742265 :   _restartable_app.registerRestartableNameWithFilter(name, filter);
      63      742265 : }
      64             : 
      65             : std::string
      66     2696198 : Restartable::restartableName(const std::string & data_name) const
      67             : {
      68     5392396 :   return _restartable_system_name + "/" + _restartable_name + "/" + data_name;
      69             : }

Generated by: LCOV version 1.14