SpECTRE  v2025.08.19
ScalarTensor Namespace Reference

Items related to evolving the first-order scalar tensor system. More...

Namespaces

namespace  AnalyticData
 Holds classes implementing analytic data for the ScalarTensor system.
 
namespace  BoundaryConditions
 Boundary conditions for the combined Generalized Harmonic and CurvedScalarWave systems.
 
namespace  BoundaryCorrections
 Boundary corrections/numerical fluxes.
 

Classes

struct  AnalyticDataBase
 Base struct for properties common to all Scalar Tensor analytic initial data. More...
 
struct  CouplingParameterOptions
 Linear, quadratic and quartic coupling parameters to curvature. More...
 
class  NumericInitialData
 Numeric initial data loaded from volume data files. More...
 
struct  System
 Scalar Tensor system obtained from combining the CurvedScalarWave and gh systems. More...
 
struct  TimeDerivative
 Compute the RHS terms of the evolution equations for the scalar tensor system. More...
 

Functions

bool operator== (const CouplingParameterOptions &lhs, const CouplingParameterOptions &rhs)
 
bool operator!= (const CouplingParameterOptions &lhs, const CouplingParameterOptions &rhs)
 
void multiply_by_negative_deriv_of_coupling_func (gsl::not_null< Scalar< DataVector > * > scalar_source, const Scalar< DataVector > &psi, const CouplingParameterOptions &coupling_parameters, std::pair< double, double > start_and_ramp_times, double time)
 Multiplies by the coupling function. More...
 
void multiply_by_negative_second_deriv_of_coupling_func (gsl::not_null< Scalar< DataVector > * > scalar_source, const Scalar< DataVector > &psi, const CouplingParameterOptions &coupling_parameters, std::pair< double, double > start_and_ramp_times, double time)
 Multiplies by the coupling function. More...
 
void add_scalar_source_to_dt_pi_scalar (gsl::not_null< Scalar< DataVector > * > dt_pi_scalar, const Scalar< DataVector > &scalar_source, const Scalar< DataVector > &lapse)
 Add in the source term to the \(\Pi\) evolved variable of the CurvedScalarWave system. More...
 
void mass_source (gsl::not_null< Scalar< DataVector > * > scalar_source, const Scalar< DataVector > &psi, double mass_psi)
 Computes the source term given by the mass of the scalar. More...
 
void add_stress_energy_term_to_dt_pi (gsl::not_null< tnsr::aa< DataVector, 3_st > * > dt_pi, const tnsr::aa< DataVector, 3_st > &trace_reversed_stress_energy, const Scalar< DataVector > &lapse)
 Add in the trace-reversed stress-energy source term to the \(\Pi\) evolved variable of the gh system. More...
 
void trace_reversed_stress_energy (gsl::not_null< tnsr::aa< DataVector, 3_st > * > stress_energy, const Scalar< DataVector > &pi_scalar, const tnsr::i< DataVector, 3_st > &phi_scalar, const Scalar< DataVector > &lapse, const tnsr::I< DataVector, 3_st > &shift)
 Compute the trace-reversed stress-energy tensor of the scalar field. More...
 
double nonic_ramp_function (double time, double start_time, double ramp_time)
 Function to smoothly turn on the coupling terms. More...
 
double nonic_ramp_function (double time, std::pair< double, double > start_and_ramp_times)
 Function to smoothly turn on the coupling terms. More...
 
void scalar_charge_integrand (const gsl::not_null< Scalar< DataVector > * > result, const tnsr::i< DataVector, 3 > &phi, const tnsr::I< DataVector, 3 > &unit_normal_vector)
 The scalar charge per unit solid angle. More...
 
void gauss_bonnet_scalar_source (gsl::not_null< Scalar< DataVector > * > scalar_source, const Scalar< DataVector > &weyl_electric_scalar, const Scalar< DataVector > &weyl_magnetic_scalar, const Scalar< DataVector > &psi, const CouplingParameterOptions &coupling_parameters, double mass_psi, std::pair< double, double > start_and_ramp_times, double time)
 Computes the source term given by the coupling of the scalar to curvature. More...
 
