Documentation 6b54b78464
Loading...
Searching...
No Matches
random_toolbox.hpp File Reference

Collection of utility functions for random number generation. More...

#include <cstdint>
#include "../option_structure.hpp"

Go to the source code of this file.

Namespaces

namespace  RandomToolbox
 

Functions

uint64_t RandomToolbox::GetHash (unsigned long nodeIndex, unsigned short iDim, unsigned long timeIter)
 Generate a deterministic 64-bit hash from three integers.
 
double RandomToolbox::HashToUniform (uint64_t x)
 Convert a 64-bit hash into a uniform double in (0,1]. Uses the top 53 bits of the hash to fill the mantissa of a double. Ensures the result is never zero, suitable for Box-Muller transform.
 
double RandomToolbox::HashToNormal (uint64_t x)
 Generate a standard normal random number from a 64-bit hash. Uses two deterministic uniforms derived from the hash and its bitwise NOT as inputs to the Box-Muller transform.
 
double RandomToolbox::GetNormal (unsigned long nodeIndex, unsigned long dim, unsigned long timeIter)
 Generate a deterministic standard normal number for a cell, dimension, and timestep.
 
template<class T >
T RandomToolbox::GetBesselZero (const T &x)
 Compute modified bessel function of first kind (order 0).
 
template<class T >
T RandomToolbox::GetBesselIntegral (const T &beta_x, const T &beta_y, const T &beta_z)
 Compute integral involving the product of three modified Bessel functions. Useful for scaling the smoothed stochastic source terms in Langevin equations.
 

Detailed Description

Collection of utility functions for random number generation.

Version
8.5.0 "Harrier"

SU2 Project Website: https://su2code.github.io

The SU2 Project is maintained by the SU2 Foundation (http://su2foundation.org)

Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)

SU2 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

SU2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with SU2. If not, see http://www.gnu.org/licenses/.