Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <string> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "DataStructures/Tensor/TypeAliases.hpp" 11 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/PrimitiveFromConservativeOptions.hpp" 12 : #include "Evolution/Systems/GrMhd/ValenciaDivClean/TagsDeclarations.hpp" 13 : #include "Evolution/Tags.hpp" 14 : #include "Options/String.hpp" 15 : 16 : /// \cond 17 : class DataVector; 18 : /// \endcond 19 : 20 : namespace grmhd { 21 : namespace ValenciaDivClean { 22 : /// %Tags for the Valencia formulation of the ideal GRMHD equations 23 : /// with divergence cleaning. 24 : namespace Tags { 25 : 26 : /// The characteristic speeds 27 1 : struct CharacteristicSpeeds : db::SimpleTag { 28 0 : using type = std::array<DataVector, 9>; 29 : }; 30 : 31 : /// The densitized rest-mass density \f${\tilde D}\f$ 32 1 : struct TildeD : db::SimpleTag { 33 0 : using type = Scalar<DataVector>; 34 : }; 35 : 36 : /// The densitized electron number density times the baryon mass 37 : /// \f$\tilde{Y}_e = {\tilde D} Y_e\f$ 38 1 : struct TildeYe : db::SimpleTag { 39 0 : using type = Scalar<DataVector>; 40 : }; 41 : 42 : /// The densitized energy density \f${\tilde \tau}\f$ 43 1 : struct TildeTau : db::SimpleTag { 44 0 : using type = Scalar<DataVector>; 45 : }; 46 : 47 : /// The densitized momentum density \f${\tilde S_i}\f$ 48 : template <typename Fr> 49 1 : struct TildeS : db::SimpleTag { 50 0 : using type = tnsr::i<DataVector, 3, Fr>; 51 0 : static std::string name() { return Frame::prefix<Fr>() + "TildeS"; } 52 : }; 53 : 54 : /// The densitized magnetic field \f${\tilde B^i}\f$ 55 : template <typename Fr> 56 1 : struct TildeB : db::SimpleTag { 57 0 : using type = tnsr::I<DataVector, 3, Fr>; 58 0 : static std::string name() { return Frame::prefix<Fr>() + "TildeB"; } 59 : }; 60 : 61 : /// The densitized divergence-cleaning field \f${\tilde \Phi}\f$ 62 1 : struct TildePhi : db::SimpleTag { 63 0 : using type = Scalar<DataVector>; 64 : }; 65 : 66 : /// \brief Set to `true` if the variables needed fixing. 67 : /// 68 : /// Used in DG-subcell hybrid scheme evolutions. 69 1 : struct VariablesNeededFixing : db::SimpleTag { 70 0 : using type = bool; 71 : }; 72 : } // namespace Tags 73 : 74 0 : namespace OptionTags { 75 : /// \ingroup OptionGroupsGroup 76 : /// Groups option tags related to the ValenciaDivClean evolution system. 77 1 : struct ValenciaDivCleanGroup { 78 0 : static std::string name() { return "ValenciaDivClean"; } 79 0 : static constexpr Options::String help{"Options for the evolution system"}; 80 0 : using group = evolution::OptionTags::SystemGroup; 81 : }; 82 : 83 : /// \brief The constraint damping parameter 84 1 : struct DampingParameter { 85 0 : static std::string name() { return "DampingParameter"; } 86 0 : using type = double; 87 0 : static constexpr Options::String help{ 88 : "Constraint damping parameter for divergence cleaning"}; 89 0 : using group = ValenciaDivCleanGroup; 90 : }; 91 : 92 0 : struct PrimitiveFromConservativeOptions { 93 0 : static std::string name() { return "PrimitiveFromConservative"; } 94 0 : using type = grmhd::ValenciaDivClean::PrimitiveFromConservativeOptions; 95 0 : static constexpr Options::String help{ 96 : "Value of density times Lorentz factor below which we skip conservative " 97 : "to primitive inversion."}; 98 : }; 99 : 100 : } // namespace OptionTags 101 : 102 : namespace Tags { 103 : /// The constraint damping parameter for divergence cleaning 104 1 : struct ConstraintDampingParameter : db::SimpleTag { 105 0 : using type = double; 106 0 : using option_tags = tmpl::list<OptionTags::DampingParameter>; 107 : 108 0 : static constexpr bool pass_metavariables = false; 109 0 : static double create_from_options(const double constraint_damping_parameter) { 110 : return constraint_damping_parameter; 111 : } 112 : }; 113 : 114 0 : struct PrimitiveFromConservativeOptions : db::SimpleTag { 115 0 : using type = grmhd::ValenciaDivClean::PrimitiveFromConservativeOptions; 116 0 : using option_tags = tmpl::list<OptionTags::PrimitiveFromConservativeOptions>; 117 : 118 0 : static constexpr bool pass_metavariables = false; 119 0 : static type create_from_options(const type& options) { return options; } 120 : }; 121 : 122 : } // namespace Tags 123 : } // namespace ValenciaDivClean 124 : } // namespace grmhd