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 : /// The down-index comoving magnetic field \f$b_\mu\f$ 67 1 : struct ComovingMagneticFieldOneForm : db::SimpleTag { 68 0 : using type = tnsr::a<DataVector, 3>; 69 : }; 70 : 71 : /// \brief Set to `true` if the variables needed fixing. 72 : /// 73 : /// Used in DG-subcell hybrid scheme evolutions. 74 1 : struct VariablesNeededFixing : db::SimpleTag { 75 0 : using type = bool; 76 : }; 77 : } // namespace Tags 78 : 79 0 : namespace OptionTags { 80 : /// \ingroup OptionGroupsGroup 81 : /// Groups option tags related to the ValenciaDivClean evolution system. 82 1 : struct ValenciaDivCleanGroup { 83 0 : static std::string name() { return "ValenciaDivClean"; } 84 0 : static constexpr Options::String help{"Options for the evolution system"}; 85 0 : using group = evolution::OptionTags::SystemGroup; 86 : }; 87 : 88 : /// \brief The constraint damping parameter 89 1 : struct DampingParameter { 90 0 : static std::string name() { return "DampingParameter"; } 91 0 : using type = double; 92 0 : static constexpr Options::String help{ 93 : "Constraint damping parameter for divergence cleaning"}; 94 0 : using group = ValenciaDivCleanGroup; 95 : }; 96 : 97 0 : struct PrimitiveFromConservativeOptions { 98 0 : static std::string name() { return "PrimitiveFromConservative"; } 99 0 : using type = grmhd::ValenciaDivClean::PrimitiveFromConservativeOptions; 100 0 : static constexpr Options::String help{ 101 : "Value of density times Lorentz factor below which we skip conservative " 102 : "to primitive inversion."}; 103 : }; 104 : 105 : } // namespace OptionTags 106 : 107 : namespace Tags { 108 : /// The constraint damping parameter for divergence cleaning 109 1 : struct ConstraintDampingParameter : db::SimpleTag { 110 0 : using type = double; 111 0 : using option_tags = tmpl::list<OptionTags::DampingParameter>; 112 : 113 0 : static constexpr bool pass_metavariables = false; 114 0 : static double create_from_options(const double constraint_damping_parameter) { 115 : return constraint_damping_parameter; 116 : } 117 : }; 118 : 119 0 : struct PrimitiveFromConservativeOptions : db::SimpleTag { 120 0 : using type = grmhd::ValenciaDivClean::PrimitiveFromConservativeOptions; 121 0 : using option_tags = tmpl::list<OptionTags::PrimitiveFromConservativeOptions>; 122 : 123 0 : static constexpr bool pass_metavariables = false; 124 0 : static type create_from_options(const type& options) { return options; } 125 : }; 126 : 127 : } // namespace Tags 128 : } // namespace ValenciaDivClean 129 : } // namespace grmhd