Scalar< DataVectorgauss_bonnet_scalar_source (const Scalar< DataVector > &weyl_electric_scalar, const Scalar< DataVector > &weyl_magnetic_scalar, const Scalar< DataVector > &psi, const CouplingParameterOptions &coupling_parameters, double mass_psi, std::pair< double, double > start_and_ramp_times, double time)
 Computes the source term given by the coupling of the scalar to curvature. More...
 

Detailed Description

Items related to evolving the first-order scalar tensor system.

Tags for the scalar tensor system.

Function Documentation

◆ add_scalar_source_to_dt_pi_scalar()

void ScalarTensor::add_scalar_source_to_dt_pi_scalar ( gsl::not_null< Scalar< DataVector > * >  dt_pi_scalar,
const Scalar< DataVector > &  scalar_source,
const Scalar< DataVector > &  lapse 
)

Add in the source term to the \(\Pi\) evolved variable of the CurvedScalarWave system.

Details

The only source term in the wave equation

\[ \Box \Psi = \mathcal{S} ~, \]

is in the equation for \(\Pi\):

\[ \partial_t \Pi + \text{\{spatial derivative terms\}} = \alpha \mathcal{S} ~, \]

where \(\mathcal{S}\) is the source term (e. g. in the Klein-Gordon equation, the source term is the derivative of the scalar potential \(\mathcal{S} \equiv \partial V / \partial \Psi \).)

This function adds that contribution to the existing value of dt_pi_scalar. The wave equation terms in the scalar equation should be computed before passing the dt_pi_scalar to this function for updating.

Parameters
dt_pi_scalarTime derivative terms of \(\Pi\). The sourceless part should be computed before with CurvedScalarWave::TimeDerivative.
scalar_sourceSource term \(\mathcal{S}\) for the scalar equation.
lapseLapse \(\alpha\).
See also
CurvedScalarWave::TimeDerivative for details about the source-less part of the time derivative calculation.

◆ add_stress_energy_term_to_dt_pi()

void ScalarTensor::add_stress_energy_term_to_dt_pi ( gsl::not_null< tnsr::aa< DataVector, 3_st > * >  dt_pi,
const tnsr::aa< DataVector, 3_st > &  trace_reversed_stress_energy,
const Scalar< DataVector > &  lapse 
)

Add in the trace-reversed stress-energy source term to the \(\Pi\) evolved variable of the gh system.

Details

The only stress energy source term in the Generalized Harmonic evolution equations is in the equation for \(\Pi_{a b}\):

\[ \partial_t \Pi_{ab} + \text{\{spatial derivative terms\}} = \text{\{GH source terms\}} - 16 \pi \alpha (T^{(\Psi)}_{ab} - \frac{1}{2} g_{a b} g^{cd}T^{(\Psi)}_{cd}) ~. \]

(note that this function takes as argument the trace-reversed stress-energy tensor)

This function adds that contribution to the existing value of dt_pi. The spacetime terms in the GH equation should be computed before passing the dt_pi to this function for updating.

Parameters
dt_piTime derivative of the \(\Pi_{ab}\) variable in the gh system. The vacuum part should be computed before with gh::TimeDerivative
trace_reversed_stress_energyTrace-reversed stress energy tensor of the scalar \(T^{(\Psi), \text{TR}}_{a b} \equiv T^{(\Psi)}_{ab} - \frac{1}{2} g_{a b} g^{cd}T^{(\Psi)}_{cd} = \partial_a \Psi \partial_b \Psi \).
lapseLapse \(\alpha\).
See also
gh::TimeDerivative for details about the spacetime part of the time derivative calculation.

◆ gauss_bonnet_scalar_source() [1/2]

Scalar< DataVector > ScalarTensor::gauss_bonnet_scalar_source ( const Scalar< DataVector > &  weyl_electric_scalar,
const Scalar< DataVector > &  weyl_magnetic_scalar,
const Scalar< DataVector > &  psi,
const CouplingParameterOptions coupling_parameters,
double  mass_psi,
std::pair< double, double >  start_and_ramp_times,
double  time 
)

Computes the source term given by the coupling of the scalar to curvature.

Details

For a scalar field with mass parameter \( m_\Psi \), the wave equation takes the form

\begin{align} \Box \Psi = \mathcal{S} ~, \end{align}

where the source is given by

\begin{align} \mathcal{S} \equiv m^2_\Psi \Psi - f'(\Psi) \mathcal{G}~, \end{align}

