LCOV - code coverage report
Current view: top level - src/restart - Restartable.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31706 (f8ed4a) with base bb0a08 Lines: 30 34 88.2 %
Date: 2025-11-03 17:23:24 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             : #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     1133254 : Restartable::Restartable(const MooseObject * moose_object, const std::string & system_name)
      19             :   : Restartable(moose_object->getMooseApp(),
      20             :                 moose_object->name(),
      21             :                 system_name,
      22     2266508 :                 moose_object->parameters().isParamValid("_tid")
      23     2266506 :                     ? moose_object->parameters().get<THREAD_ID>("_tid")
      24     4533014 :                     : 0)
      25             : {
      26     1133254 : }
      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     1142810 : 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     1142810 :                          const RestartableDataMapName & metaname)
      41     1142810 :   : _restartable_app(moose_app),
      42     1142810 :     _restartable_system_name(system_name),
      43     1142810 :     _restartable_tid(tid),
      44     1142810 :     _restartable_read_only(read_only),
      45     1142810 :     _metaname(metaname),
      46     1142810 :     _restartable_name(name)
      47             : {
      48     1142810 : }
      49             : 
      50             : #ifdef MOOSE_KOKKOS_ENABLED
      51      223399 : Restartable::Restartable(const Restartable & object, const Moose::Kokkos::FunctorCopy &)
      52      223399 :   : _restartable_app(object._restartable_app),
      53      223399 :     _restartable_system_name(object._restartable_system_name),
      54      223399 :     _restartable_tid(object._restartable_tid),
      55      223399 :     _restartable_read_only(object._restartable_read_only),
      56      223399 :     _metaname(object._metaname),
      57      223399 :     _restartable_name(object._restartable_name)
      58             : {
      59      223399 : }
      60             : #endif
      61             : 
      62             : RestartableDataValue &
      63     2405607 : Restartable::registerRestartableDataOnApp(std::unique_ptr<RestartableDataValue> data,
      64             :                                           THREAD_ID tid) const
      65             : {
      66     4811214 :   return _restartable_app.registerRestartableData(
      67     7216821 :       std::move(data), tid, _restartable_read_only, _metaname);
      68             : }
      69             : 
      70             : void
      71      919240 : Restartable::registerRestartableNameWithFilterOnApp(const std::string & name,
      72             :                                                     Moose::RESTARTABLE_FILTER filter)
      73             : {
      74      919240 :   _restartable_app.registerRestartableNameWithFilter(name, filter);
      75      919240 : }
      76             : 
      77             : std::string
      78     3324847 : Restartable::restartableName(const std::string & data_name) const
      79             : {
      80     3324847 :   return _restartable_system_name + "/" + _restartable_name + "/" + data_name;
      81             : }

Generated by: LCOV version 1.14