Wraps any analytic InitialData and adds uniform random noise to selected evolution variables after the inner solution has initialized them.
Details
The inner solution first sets all evolution variables in the normal way. Then each variable whose db::tag_name appears in Variables (or every variable if All is listed) has independent noise from \(\text{Uniform}[-A,\,A]\) added to every grid point and every independent tensor component. If AmplitudeType is Absolute, \(A\) is Amplitude. If AmplitudeType is Relative, \(A\) is Amplitude times the maximum absolute value of the variable on the element, taken over all of its independent components and grid points. Relative noise is therefore suited to systems whose variables differ greatly in magnitude. Because the maximum is computed element by element, \(A\) can differ slightly between elements, and a variable that is identically zero on an element (e.g. Pi for Minkowski) receives no noise there; use Absolute to perturb such variables.
Valid variable names are the db::tag_names of the system's evolution variables. Examples:
- ScalarWave: Psi, Pi, Phi
- GeneralizedHarmonic: SpacetimeMetric, Pi, Phi
Different elements receive independent noise because the RNG seed is mixed with the inertial coordinates of each element's first grid point. Set Seed to a fixed integer for reproducible results.
- Note
- Only analytic initial data (analytic solutions or analytic data) are supported as the inner Solution.
-
Nesting WithNoise inside WithNoise is not supported.
-
Systems with primitive and conservative variables (e.g. ValenciaDivClean, NewtonianEuler) are not yet supported and trigger a static_assert in evolution::Initialization::Actions::SetVariables.
-
GeneralizedHarmonic systems: the initialization phase InitializeInitialDataDependentQuantities runs gh::gauges::SetPiAndPhiFromConstraints after WithNoise applies noise. That action unconditionally overwrites Phi with the numerical spatial derivative of SpacetimeMetric and recomputes Pi from the gauge source function and the current geometry. As a result, noise added to Pi or Phi is effectively erased. Only noise added to SpacetimeMetric persists and propagates into the other variables: it appears in Phi amplified by roughly one over the grid spacing (due to differentiation), and in Pi through the geometric quantities (lapse, shift) extracted from the metric.
Example input-file snippet for ScalarWave:
InitialData:
WithNoise:
Amplitude: 1.0e-6
AmplitudeType: Absolute
Seed: 42
Variables: [Psi, Pi]
Solution:
PlaneWave:
...