SpECTRE  v2024.04.12
grmhd::AnalyticData::InitialMagneticFields::Toroidal Class Reference

Toroidal magnetic field for GRMHD initial data. More...

#include <Toroidal.hpp>

Classes

struct  Center
 
struct  CutoffPressure
 
struct  MaxDistanceFromCenter
 
struct  PressureExponent
 
struct  VectorPotentialAmplitude
 

Public Types

using options = tmpl::list< PressureExponent, CutoffPressure, VectorPotentialAmplitude, Center, MaxDistanceFromCenter >
 
- Public Types inherited from grmhd::AnalyticData::InitialMagneticFields::InitialMagneticField
using creatable_classes = tmpl::list< Poloidal, Toroidal >
 

Public Member Functions

 Toroidal (const Toroidal &)=default
 
Toroidaloperator= (const Toroidal &)=default
 
 Toroidal (Toroidal &&)=default
 
Toroidaloperator= (Toroidal &&)=default
 
 Toroidal (size_t pressure_exponent, double cutoff_pressure, double vector_potential_amplitude, std::array< double, 3 > center, double max_distance_from_center)
 
auto get_clone () const -> std::unique_ptr< InitialMagneticField > override
 
void pup (PUP::er &p) override
 
void variables (gsl::not_null< tnsr::I< DataVector, 3 > * > result, const tnsr::I< DataVector, 3 > &coords, const Scalar< DataVector > &pressure, const Scalar< DataVector > &sqrt_det_spatial_metric, const tnsr::i< DataVector, 3 > &deriv_pressure) const override
 Retrieve magnetic fields at (x) More...
 
void variables (gsl::not_null< tnsr::I< double, 3 > * > result, const tnsr::I< double, 3 > &coords, const Scalar< double > &pressure, const Scalar< double > &sqrt_det_spatial_metric, const tnsr::i< double, 3 > &deriv_pressure) const override
 Retrieve magnetic fields at (x) More...
 
bool is_equal (const InitialMagneticField &rhs) const override
 
virtual auto get_clone () const -> std::unique_ptr< InitialMagneticField >=0
 
virtual void variables (gsl::not_null< tnsr::I< DataVector, 3 > * > result, const tnsr::I< DataVector, 3 > &coords, const Scalar< DataVector > &pressure, const Scalar< DataVector > &sqrt_det_spatial_metric, const tnsr::i< DataVector, 3 > &deriv_pressure) const =0
 
virtual void variables (gsl::not_null< tnsr::I< double, 3 > * > result, const tnsr::I< double, 3 > &coords, const Scalar< double > &pressure, const Scalar< double > &sqrt_det_spatial_metric, const tnsr::i< double, 3 > &deriv_pressure) const =0
 
virtual bool is_equal (const InitialMagneticField &rhs) const =0
 

Static Public Attributes

static constexpr Options::String help = {"Toroidal initial magnetic field"}
 

Friends

bool operator== (const Toroidal &lhs, const Toroidal &rhs)
 

Detailed Description

Toroidal magnetic field for GRMHD initial data.

The vector potential has the form

\begin{align*} A_x & = A_y = 0 , \\ A_z & = A_b \varpi^2 \max(p-p_{\mathrm{cut}}, 0)^{n_s} , \end{align*}

where \(A_b\) controls the amplitude of the magnetic field, \(\varpi^2=x^2+y^2=r^2-z^2\) is the cylindrical radius, \(n_s\) controls the degree of differentiability, and \(p_{\mathrm{cut}}\) controls the pressure cutoff below which the magnetic field is zero.

On the region where the field is non-zero, the magnetic field is given by:

\begin{align*} B^x & = \frac{A_c}{\sqrt{\gamma}} \left[ 2y(p-p_{\mathrm{cut}})^{n_s} + \varpi^2 n_s (p-p_{\mathrm{cut}})^{n_s-1} \partial_y p \right],\\ B^y & = -\frac{A_c}{\sqrt{\gamma}} \left[ 2x(p-p_{\mathrm{cut}})^{n_s} + \varpi^2 n_s (p-p_{\mathrm{cut}})^{n_s-1} \partial_x p \right],\\ B^z & = 0 . \end{align*}

Note that the coordinates are relative to the Center passed in, so the field can be centered about any arbitrary point. The field is also zero outside of MaxDistanceFromCenter, so that compact support can be imposed if necessary.

Warning
This assumes the magnetic field is initialized, both in size and value, before being passed into the variables function. This is so that multiple magnetic fields can be superposed. Each magnetic field configuration does a += to make this possible.

Member Function Documentation

◆ get_clone()

auto grmhd::AnalyticData::InitialMagneticFields::Toroidal::get_clone ( ) const -> std::unique_ptr< InitialMagneticField >
overridevirtual

◆ is_equal()

bool grmhd::AnalyticData::InitialMagneticFields::Toroidal::is_equal ( const InitialMagneticField rhs) const
overridevirtual

◆ variables() [1/2]

void grmhd::AnalyticData::InitialMagneticFields::Toroidal::variables ( gsl::not_null< tnsr::I< DataVector, 3 > * >  result,
const tnsr::I< DataVector, 3 > &  coords,
const Scalar< DataVector > &  pressure,
const Scalar< DataVector > &  sqrt_det_spatial_metric,
const tnsr::i< DataVector, 3 > &  deriv_pressure 
) const
overridevirtual

Retrieve magnetic fields at (x)

Implements grmhd::AnalyticData::InitialMagneticFields::InitialMagneticField.

◆ variables() [2/2]

void grmhd::AnalyticData::InitialMagneticFields::Toroidal::variables ( gsl::not_null< tnsr::I< double, 3 > * >  result,
const tnsr::I< double, 3 > &  coords,
const Scalar< double > &  pressure,
const Scalar< double > &  sqrt_det_spatial_metric,
const tnsr::i< double, 3 > &  deriv_pressure 
) const
overridevirtual

Retrieve magnetic fields at (x)

Implements grmhd::AnalyticData::InitialMagneticFields::InitialMagneticField.


The documentation for this class was generated from the following file: