Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cmath> 7 : #include <string> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "Time/OptionTags/InitialSlabSize.hpp" 11 : #include "Time/OptionTags/InitialTimeStep.hpp" 12 : #include "Utilities/TMPL.hpp" 13 : #include "Utilities/TaggedTuple.hpp" 14 : 15 : namespace Initialization { 16 : /// \ingroup InitializationGroup 17 : /// \brief %Tags used during initialization of parallel components. 18 1 : namespace Tags { 19 0 : struct InitialTimeDelta : db::SimpleTag { 20 0 : using type = double; 21 0 : using option_tags = tmpl::list<OptionTags::InitialTimeStep>; 22 : 23 0 : static constexpr bool pass_metavariables = false; 24 0 : static double create_from_options(const double initial_time_step) { 25 : return initial_time_step; 26 : } 27 : }; 28 : 29 : template <bool UsingLocalTimeStepping> 30 0 : struct InitialSlabSize : db::SimpleTag { 31 0 : using type = double; 32 0 : using option_tags = tmpl::list<OptionTags::InitialSlabSize>; 33 : 34 0 : static constexpr bool pass_metavariables = false; 35 0 : static double create_from_options(const double initial_slab_size) { 36 : return initial_slab_size; 37 : } 38 : }; 39 : 40 : template <> 41 0 : struct InitialSlabSize<false> : db::SimpleTag { 42 0 : using type = double; 43 0 : using option_tags = tmpl::list<OptionTags::InitialTimeStep>; 44 : 45 0 : static constexpr bool pass_metavariables = false; 46 0 : static double create_from_options(const double initial_time_step) { 47 : return std::abs(initial_time_step); 48 : } 49 : }; 50 : } // namespace Tags 51 : } // namespace Initialization