where

\begin{align} \mathcal{G} \equiv 8 (E_{ab} E^{ab} - B_{ab} B^{ab}) ~, \end{align}

is the Gauss-Bonnet scalar and the coupling function is given by

\begin{align} f(\Psi) \equiv \lambda \Psi + \dfrac{1}{16} \left( \eta \Psi^2 + 2 \zeta \Psi^4 \right) ~, \end{align}

Here the Gauss-Bonnet scalar (in vacuum) is given in terms of the electric ( \( E_{ab} \)) and magnetic ( \( B_{ab} \)) parts of the Weyl scalar.

◆ gauss_bonnet_scalar_source() [2/2]

void ScalarTensor::gauss_bonnet_scalar_source ( gsl::not_null< Scalar< DataVector > * >  scalar_source,
const Scalar< DataVector > &  weyl_electric_scalar,
const Scalar< DataVector > &  weyl_magnetic_scalar,
const Scalar< DataVector > &  psi,
const CouplingParameterOptions coupling_parameters,
double  mass_psi,
std::pair< double, double >  start_and_ramp_times,
double  time 
)

Computes the source term given by the coupling of the scalar to curvature.

Details

For a scalar field with mass parameter \( m_\Psi \), the wave equation takes the form

\begin{align} \Box \Psi = \mathcal{S} ~, \end{align}

where the source is given by

\begin{align} \mathcal{S} \equiv m^2_\Psi \Psi - f'(\Psi) \mathcal{G}~, \end{align}

where

\begin{align} \mathcal{G} \equiv 8 (E_{ab} E^{ab} - B_{ab} B^{ab}) ~, \end{align}

is the Gauss-Bonnet scalar and the coupling function is given by

\begin{align} f(\Psi) \equiv \lambda \Psi + \dfrac{1}{16} \left( \eta \Psi^2 + 2 \zeta \Psi^4 \right) ~, \end{align}

Here the Gauss-Bonnet scalar (in vacuum) is given in terms of the electric ( \( E_{ab} \)) and magnetic ( \( B_{ab} \)) parts of the Weyl scalar.

◆ mass_source()

void ScalarTensor::mass_source ( gsl::not_null< Scalar< DataVector > * >  scalar_source,
const Scalar< DataVector > &  psi,
double  mass_psi 
)

Computes the source term given by the mass of the scalar.

Details

For a scalar field with mass parameter \( m_\Psi \), the wave equation takes the form

\[ \Box \Psi = \mathcal{S} ~, \]

where the source is given by

\[ \mathcal{S} \equiv m^2_\Psi \Psi~. \]

Here the mass parameter value is an option that needs to be specified in the input file.

Parameters
scalar_sourceSource term \(\mathcal{S}\) for the scalar equation.
psiScalar field \(\Psi\).
mass_psiMass of the scalar field \(m_\Psi\).
See also
ScalarTensor::Tags::ScalarMass for details about the mass.

◆ multiply_by_negative_deriv_of_coupling_func()

void ScalarTensor::multiply_by_negative_deriv_of_coupling_func ( gsl::not_null< Scalar< DataVector > * >  scalar_source,
const Scalar< DataVector > &  psi,
const CouplingParameterOptions coupling_parameters,
std::pair< double, double >  start_and_ramp_times,
double  time 
)

Multiplies by the coupling function.

Details

Multiply by the first derivative of the coupling function given by

\begin{align} f(\Psi) \equiv + \dfrac{1}{16} \left( 4 \lambda \Psi + 2 \eta \Psi^2 + \zeta \Psi^4 \right) ~. \end{align}

◆ multiply_by_negative_second_deriv_of_coupling_func()

void ScalarTensor::multiply_by_negative_second_deriv_of_coupling_func ( gsl::not_null< Scalar< DataVector > * >  scalar_source,
const Scalar< DataVector > &  psi,
const CouplingParameterOptions coupling_parameters,
std::pair< double, double >  start_and_ramp_times,
double  time 
)

Multiplies by the coupling function.

Details

Multiply by the second derivative of the coupling function given by

\begin{align} f(\Psi) \equiv + \dfrac{1}{16} \left( 4 \lambda \Psi + 2 \eta \Psi^2 + \zeta \Psi^4 \right) ~. \end{align}

