SpECTRE
v2024.03.19
|
Items related to evolving the scalar wave equation. More...
Namespaces | |
namespace | BoundaryConditions |
Boundary conditions for the scalar wave system. | |
namespace | BoundaryCorrections |
Boundary corrections/numerical fluxes. | |
namespace | Solutions |
Holds classes implementing a solution to the Euclidean wave equation \(0 = \frac{\partial^2 \Psi}{\partial t^2} - \nabla^2 \Psi\). | |
namespace | Tags |
Tags for the ScalarWave evolution system. | |
Classes | |
struct | ComputeNormalDotFluxes |
A relic of an old incorrect way of handling boundaries for non-conservative systems. More... | |
struct | System |
struct | TimeDerivative |
Compute the time derivatives for scalar wave system. More... | |
Functions | |
template<size_t Dim> | |
std::array< DataVector, 4 > | characteristic_speeds (const tnsr::i< DataVector, Dim, Frame::Inertial > &unit_normal_one_form) |
Compute the characteristic speeds for the scalar wave system. More... | |
template<size_t Dim> | |
void | characteristic_speeds (gsl::not_null< std::array< DataVector, 4 > * > char_speeds, const tnsr::i< DataVector, Dim, Frame::Inertial > &unit_normal_one_form) |
Compute the characteristic speeds for the scalar wave system. More... | |
template<size_t Dim> | |
Variables< tmpl::list< Tags::VPsi, Tags::VZero< Dim >, Tags::VPlus, Tags::VMinus > > | characteristic_fields (const Scalar< DataVector > &gamma_2, const Scalar< DataVector > &psi, const Scalar< DataVector > &pi, const tnsr::i< DataVector, Dim, Frame::Inertial > &phi, const tnsr::i< DataVector, Dim, Frame::Inertial > &unit_normal_one_form) |
Computes characteristic fields from evolved fields. More... | |
template<size_t Dim> | |
void | characteristic_fields (gsl::not_null< Variables< tmpl::list< Tags::VPsi, Tags::VZero< Dim >, Tags::VPlus, Tags::VMinus > > * > char_fields, const Scalar< DataVector > &gamma_2, const Scalar< DataVector > &psi, const Scalar< DataVector > &pi, const tnsr::i< DataVector, Dim, Frame::Inertial > &phi, const tnsr::i< DataVector, Dim, Frame::Inertial > &unit_normal_one_form) |
Computes characteristic fields from evolved fields. More... | |
template<size_t Dim> | |
Variables< tmpl::list< Tags::Psi, Tags::Pi, Tags::Phi< Dim > > > | evolved_fields_from_characteristic_fields (const Scalar< DataVector > &gamma_2, const Scalar< DataVector > &v_psi, const tnsr::i< DataVector, Dim, Frame::Inertial > &v_zero, const Scalar< DataVector > &v_plus, const Scalar< DataVector > &v_minus, const tnsr::i< DataVector, Dim, Frame::Inertial > &unit_normal_one_form) |
Compute evolved fields from characteristic fields. More... | |
template<size_t Dim> | |
void | evolved_fields_from_characteristic_fields (gsl::not_null< Variables< tmpl::list< Tags::Psi, Tags::Pi, Tags::Phi< Dim > > > * > evolved_fields, const Scalar< DataVector > &gamma_2, const Scalar< DataVector > &v_psi, const tnsr::i< DataVector, Dim, Frame::Inertial > &v_zero, const Scalar< DataVector > &v_plus, const Scalar< DataVector > &v_minus, const tnsr::i< DataVector, Dim, Frame::Inertial > &unit_normal_one_form) |
Compute evolved fields from characteristic fields. More... | |
template<size_t SpatialDim> | |
tnsr::i< DataVector, SpatialDim, Frame::Inertial > | one_index_constraint (const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &d_psi, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &phi) |
Compute the scalar-wave one-index constraint. More... | |
template<size_t SpatialDim> | |
void | one_index_constraint (gsl::not_null< tnsr::i< DataVector, SpatialDim, Frame::Inertial > * > constraint, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &d_psi, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &phi) |
Compute the scalar-wave one-index constraint. More... | |
template<size_t SpatialDim> | |
tnsr::ij< DataVector, SpatialDim, Frame::Inertial > | two_index_constraint (const tnsr::ij< DataVector, SpatialDim, Frame::Inertial > &d_phi) |
Compute the scalar-wave 2-index constraint. More... | |
template<size_t SpatialDim> | |
void | two_index_constraint (gsl::not_null< tnsr::ij< DataVector, SpatialDim, Frame::Inertial > * > constraint, const tnsr::ij< DataVector, SpatialDim, Frame::Inertial > &d_phi) |
Compute the scalar-wave 2-index constraint. More... | |
template<size_t SpatialDim> | |
void | energy_density (gsl::not_null< Scalar< DataVector > * > result, const Scalar< DataVector > &pi, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &phi) |
Computes the energy density of the scalar wave system. More... | |
template<size_t SpatialDim> | |
Scalar< DataVector > | energy_density (const Scalar< DataVector > &pi, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &phi) |
Computes the energy density of the scalar wave system. More... | |
template<size_t SpatialDim> | |
void | momentum_density (gsl::not_null< tnsr::i< DataVector, SpatialDim, Frame::Inertial > * > result, const Scalar< DataVector > &pi, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &phi) |
Computes the momentum density of the scalar wave system. More... | |
template<size_t SpatialDim> | |
tnsr::i< DataVector, SpatialDim, Frame::Inertial > | momentum_density (const Scalar< DataVector > &pi, const tnsr::i< DataVector, SpatialDim, Frame::Inertial > &phi) |
Computes the momentum density of the scalar wave system. More... | |
Items related to evolving the scalar wave equation.
The equations of motion for the system augmented with constraint damping terms are given by Eq. (15), (23) and (24) of [86] (setting background spacetime to Minkowskian):
\begin{align*} \partial_t \psi =& -\Pi \\ \partial_t \Pi =& -\partial^i \Phi_i \\ \partial_t \Phi_i =& -\partial_i \Pi + \gamma_2 (\partial_i \psi - \Phi_i) \end{align*}
In our implementation here, to disable the constraint damping terms, set \(\gamma_2 = 0\).
Variables< tmpl::list< Tags::VPsi, Tags::VZero< Dim >, Tags::VPlus, Tags::VMinus > > ScalarWave::characteristic_fields | ( | const Scalar< DataVector > & | gamma_2, |
const Scalar< DataVector > & | psi, | ||
const Scalar< DataVector > & | pi, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | phi, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | unit_normal_one_form | ||
) |
Computes characteristic fields from evolved fields.
Tags::CharacteristicFieldsCompute and Tags::EvolvedFieldsFromCharacteristicFieldsCompute convert between characteristic and evolved fields for the scalar-wave system.
Tags::CharacteristicFieldsCompute computes characteristic fields as described in "Optimal constraint projection for hyperbolic evolution systems" by Holst et al. [86] . Their names used here differ from this paper:
\begin{align*} \mathrm{SpECTRE} && \mathrm{Holst} \\ v^{\hat \psi} && Z^1 \\ v^{\hat 0}_{i} && Z^{2}_{i} \\ v^{\hat \pm} && u^{1\pm} \end{align*}
The characteristic fields \({v}^{\hat \alpha}\) are given in terms of the evolved fields by Eq.(33) - (35) of [86], respectively:
\begin{align*} v^{\hat \psi} =& \psi \\ v^{\hat 0}_{i} =& (\delta^k_i - n_i n^k) \Phi_{k} := P^k_i \Phi_{k} \\ v^{\hat \pm} =& \Pi \pm n^i \Phi_{i} - \gamma_2\psi \end{align*}
where \(\psi\) is the scalar field, \(\Phi_{i}=\partial_i \psi\) is an auxiliary variable, \(\Pi\) is a conjugate momentum, \(\gamma_2\) is a constraint damping parameter, and \(n_k\) is the unit normal to the surface along which the characteristic fields are defined.
Tags::EvolvedFieldsFromCharacteristicFieldsCompute computes evolved fields \(u_\alpha\) in terms of the characteristic fields. This uses the inverse of above relations:
\begin{align*} \psi =& v^{\hat \psi}, \\ \Pi =& \frac{1}{2}(v^{\hat +} + v^{\hat -}) + \gamma_2 v^{\hat \psi}, \\ \Phi_{i} =& \frac{1}{2}(v^{\hat +} - v^{\hat -}) n_i + v^{\hat 0}_{i}. \end{align*}
The corresponding characteristic speeds \(\lambda_{\hat \alpha}\) are computed by Tags::CharacteristicSpeedsCompute .
void ScalarWave::characteristic_fields | ( | gsl::not_null< Variables< tmpl::list< Tags::VPsi, Tags::VZero< Dim >, Tags::VPlus, Tags::VMinus > > * > | char_fields, |
const Scalar< DataVector > & | gamma_2, | ||
const Scalar< DataVector > & | psi, | ||
const Scalar< DataVector > & | pi, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | phi, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | unit_normal_one_form | ||
) |
Computes characteristic fields from evolved fields.
Tags::CharacteristicFieldsCompute and Tags::EvolvedFieldsFromCharacteristicFieldsCompute convert between characteristic and evolved fields for the scalar-wave system.
Tags::CharacteristicFieldsCompute computes characteristic fields as described in "Optimal constraint projection for hyperbolic evolution systems" by Holst et al. [86] . Their names used here differ from this paper:
\begin{align*} \mathrm{SpECTRE} && \mathrm{Holst} \\ v^{\hat \psi} && Z^1 \\ v^{\hat 0}_{i} && Z^{2}_{i} \\ v^{\hat \pm} && u^{1\pm} \end{align*}
The characteristic fields \({v}^{\hat \alpha}\) are given in terms of the evolved fields by Eq.(33) - (35) of [86], respectively:
\begin{align*} v^{\hat \psi} =& \psi \\ v^{\hat 0}_{i} =& (\delta^k_i - n_i n^k) \Phi_{k} := P^k_i \Phi_{k} \\ v^{\hat \pm} =& \Pi \pm n^i \Phi_{i} - \gamma_2\psi \end{align*}
where \(\psi\) is the scalar field, \(\Phi_{i}=\partial_i \psi\) is an auxiliary variable, \(\Pi\) is a conjugate momentum, \(\gamma_2\) is a constraint damping parameter, and \(n_k\) is the unit normal to the surface along which the characteristic fields are defined.
Tags::EvolvedFieldsFromCharacteristicFieldsCompute computes evolved fields \(u_\alpha\) in terms of the characteristic fields. This uses the inverse of above relations:
\begin{align*} \psi =& v^{\hat \psi}, \\ \Pi =& \frac{1}{2}(v^{\hat +} + v^{\hat -}) + \gamma_2 v^{\hat \psi}, \\ \Phi_{i} =& \frac{1}{2}(v^{\hat +} - v^{\hat -}) n_i + v^{\hat 0}_{i}. \end{align*}
The corresponding characteristic speeds \(\lambda_{\hat \alpha}\) are computed by Tags::CharacteristicSpeedsCompute .
std::array< DataVector, 4 > ScalarWave::characteristic_speeds | ( | const tnsr::i< DataVector, Dim, Frame::Inertial > & | unit_normal_one_form | ) |
Compute the characteristic speeds for the scalar wave system.
Computes the speeds as described in "Optimal constraint projection for hyperbolic evolution systems" by Holst et al. [86] [see text following Eq.(32)]. The characteristic fields' names used here differ from this paper:
\begin{align*} \mathrm{SpECTRE} && \mathrm{Holst} \\ v^{\hat \psi} && Z^1 \\ v^{\hat 0}_{i} && Z^{2}_{i} \\ v^{\hat \pm} && u^{1\pm} \end{align*}
The corresponding characteristic speeds \(\lambda_{\hat \alpha}\) are given in the text following Eq.(38) of [86] :
\begin{align*} \lambda_{\hat \psi} =& 0 \\ \lambda_{\hat 0} =& 0 \\ \lambda_{\hat \pm} =& \pm 1. \end{align*}
void ScalarWave::characteristic_speeds | ( | gsl::not_null< std::array< DataVector, 4 > * > | char_speeds, |
const tnsr::i< DataVector, Dim, Frame::Inertial > & | unit_normal_one_form | ||
) |
Compute the characteristic speeds for the scalar wave system.
Computes the speeds as described in "Optimal constraint projection for hyperbolic evolution systems" by Holst et al. [86] [see text following Eq.(32)]. The characteristic fields' names used here differ from this paper:
\begin{align*} \mathrm{SpECTRE} && \mathrm{Holst} \\ v^{\hat \psi} && Z^1 \\ v^{\hat 0}_{i} && Z^{2}_{i} \\ v^{\hat \pm} && u^{1\pm} \end{align*}
The corresponding characteristic speeds \(\lambda_{\hat \alpha}\) are given in the text following Eq.(38) of [86] :
\begin{align*} \lambda_{\hat \psi} =& 0 \\ \lambda_{\hat 0} =& 0 \\ \lambda_{\hat \pm} =& \pm 1. \end{align*}
Scalar< DataVector > ScalarWave::energy_density | ( | const Scalar< DataVector > & | pi, |
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | phi | ||
) |
Computes the energy density of the scalar wave system.
Below is the function used to calculate the energy density.
\begin{align*} \epsilon = \frac{1}{2}\left( \Pi^{2} + \abs{\Phi}^{2} \right) \end{align*}
void ScalarWave::energy_density | ( | gsl::not_null< Scalar< DataVector > * > | result, |
const Scalar< DataVector > & | pi, | ||
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | phi | ||
) |
Computes the energy density of the scalar wave system.
Below is the function used to calculate the energy density.
\begin{align*} \epsilon = \frac{1}{2}\left( \Pi^{2} + \abs{\Phi}^{2} \right) \end{align*}
Variables< tmpl::list< Tags::Psi, Tags::Pi, Tags::Phi< Dim > > > ScalarWave::evolved_fields_from_characteristic_fields | ( | const Scalar< DataVector > & | gamma_2, |
const Scalar< DataVector > & | v_psi, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | v_zero, | ||
const Scalar< DataVector > & | v_plus, | ||
const Scalar< DataVector > & | v_minus, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | unit_normal_one_form | ||
) |
Compute evolved fields from characteristic fields.
For expressions used here to compute evolved fields from characteristic ones, see Tags::CharacteristicFieldsCompute.
void ScalarWave::evolved_fields_from_characteristic_fields | ( | gsl::not_null< Variables< tmpl::list< Tags::Psi, Tags::Pi, Tags::Phi< Dim > > > * > | evolved_fields, |
const Scalar< DataVector > & | gamma_2, | ||
const Scalar< DataVector > & | v_psi, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | v_zero, | ||
const Scalar< DataVector > & | v_plus, | ||
const Scalar< DataVector > & | v_minus, | ||
const tnsr::i< DataVector, Dim, Frame::Inertial > & | unit_normal_one_form | ||
) |
Compute evolved fields from characteristic fields.
For expressions used here to compute evolved fields from characteristic ones, see Tags::CharacteristicFieldsCompute.
tnsr::i< DataVector, SpatialDim, Frame::Inertial > ScalarWave::momentum_density | ( | const Scalar< DataVector > & | pi, |
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | phi | ||
) |
Computes the momentum density of the scalar wave system.
Below is the function used to calculate the momentum density.
\begin{align*} P_i = \Pi \times \Phi_i \end{align*}
void ScalarWave::momentum_density | ( | gsl::not_null< tnsr::i< DataVector, SpatialDim, Frame::Inertial > * > | result, |
const Scalar< DataVector > & | pi, | ||
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | phi | ||
) |
Computes the momentum density of the scalar wave system.
Below is the function used to calculate the momentum density.
\begin{align*} P_i = \Pi \times \Phi_i \end{align*}
tnsr::i< DataVector, SpatialDim, Frame::Inertial > ScalarWave::one_index_constraint | ( | const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | d_psi, |
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | phi | ||
) |
Compute the scalar-wave one-index constraint.
Computes the scalar-wave one-index constraint, \(C_{i} = \partial_i\psi - \Phi_{i},\) which is given by Eq. (19) of [86]
void ScalarWave::one_index_constraint | ( | gsl::not_null< tnsr::i< DataVector, SpatialDim, Frame::Inertial > * > | constraint, |
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | d_psi, | ||
const tnsr::i< DataVector, SpatialDim, Frame::Inertial > & | phi | ||
) |
Compute the scalar-wave one-index constraint.
Computes the scalar-wave one-index constraint, \(C_{i} = \partial_i\psi - \Phi_{i},\) which is given by Eq. (19) of [86]
tnsr::ij< DataVector, SpatialDim, Frame::Inertial > ScalarWave::two_index_constraint | ( | const tnsr::ij< DataVector, SpatialDim, Frame::Inertial > & | d_phi | ) |
Compute the scalar-wave 2-index constraint.
Computes the scalar-wave 2-index constraint \(C_{ij} = \partial_i\Phi_j - \partial_j\Phi_i,\) where \(\Phi_{i} = \partial_i\psi\), that is given by Eq. (20) of [86]
void ScalarWave::two_index_constraint | ( | gsl::not_null< tnsr::ij< DataVector, SpatialDim, Frame::Inertial > * > | constraint, |
const tnsr::ij< DataVector, SpatialDim, Frame::Inertial > & | d_phi | ||
) |
Compute the scalar-wave 2-index constraint.
Computes the scalar-wave 2-index constraint \(C_{ij} = \partial_i\Phi_j - \partial_j\Phi_i,\) where \(\Phi_{i} = \partial_i\psi\), that is given by Eq. (20) of [86]