SpECTRE  v2026.06.30
Loading...
Searching...
No Matches
ScalarWave::Solutions::StandingWave< Dim > Class Template Reference

A standing wave solution to the Euclidean wave equation. More...

#include <StandingWave.hpp>

Classes

struct  Amplitude
struct  Center
struct  WaveVector

Public Types

using options = tmpl::list<WaveVector, Center, Amplitude>
using tags

Public Member Functions

 StandingWave (std::array< double, Dim > wave_vector, std::array< double, Dim > center, double amplitude)
 StandingWave (const StandingWave &)=default
StandingWaveoperator= (const StandingWave &)=default
 StandingWave (StandingWave &&)=default
StandingWaveoperator= (StandingWave &&)=default
auto get_clone () const -> std::unique_ptr< evolution::initial_data::InitialData > override
tuples::TaggedTuple< Tags::Psi, Tags::Pi, Tags::Phi< Dim > > variables (const tnsr::I< DataVector, Dim > &x, double t, tmpl::list< Tags::Psi, Tags::Pi, Tags::Phi< Dim > >) const
 Retrieve the evolution variables at time t and spatial coordinates x
tuples::TaggedTuple<::Tags::dt< Tags::Psi >, ::Tags::dt< Tags::Pi >, ::Tags::dt< Tags::Phi< Dim > > > variables (const tnsr::I< DataVector, Dim > &x, double t, tmpl::list<::Tags::dt< Tags::Psi >, ::Tags::dt< Tags::Pi >, ::Tags::dt< Tags::Phi< Dim > > >) const
 Retrieve the time derivatives of the evolution variables.
void pup (PUP::er &p) override

Static Public Attributes

static constexpr size_t volume_dim = Dim
static constexpr Options::String help

Friends

template<size_t LocalDim>
bool operator== (const StandingWave< LocalDim > &lhs, const StandingWave< LocalDim > &rhs)
template<size_t LocalDim>
bool operator!= (const StandingWave< LocalDim > &lhs, const StandingWave< LocalDim > &rhs)

Detailed Description

template<size_t Dim>
class ScalarWave::Solutions::StandingWave< Dim >

A standing wave solution to the Euclidean wave equation.

The solution is given by \(\Psi(\vec{x},t) = A \sin(\vec{k} \cdot (\vec{x} - \vec{x_0})) \cos(\omega t)\) with the wave vector \(\vec{k}\), frequency \(\omega = ||\vec{k}||\), amplitude \(A\), and center \(\vec{x_0}\). The first-order variables follow the ScalarWave conventions \(\Pi = -\partial_t \Psi\) and \(\Phi_i = \partial_i \Psi\).

At \(t = 0\) this gives \(\Pi = 0\), meaning the initial data decomposes into equal left-moving and right-moving components.

Template Parameters
Dimthe spatial dimension of the solution

Member Typedef Documentation

◆ tags

template<size_t Dim>
using ScalarWave::Solutions::StandingWave< Dim >::tags
Initial value:
tmpl::list<Tags::Psi, Tags::Pi, Tags::Phi<Dim>, ::Tags::dt<Tags::Psi>,
Prefix indicating a time derivative.
Definition Prefixes.hpp:29

Member Function Documentation

◆ get_clone()

template<size_t Dim>
auto ScalarWave::Solutions::StandingWave< Dim >::get_clone ( ) const -> std::unique_ptr< evolution::initial_data::InitialData >
overridevirtual

Member Data Documentation

◆ help

template<size_t Dim>
Options::String ScalarWave::Solutions::StandingWave< Dim >::help
staticconstexpr
Initial value:
= {
"A standing wave solution of the Euclidean wave equation. "
"Psi = A sin(k.(x-x0)) cos(omega t), with omega = |k|. "
"At t=0, Pi=0 so the wave has equal left- and right-moving components."}

The documentation for this class was generated from the following file:
  • src/PointwiseFunctions/AnalyticSolutions/WaveEquation/StandingWave.hpp