◆ nonic_ramp_function() [1/2]

double ScalarTensor::nonic_ramp_function ( double  time,
double  start_time,
double  ramp_time 
)

Function to smoothly turn on the coupling terms.

Details

Implements Eq. B4 of [157] :

\begin{align} t_* &\equiv (t - t_\mathrm{s})/t_\mathrm{ramp} \,, \\ F(t) &= t_*^5 (126 + t_* (-420 + t_* (540 + t_* (-315 + 70 t_*))))~, \end{align}

where \( t_\mathrm{s} \) and \( t_\mathrm{ramp} \) are parameters that control the start time and duration of the turn-on period. Note that \(F(t)\) is smoothstep<4>.

◆ nonic_ramp_function() [2/2]

double ScalarTensor::nonic_ramp_function ( double  time,
std::pair< double, double >  start_and_ramp_times 
)

Function to smoothly turn on the coupling terms.

Details

Implements Eq. B4 of [157] :

\begin{align} t_* &\equiv (t - t_\mathrm{s})/t_\mathrm{ramp} \,, \\ F(t) &= t_*^5 (126 + t_* (-420 + t_* (540 + t_* (-315 + 70 t_*))))~, \end{align}

where \( t_\mathrm{s} \) and \( t_\mathrm{ramp} \) are parameters that control the start time and duration of the turn-on period. Note that \(F(t)\) is smoothstep<4>.

◆ scalar_charge_integrand()

void ScalarTensor::scalar_charge_integrand ( const gsl::not_null< Scalar< DataVector > * >  result,
const tnsr::i< DataVector, 3 > &  phi,
const tnsr::I< DataVector, 3 > &  unit_normal_vector 
)

The scalar charge per unit solid angle.

Details

This function calculates the integrand of:

\begin{align*} q = - \dfrac{1}{4 \pi} \oint dA \Phi_i n^{i}, \end{align*}

where \( n^{i} \) is the unit (outward) normal of the surface.

For a spherically symmetric scalar, this value will coincide with the value as extracted from the \(r^{-1}\) decay in

\[ \Psi \sim \phi_\infty + q / r + \cdots~. \]

◆ trace_reversed_stress_energy()

void ScalarTensor::trace_reversed_stress_energy ( gsl::not_null< tnsr::aa< DataVector, 3_st > * >  stress_energy,
const Scalar< DataVector > &  pi_scalar,
const tnsr::i< DataVector, 3_st > &  phi_scalar,
const Scalar< DataVector > &  lapse,
const tnsr::I< DataVector, 3_st > &  shift 
)

Compute the trace-reversed stress-energy tensor of the scalar field.

Details

The trace-reversed stress energy tensor is needed to compute the backreaction of the scalar to the spacetime evolution and is given by

\begin{align*} T^{(\Psi), \text{TR}}_{a b} &\equiv T^{(\Psi)}_{ab} - \frac{1}{2} g_{a b} g^{cd}T^{(\Psi)}_{cd} \\ &= \partial_a \Psi \partial_b \Psi ~, \end{align*}

where \(T^{(\Psi)}_{ab}\) is the standard stress-energy tensor of the scalar.

In terms of the evolved variables of the scalar,

\begin{align*} T_{00} &= \alpha^2 \Pi^{2} - 2 \alpha \Pi \beta^{i} \Phi_{i} + \beta^{i} \beta^{j} \Phi_{i} \Phi{j}~, \\ T_{0k} &= - \alpha \Pi \Phi_{k} + \beta^{i} \Phi_{i} \Phi_{k}~, \\ T_{ij} &= \Phi_{i} \Phi{j}~. \end{align*}

where \(\alpha\) is the lapse.

Parameters
stress_energyTrace-reversed stress energy tensor of the scalar \(T^{(\Psi), \text{TR}}_{a b} \equiv T^{(\Psi)}_{ab} - \frac{1}{2} g_{a b} g^{cd}T^{(\Psi)}_{cd} = \partial_a \Psi \partial_b \Psi \).
pi_scalarScalar evolution variable \(\Pi\).
phi_scalarScalar evolution variable \(\Phi_i\).
lapseLapse \(\alpha\).
shiftShift \(\beta^{i}\).