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 1135519 : Restartable::Restartable(const MooseObject * moose_object, const std::string & system_name) 19 : : Restartable(moose_object->getMooseApp(), 20 : moose_object->name(), 21 : system_name, 22 2271038 : moose_object->parameters().isParamValid("_tid") 23 2271036 : ? moose_object->parameters().get<THREAD_ID>("_tid") 24 4542074 : : 0) 25 : { 26 1135519 : } 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 1145075 : 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 1145075 : const RestartableDataMapName & metaname) 41 1145075 : : _restartable_app(moose_app), 42 1145075 : _restartable_system_name(system_name), 43 1145075 : _restartable_tid(tid), 44 1145075 : _restartable_read_only(read_only), 45 1145075 : _metaname(metaname), 46 1145075 : _restartable_name(name) 47 : { 48 1145075 : } 49 : 50 : #ifdef MOOSE_KOKKOS_ENABLED 51 276417 : Restartable::Restartable(const Restartable & object, const Moose::Kokkos::FunctorCopy &) 52 276417 : : _restartable_app(object._restartable_app), 53 276417 : _restartable_system_name(object._restartable_system_name), 54 276417 : _restartable_tid(object._restartable_tid), 55 276417 : _restartable_read_only(object._restartable_read_only), 56 276417 : _metaname(object._metaname), 57 276417 : _restartable_name(object._restartable_name) 58 : { 59 276417 : } 60 : #endif 61 : 62 : RestartableDataValue & 63 2410372 : Restartable::registerRestartableDataOnApp(std::unique_ptr<RestartableDataValue> data, 64 : THREAD_ID tid) const 65 : { 66 4820744 : return _restartable_app.registerRestartableData( 67 7231116 : std::move(data), tid, _restartable_read_only, _metaname); 68 : } 69 : 70 : void 71 921041 : Restartable::registerRestartableNameWithFilterOnApp(const std::string & name, 72 : Moose::RESTARTABLE_FILTER filter) 73 : { 74 921041 : _restartable_app.registerRestartableNameWithFilter(name, filter); 75 921041 : } 76 : 77 : std::string 78 3331413 : Restartable::restartableName(const std::string & data_name) const 79 : { 80 3331413 : return _restartable_system_name + "/" + _restartable_name + "/" + data_name; 81 : }