|
WarpX
|
Namespaces | |
| namespace | anyfft |
Functions | |
| amrex::Vector< amrex::Real > | getFornbergStencilCoefficients (int n_order, ablastr::utils::enums::GridType a_grid_type) |
Returns an array of coefficients (Fornberg coefficients), corresponding to the weight of each point in a finite-difference approximation of a derivative (up to order n_order). | |
| void | ReorderFornbergCoefficients (amrex::Vector< amrex::Real > &ordered_coeffs, const amrex::Vector< amrex::Real > &unordered_coeffs, int order) |
Re-orders the Fornberg coefficients so that they can be used more conveniently for finite-order centering operations. For example, for finite-order centering of order 6, the Fornberg coefficients (c_0,c_1,c_2) are re-ordered as (c_2,c_1,c_0,c_0,c_1,c_2). | |
| template<typename TCoord, typename TVal> | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr auto | linear_interp (TCoord x0, TCoord x1, TVal f0, TVal f1, TCoord x) |
| Performs a linear interpolation. | |
| template<typename TCoord, typename TVal> | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr auto | bilinear_interp (TCoord x0, TCoord x1, TCoord y0, TCoord y1, TVal f00, TVal f01, TVal f10, TVal f11, TCoord x, TCoord y) |
| Performs a bilinear interpolation. | |
| template<typename TCoord, typename TVal> | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr auto | trilinear_interp (TCoord x0, TCoord x1, TCoord y0, TCoord y1, TCoord z0, TCoord z1, TVal f000, TVal f001, TVal f010, TVal f011, TVal f100, TVal f101, TVal f110, TVal f111, TCoord x, TCoord y, TCoord z) |
| Performs a trilinear interpolation. | |
| void | set_random_seed (std::string const &random_seed) |
|
constexpr |
Performs a bilinear interpolation.
Performs a bilinear interpolation at (x,y) given the 4 points (x0, y0, f00), (x0, y1, f01), (x1, y0, f10), (x1, y1, f11).
|
nodiscard |
Returns an array of coefficients (Fornberg coefficients), corresponding to the weight of each point in a finite-difference approximation of a derivative (up to order n_order).
| [in] | n_order | order of the finite-difference approximation |
| [in] | a_grid_type | type of grid (collocated or not) |
|
constexpr |
Performs a linear interpolation.
Performs a linear interpolation at x given the 2 points (x0, f0) and (x1, f1)
| void ablastr::math::ReorderFornbergCoefficients | ( | amrex::Vector< amrex::Real > & | ordered_coeffs, |
| const amrex::Vector< amrex::Real > & | unordered_coeffs, | ||
| int | order ) |
Re-orders the Fornberg coefficients so that they can be used more conveniently for finite-order centering operations. For example, for finite-order centering of order 6, the Fornberg coefficients (c_0,c_1,c_2) are re-ordered as (c_2,c_1,c_0,c_0,c_1,c_2).
| [in,out] | ordered_coeffs | host vector where the re-ordered Fornberg coefficients will be stored |
| [in] | unordered_coeffs | host vector storing the original sequence of Fornberg coefficients |
| [in] | order | order of the finite-order centering along a given direction |
| void ablastr::math::set_random_seed | ( | std::string const & | random_seed | ) |
Set the global random seed for AMReX.
With "default", the random seed is fixed. With "random", the random seed is determined using std::random_device and std::clock() and thus every simulation run produces different random numbers.
If a strictly positive integer is provided, the random seed for each MPI rank is (mpi_rank+1) * n, where mpi_rank starts from 0. n = 1 and random_seed = "default" produce the default random seed. Note that when GPU simulations are run, one should not expect to obtain the same random numbers, even if a fixed random_seed is provided.
| [in] | random_seed | allowed values are "default", "random", and strictly positive integers |
|
constexpr |
Performs a trilinear interpolation.
Performs a trilinear interpolation at (x,y,z) given the 8 points (x0, y0, z0, f000), (x0, y0, z1, f001), (x0, y1, z0, f010), (x0, y1, z1, f011), (x1, y0, z0, f100), (x1, y0, z1, f101), (x1, y1, z0, f110), (x1, y1, z1, f111)