|
Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
|
Namespace to contain various utilities for the interface reconstruction kernels. More...
Classes | |
| struct | Characteristic |
| A struct for the characteristic variables. We use the same notation as Stone et al. 2008 where the variable. More... | |
| struct | EigenVecs |
| struct | InterfaceState |
Enumerations | |
| enum | Kind { pcm , plmp , plmc , ppmp , ppmc } |
This enum is used to select which reconstructor to use. The idea is that either one of its implicitly defined members (i.e. not chosen) can be used to tell a kernel which reconstruction to perform and the member chosen can be used to indicate which reconstruction method was chosen at compile time. I.e. in a Van Leer integrator the pcm member would be passed to the first riemann solve to tell it to use PCM reconstruction and chosen would be passed to the second riemann solve to indicate which higher order reconstruction it should use. | |
Functions | |
| template<uint direction> | |
| reconstruction::InterfaceState __device__ __host__ | PCM_Reconstruction (Real const *dev_conserved, size_t const xid, size_t const yid, size_t const zid, size_t const nx, size_t const ny, size_t const n_cells, Real const gamma) |
| Perform PCM reconstruction for a given cell. | |
| void __device__ __host__ | PLM_Characteristic_Evolution (hydro_utilities::Primitive const &cell_i, hydro_utilities::Primitive const &del_m, Real const dt, Real const dx, Real const gamma, hydro_utilities::Primitive &interface_R_imh, hydro_utilities::Primitive &interface_L_iph) |
| Perform characteristic tracing/evolution on an interface. | |
| template<uint direction> | |
| auto __device__ | PLM_Reconstruction (Real *dev_conserved, int const xid, int const yid, int const zid, int const nx, int const ny, int const nz, Real const dx, Real const dt, Real const gamma) |
| This is the device function that actually does the piecewise linear reconstruction. | |
| template<int reconstruction_order, uint direction> | |
| void __device__ __host__ | Reconstruct_Interface_States (Real const *dev_conserved, size_t const xid, size_t const yid, size_t const zid, size_t const nx, size_t const ny, size_t const n_cells, Real const gamma, reconstruction::InterfaceState &left_interface, reconstruction::InterfaceState &right_interface) |
| template<int order> | |
| bool __device__ __host__ | Thread_Guard (int const &nx, int const &ny, int const &nz, int const &xid, int const &yid, int const &zid) |
| Determine if a thread is within the allowed range. | |
| hydro_utilities::Primitive __device__ __host__ | Load_Data (Real const *dev_conserved, size_t const &xid, size_t const &yid, size_t const &zid, size_t const &nx, size_t const &ny, size_t const &n_cells, size_t const &o1, size_t const &o2, size_t const &o3, Real const &gamma) |
| Load the data for reconstruction. | |
| template<int reconstruction> | |
| bool __device__ __host__ | Riemann_Thread_Guard (size_t const nx, size_t const ny, size_t const nz, size_t const xid, size_t const yid, size_t const zid) |
| Determine if a thread is within the allowed range. | |
| hydro_utilities::Primitive __device__ __host__ | Compute_Slope (hydro_utilities::Primitive const &left, hydro_utilities::Primitive const &right, Real const &coef=1.0) |
Compute a simple slope. Equation is coef * (right - left). | |
| hydro_utilities::Primitive __device__ __host__ | Compute_Van_Leer_Slope (hydro_utilities::Primitive const &left_slope, hydro_utilities::Primitive const &right_slope) |
| Compute the Van Lear slope from the left and right slopes. | |
| EigenVecs __device__ | Compute_Eigenvectors (hydro_utilities::Primitive const &primitive, Real const &gamma) |
| Compute the eigenvectors in the given cell. | |
| Characteristic __device__ | Primitive_To_Characteristic (hydro_utilities::Primitive const &primitive, hydro_utilities::Primitive const &primitive_slope, EigenVecs const &eigen, Real const &gamma) |
| Project from the primitive variables slopes to the characteristic variables slopes. Stone Eqn 37. Use the eigenvectors given in Stone 2008, Appendix A. | |
| hydro_utilities::Primitive __device__ __host__ | Characteristic_To_Primitive (hydro_utilities::Primitive const &primitive, Characteristic const &characteristic_slope, EigenVecs const &eigen, Real const &gamma) |
| Project from the characteristic variables slopes to the primitive variables slopes. Stone Eqn 39. Use the eigenvectors given in Stone 2008, Appendix A. | |
| Real __device__ __host__ | Van_Leer_Limiter (Real const &left, Real const &right, Real const ¢ered, Real const &van_leer) |
| Compute the limited slope using the Van Leer limiter. | |
| Characteristic __device__ __host__ | Van_Leer_Limiter (Characteristic const &del_a_L, Characteristic const &del_a_R, Characteristic const &del_a_C, Characteristic const &del_a_G) |
| Limit the charactistic slopes. This is an overload that take reconstruction::Characteristic variables instead of Reals as arguments. Note that it does not limit the gas energy or scalars. | |
| hydro_utilities::Primitive __device__ __host__ | Van_Leer_Limiter (hydro_utilities::Primitive const &del_L, hydro_utilities::Primitive const &del_R, hydro_utilities::Primitive const &del_C, hydro_utilities::Primitive const &del_G) |
| Limit the primitive slopes. This is an overload that take reconstruction::Primitive variables instead of Reals as arguments. | |
| void __device__ __host__ | Monotonize_Parabolic_Interface (hydro_utilities::Primitive const &cell_i, hydro_utilities::Primitive const &cell_im1, hydro_utilities::Primitive const &cell_ip1, hydro_utilities::Primitive &interface_L_iph, hydro_utilities::Primitive &interface_R_imh) |
| Monotonize the parabolic interface states. | |
| hydro_utilities::Primitive __device__ __host__ | Calc_Interface_Linear (hydro_utilities::Primitive const &primitive, hydro_utilities::Primitive const &slopes, Real const &sign) |
| Compute the interface state from the slope and cell centered state using linear interpolation. | |
| hydro_utilities::Primitive __device__ __host__ | Calc_Interface_Parabolic (hydro_utilities::Primitive const &cell_i, hydro_utilities::Primitive const &cell_im1, hydro_utilities::Primitive const &slopes_i, hydro_utilities::Primitive const &slopes_im1) |
| Compute the interface state for the CTU version fo the reconstructor from the slope and cell centered state using parabolic interpolation. | |
| void __device__ __host__ | PPM_Single_Variable (Real const &cell_im2, Real const &cell_im1, Real const &cell_i, Real const &cell_ip1, Real const &cell_ip2, Real &interface_L_iph, Real &interface_R_imh) |
| Compute the PPM interface state for a given field/stencil. | |
| void __device__ __host__ | Write_Data (hydro_utilities::Primitive const &interface_state, Real *dev_interface, Real const *dev_conserved, size_t const &id, size_t const &n_cells, size_t const &o1, size_t const &o2, size_t const &o3, Real const &gamma) |
| Write the interface data to the appropriate arrays. | |
Namespace to contain various utilities for the interface reconstruction kernels.
|
inline |
Compute the interface state from the slope and cell centered state using linear interpolation.
| [in] | primitive | The cell centered state |
| [in] | slopes | The slopes |
| [in] | sign | Whether to add or subtract the slope. +1 to add it and -1 to subtract it |
|
inline |
Compute the interface state for the CTU version fo the reconstructor from the slope and cell centered state using parabolic interpolation.
| [in] | cell_i | The state in cell i |
| [in] | cell_im1 | The state in cell i-1 |
| [in] | slopes_i | The slopes in cell i |
| [in] | slopes_im1 | The slopes in cell i-1 |
|
inline |
Project from the characteristic variables slopes to the primitive variables slopes. Stone Eqn 39. Use the eigenvectors given in Stone 2008, Appendix A.
| [in] | primitive | The primitive variables |
| [in] | characteristic_slope | The characteristic slopes |
| [in] | eigen | The eigenvectors |
| [in] | gamma | The adiabatic index |
|
inline |
Compute the eigenvectors in the given cell.
| [in] | primitive | The primitive variables in a particular cell |
| [in] | gamma | The adiabatic index |
|
inline |
Compute a simple slope. Equation is coef * (right - left).
| [in] | left | The data with the lower index (on the "left" side) |
| [in] | right | The data with the higher index (on the "right" side) |
| [in] | coef | The coefficient to multiply the slope by. Defaults to 1.0 |
|
inline |
Compute the Van Lear slope from the left and right slopes.
| [in] | left_slope | The left slope |
| [in] | right_slope | The right slope |
|
inline |
Load the data for reconstruction.
| [in] | dev_conserved | The conserved array |
| [in] | xid | The xid of the cell to load data from |
| [in] | yid | The yid of the cell to load data from |
| [in] | zid | The zid of the cell to load data from |
| [in] | nx | Size in the X direction |
| [in] | ny | Size in the Y direction |
| [in] | n_cells | The total number of cells |
| [in] | o1 | Directional parameter |
| [in] | o2 | Directional parameter |
| [in] | o3 | Directional parameter |
| [in] | gamma | The adiabatic index |
|
inline |
Monotonize the parabolic interface states.
| [in] | cell_i | The state in cell i |
| [in] | cell_im1 | The state in cell i-1 |
| [in] | cell_ip1 | The state in cell i+1 |
| [in,out] | interface_L_iph | The left interface state at i+1/2 |
| [in,out] | interface_R_imh | The right interface state at i-1/2 |
|
inline |
Perform PCM reconstruction for a given cell.
| direction | The direction that the solve is taking place in. 0=X, 1=Y, 2=Z |
| [in] | dev_conserved | The converved variable array |
| [in] | xid | The x-direction cell id |
| [in] | yid | The y-direction cell id |
| [in] | zid | The z-direction cell id |
| [in] | nx | The number of cells in the x-direction |
| [in] | ny | The number of cells in the y-direction |
| [in] | n_cells | The total number of cells |
| [in] | gamma | The adiabatic index |
|
inline |
Perform characteristic tracing/evolution on an interface.
| [in] | cell_i | The cell state at cell i |
| [in] | del_m | The limited slopes |
| [in] | dt | The time step |
| [in] | dx | The cell size in the direction of solve |
| [in] | gamma | The adiabatic index |
| interface_R_imh | The R interface at i-1/2 | |
| interface_L_iph | The L interface at i+1/2 |
|
inline |
This is the device function that actually does the piecewise linear reconstruction.
| direction | The direction that the solve is taking place in. 0=X, 1=Y, 2=Z |
| dev_conserved | The conserved variable array |
| xid | The x index of the cell in the center of the stencil |
| yid | The y index of the cell in the center of the stencil |
| zid | The z index of the cell in the center of the stencil |
| nx | The number of cells in the x-direction |
| ny | The number of cells in the y-direction |
| nz | The number of cells in the z-direction |
| dx | The width of the cells in the direction of the solve |
| dt | The time step |
| gamma | The adiabatic index |
|
inline |
Compute the PPM interface state for a given field/stencil.
This method is heavily based on the implementation in Athena++. See the following papers for details
| [in] | cell_im2 | The value of the field/stencil at i-2 |
| [in] | cell_im1 | The value of the field/stencil at i-1 |
| [in] | cell_i | The value of the field/stencil at i |
| [in] | cell_ip1 | The value of the field/stencil at i+1 |
| [in] | cell_ip2 | The value of the field/stencil at i+2 |
| [out] | interface_L_iph | The left interface at the i+1/2 face |
| [out] | interface_R_imh | The right interface at the i-1/2 face |
|
inline |
Project from the primitive variables slopes to the characteristic variables slopes. Stone Eqn 37. Use the eigenvectors given in Stone 2008, Appendix A.
| [in] | primitive | The primitive variables |
| [in] | primitive_slope | The primitive variables slopes |
| [in] | EigenVecs | The eigenvectors |
| [in] | gamma | The adiabatic index |
|
inline |
| reconstruction_order | What kind of reconstruction to use, PCM, PLMC, etc. This argument should always be a member of the reconstruction::Kind enum, behaviour is undefined otherwise. |
| direction | The direction that the solve is taking place in. 0=X, 1=Y, 2=Z |
| [in] | dev_conserved | |
| [in] | xid | |
| [in] | yid | |
| [in] | zid | |
| [in] | nx | |
| [in] | ny | |
| [in] | n_cells | |
| [in] | gamma | |
| [out] | left_interface | |
| [out] | right_interface |
|
inline |
Determine if a thread is within the allowed range.
| reconstruction | A member of reconstruction::Kind used to determine the order of reconstruction |
| nx | The number of cells in the X-direction |
| ny | The number of cells in the Y-direction |
| nz | The number of cells in the Z-direction |
| xid | The X thread index |
| yid | The Y thread index |
| zid | The Z thread index |
|
inline |
Determine if a thread is within the allowed range.
| order | The order of the reconstruction. 2 for PLM, 3 for PPM |
| nx | The number of cells in the X-direction |
| ny | The number of cells in the Y-direction |
| nz | The number of cells in the Z-direction |
| xid | The X thread index |
| yid | The Y thread index |
| zid | The Z thread index |
|
inline |
Limit the charactistic slopes. This is an overload that take reconstruction::Characteristic variables instead of Reals as arguments. Note that it does not limit the gas energy or scalars.
| [in] | del_a_L | The left characteristic slopes |
| [in] | del_a_R | The right characteristic slopes |
| [in] | del_a_C | The centered characteristic slopes |
| [in] | del_a_G | The Van Leer characteristic slopes |
|
inline |
Limit the primitive slopes. This is an overload that take reconstruction::Primitive variables instead of Reals as arguments.
| [in] | del_L | The left primitive slopes |
| [in] | del_R | The right primitive slopes |
| [in] | del_C | The centered primitive slopes |
| [in] | del_G | The Van Leer primitive slopes |
|
inline |
Compute the limited slope using the Van Leer limiter.
| [in] | left | The left slope |
| [in] | right | The right slope |
| [in] | centered | The centered slope |
| [in] | van_leer | The Van Leer slope |
|
inline |
Write the interface data to the appropriate arrays.
| [in] | interface_state | The interface state to write |
| [out] | dev_interface | The interface array |
| [in] | dev_conserved | The conserved variables |
| [in] | id | The cell id to write to |
| [in] | n_cells | The total number of cells |
| [in] | o1 | Directional parameter |
| [in] | o2 | Directional parameter |
| [in] | o3 | Directional parameter |
| [in] | gamma | The adiabatic index |