|
|
bool | operator== (const NumericData &lhs, const NumericData &rhs) |
|
bool | operator!= (const NumericData &lhs, const NumericData &rhs) |
|
std::ostream & | operator<< (std::ostream &os, NoiseAmplitudeType value) |
| template<typename TensorType> |
| void | add_noise_to_tensor (gsl::not_null< TensorType * > tensor, double amplitude, NoiseAmplitudeType amplitude_type, size_t element_seed, size_t component_offset) |
| | Add uniform random noise to all stored components of tensor.
|
| template<size_t Dim> |
| size_t | make_element_seed (size_t base_seed, const tnsr::I< DataVector, Dim, Frame::Inertial > &inertial_coords) |
| | Combine base_seed with the first grid point of inertial_coords to produce a per-element RNG seed.
|
Namespace for things related to initial data used for evolution systems.
template<typename TensorType>
| void evolution::initial_data::add_noise_to_tensor |
( |
gsl::not_null< TensorType * > | tensor, |
|
|
double | amplitude, |
|
|
NoiseAmplitudeType | amplitude_type, |
|
|
size_t | element_seed, |
|
|
size_t | component_offset ) |
Add uniform random noise to all stored components of tensor.
Each independent stored component receives noise drawn independently from \(\text{Uniform}[-A,\,A]\). For NoiseAmplitudeType::Absolute, \(A\) is amplitude. For NoiseAmplitudeType::Relative, \(A\) is amplitude times the maximum absolute value over all stored components and grid points of tensor, so a tensor that is identically zero receives no noise. The RNG seed for component \(i\) is hash(element_seed, component_offset + i), so calling this function with different component_offset values keeps separate tensor fields independent even when element_seed is the same.
- Parameters
-
| tensor | Tensor to perturb in place. |
| amplitude | Sets \(\pm A\) of the noise interval (absolute or relative, depending on amplitude_type). |
| amplitude_type | Whether amplitude is absolute or relative to the maximum absolute value of tensor. |
| element_seed | Per-element seed, typically constructed by hashing a base seed with the inertial coordinates of the element's first grid point. |
| component_offset | Offset added to the component index before hashing, used to keep different tensor fields independent. |