Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <optional> 7 : #include <string> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "DataStructures/DataVector.hpp" 11 : #include "DataStructures/Tensor/TypeAliases.hpp" 12 : #include "Evolution/Tags.hpp" 13 : #include "Options/String.hpp" 14 : 15 : namespace ForceFree { 16 : 17 : /*! 18 : * \brief Tags for the GRFFE system with divergence cleaning. 19 : */ 20 : namespace Tags { 21 : 22 : /*! 23 : * \brief The electric field \f$E^i\f$. 24 : */ 25 1 : struct ElectricField : db::SimpleTag { 26 0 : using type = tnsr::I<DataVector, 3>; 27 : }; 28 : 29 : /*! 30 : * \brief The magnetic field \f$B^i\f$. 31 : */ 32 1 : struct MagneticField : db::SimpleTag { 33 0 : using type = tnsr::I<DataVector, 3>; 34 : }; 35 : 36 : /*! 37 : * \brief The electric charge density \f$q\equiv-n_\mu J^\mu\f$ where 38 : * \f$n^\mu\f$ is the normal to hypersurface and \f$J^\mu\f$ is the 4-current. 39 : */ 40 1 : struct ChargeDensity : db::SimpleTag { 41 0 : using type = Scalar<DataVector>; 42 : }; 43 : 44 : /*! 45 : * \brief The spatial electric current density \f$J^i\f$. 46 : */ 47 1 : struct ElectricCurrentDensity : db::SimpleTag { 48 0 : using type = tnsr::I<DataVector, 3>; 49 : }; 50 : 51 : /*! 52 : * \brief The divergence cleaning scalar field \f$\psi\f$ coupled to the 53 : * electric field. 54 : */ 55 1 : struct ElectricDivergenceCleaningField : db::SimpleTag { 56 0 : using type = Scalar<DataVector>; 57 : }; 58 : 59 : /*! 60 : * \brief The divergence cleaning scalar field \f$\phi\f$ coupled to the 61 : * magnetic field. 62 : */ 63 1 : struct MagneticDivergenceCleaningField : db::SimpleTag { 64 0 : using type = Scalar<DataVector>; 65 : }; 66 : 67 : /*! 68 : * \brief The densitized electric field \f$\tilde{E}^i = \sqrt{\gamma}E^i\f$. 69 : */ 70 1 : struct TildeE : db::SimpleTag { 71 0 : using type = tnsr::I<DataVector, 3>; 72 : }; 73 : 74 : /*! 75 : * \brief The densitized magnetic field \f$\tilde{B}^i = \sqrt{\gamma}B^i\f$. 76 : */ 77 1 : struct TildeB : db::SimpleTag { 78 0 : using type = tnsr::I<DataVector, 3>; 79 : }; 80 : 81 : /*! 82 : * \brief The densitized divergence cleaning field \f$\tilde{\psi} = 83 : * \sqrt{\gamma}\psi\f$ associated with the electric field. 84 : */ 85 1 : struct TildePsi : db::SimpleTag { 86 0 : using type = Scalar<DataVector>; 87 : }; 88 : 89 : /*! 90 : * \brief The densitized divergence cleaning field \f$\tilde{\phi} = 91 : * \sqrt{\gamma}\phi\f$ associated with the magnetic field. 92 : */ 93 1 : struct TildePhi : db::SimpleTag { 94 0 : using type = Scalar<DataVector>; 95 : }; 96 : 97 : /*! 98 : * \brief The densitized electric charge density \f$\tilde{q} = 99 : * \sqrt{\gamma}q\f$. 100 : */ 101 1 : struct TildeQ : db::SimpleTag { 102 0 : using type = Scalar<DataVector>; 103 : }; 104 : 105 : /*! 106 : * \brief The densitized electric current density \f$\tilde{J}^i = 107 : * \alpha\sqrt{\gamma}J^i\f$. 108 : */ 109 1 : struct TildeJ : db::SimpleTag { 110 0 : using type = tnsr::I<DataVector, 3>; 111 : }; 112 : 113 : /*! 114 : * \brief The largest characteristic speed 115 : */ 116 1 : struct LargestCharacteristicSpeed : db::SimpleTag { 117 0 : using type = double; 118 : }; 119 : 120 : /*! 121 : * \brief An optional scalar variable used for masking the interior of neutron 122 : * star(s) when running neutron star magnetosphere simulations. 123 : * 124 : * For elements that contain any grid points inside the NS, we assign the value 125 : * +1.0 to the grid points located outside the NS and assign -1.0 if located 126 : * inside the NS. 127 : * 128 : * For elements that do not contain any grid points inside the NS, this tag is 129 : * not initialized and has `null` value i.e. `has_value() == false`. 130 : * 131 : */ 132 1 : struct NsInteriorMask : db::SimpleTag { 133 0 : using type = std::optional<Scalar<DataVector>>; 134 : }; 135 : 136 : } // namespace Tags 137 : 138 0 : namespace OptionTags { 139 : /*! 140 : * \ingroup OptionGroupsGroup 141 : * \brief Groups option tags related to the GRFFE evolution system. 142 : */ 143 1 : struct ForceFreeGroup { 144 0 : static std::string name() { return "ForceFree"; } 145 0 : static constexpr Options::String help{ 146 : "Options for the GRFFE evolution system"}; 147 0 : using group = evolution::OptionTags::SystemGroup; 148 : }; 149 : 150 : /*! 151 : * \brief Groups option tags related to the divergence cleaning of the GRFFE 152 : * system. 153 : */ 154 1 : struct ConstraintDampingGroup { 155 0 : static std::string name() { return "ConstraintDamping"; } 156 0 : static constexpr Options::String help{ 157 : "Options related to constraint damping"}; 158 0 : using group = ForceFreeGroup; 159 : }; 160 : 161 : /*! 162 : * \brief The constraint damping parameter for divergence cleaning of electric 163 : * fields. 164 : */ 165 1 : struct KappaPsi { 166 0 : static std::string name() { return "KappaPsi"; } 167 0 : using type = double; 168 0 : static constexpr Options::String help{ 169 : "Constraint damping parameter for divergence cleaning of electric " 170 : "fields"}; 171 0 : using group = ConstraintDampingGroup; 172 : }; 173 : 174 : /*! 175 : * \brief The constraint damping parameter for divergence cleaning of magnetic 176 : * fields. 177 : */ 178 1 : struct KappaPhi { 179 0 : static std::string name() { return "KappaPhi"; } 180 0 : using type = double; 181 0 : static constexpr Options::String help{ 182 : "Constraint damping parameter for divergence cleaning of magnetic " 183 : "fields"}; 184 0 : using group = ConstraintDampingGroup; 185 : }; 186 : 187 : /*! 188 : * \brief Groups option tags related to the electric current of the GRFFE 189 : * system. 190 : */ 191 1 : struct ForceFreeCurrentGroup { 192 0 : static std::string name() { return "ForceFreeCurrent"; } 193 0 : static constexpr Options::String help{ 194 : "Options related to specifying the force-free electric current"}; 195 0 : using group = ForceFreeGroup; 196 : }; 197 : 198 : /*! 199 : * \brief The damping parameter in the electric current density to impose 200 : * force-free conditions. Physically, this parameter is the conductivity 201 : * parallel to magnetic field lines. 202 : */ 203 1 : struct ParallelConductivity { 204 0 : static std::string name() { return "ParallelConductivity"; } 205 0 : using type = double; 206 0 : static constexpr Options::String help{ 207 : "Damping parameter for J^i to impose the force-free conditions, which is " 208 : "physically the conductivity parallel to B field"}; 209 0 : using group = ForceFreeCurrentGroup; 210 : }; 211 : 212 : } // namespace OptionTags 213 : 214 : namespace Tags { 215 : /*! 216 : * \brief The constraint damping parameter \f$\kappa_\psi\f$ for divergence 217 : * cleaning of electric fields. 218 : */ 219 1 : struct KappaPsi : db::SimpleTag { 220 0 : using type = double; 221 0 : using option_tags = tmpl::list<OptionTags::KappaPsi>; 222 0 : static constexpr bool pass_metavariables = false; 223 0 : static double create_from_options(const double kappa_psi) { 224 : return kappa_psi; 225 : } 226 : }; 227 : 228 : /*! 229 : * \brief The constraint damping parameter \f$\kappa_\phi\f$ for divergence 230 : * cleaning of magnetic fields. 231 : */ 232 1 : struct KappaPhi : db::SimpleTag { 233 0 : using type = double; 234 0 : using option_tags = tmpl::list<OptionTags::KappaPhi>; 235 0 : static constexpr bool pass_metavariables = false; 236 0 : static double create_from_options(const double kappa_phi) { 237 : return kappa_phi; 238 : } 239 : }; 240 : 241 : /*! 242 : * \brief The damping parameter \f$\eta\f$ in the electric current density to 243 : * impose force-free conditions. Physically, this parameter is the conductivity 244 : * parallel to magnetic field lines. 245 : */ 246 1 : struct ParallelConductivity : db::SimpleTag { 247 0 : using type = double; 248 0 : using option_tags = tmpl::list<OptionTags::ParallelConductivity>; 249 0 : static constexpr bool pass_metavariables = false; 250 0 : static double create_from_options(const double parallel_conductivity) { 251 : return parallel_conductivity; 252 : } 253 : }; 254 : 255 : } // namespace Tags 256 : 257 : } // namespace ForceFree