Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
hydro_cuda.h
Go to the documentation of this file.
1
4#ifndef HYDRO_CUDA_H
5#define HYDRO_CUDA_H
6
7#include "../global/global.h"
8#include "../hydro/average_cells.h"
9#include "../utils/mhd_utilities.h"
10
11__global__ void Update_Conserved_Variables_1D(Real *dev_conserved, Real *dev_F, int n_cells, int x_off, int n_ghost,
12 Real dx, Real xbound, Real dt, Real gamma, int n_fields, int custom_grav);
13
14__global__ void Update_Conserved_Variables_2D(Real *dev_conserved, Real *dev_F_x, Real *dev_F_y, int nx, int ny,
15 int x_off, int y_off, int n_ghost, Real dx, Real dy, Real xbound,
16 Real ybound, Real dt, Real gamma, int n_fields, int custom_grav);
17
18__global__ void Update_Conserved_Variables_3D(Real *dev_conserved, Real *Q_Lx, Real *Q_Rx, Real *Q_Ly, Real *Q_Ry,
19 Real *Q_Lz, Real *Q_Rz, Real *dev_F_x, Real *dev_F_y, Real *dev_F_z,
20 int nx, int ny, int nz, int x_off, int y_off, int z_off, int n_ghost,
21 Real dx, Real dy, Real dz, Real xbound, Real ybound, Real zbound, Real dt,
22 Real gamma, int n_fields, int custom_grav, Real density_floor,
23 Real *dev_potential);
24
25__global__ void PostUpdate_Conserved_Correct_Crashed_3D(Real *dev_conserved, int nx, int ny, int nz, int x_off,
26 int y_off, int z_off, int n_ghost, Real gamma, int n_fields,
27 SlowCellConditionChecker slow_check, int *any_error);
28
44__device__ __host__ Real hydroInverseCrossingTime(Real const &E, Real const &d, Real const &d_inv, Real const &vx,
45 Real const &vy, Real const &vz, Real const &dx, Real const &dy,
46 Real const &dz, Real const &gamma);
47
66__device__ __host__ Real mhdInverseCrossingTime(Real const &E, Real const &d, Real const &d_inv, Real const &vx,
67 Real const &vy, Real const &vz, Real const &avgBx, Real const &avgBy,
68 Real const &avgBz, Real const &dx, Real const &dy, Real const &dz,
69 Real const &gamma);
70
71__global__ void Calc_dt_3D(Real *dev_conserved, Real *dev_dti, Real gamma, int n_ghost, int n_fields, int nx, int ny,
72 int nz, Real dx, Real dy, Real dz);
73
74Real Calc_dt_GPU(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int n_fields, Real dx, Real dy, Real dz,
75 Real gamma);
76
77#ifdef TEMPERATURE_CEILING
78void Temperature_Ceiling(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int n_fields, Real gamma,
79 Real T_ceiling);
80#endif // TEMPERATURE CEILING
81
82void Apply_Temperature_Floor(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int n_fields, Real U_floor);
83
84__global__ void Temperature_Floor_Kernel(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int n_fields,
85 Real U_floor, int *counter);
86
87void Apply_Scalar_Floor(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int field_num, Real scalar_floor);
88
89__global__ void Scalar_Floor_Kernel(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int field_num,
90 Real scalar_floor);
91
92__global__ void Partial_Update_Advected_Internal_Energy_1D(Real *dev_conserved, Real *Q_Lx, Real *Q_Rx, int nx,
93 int n_ghost, Real dx, Real dt, Real gamma, int n_fields);
94
95__global__ void Partial_Update_Advected_Internal_Energy_2D(Real *dev_conserved, Real *Q_Lx, Real *Q_Rx, Real *Q_Ly,
96 Real *Q_Ry, int nx, int ny, int n_ghost, Real dx, Real dy,
97 Real dt, Real gamma, int n_fields);
98
99__global__ void Partial_Update_Advected_Internal_Energy_3D(Real *dev_conserved, Real *Q_Lx, Real *Q_Rx, Real *Q_Ly,
100 Real *Q_Ry, Real *Q_Lz, Real *Q_Rz, int nx, int ny, int nz,
101 int n_ghost, Real dx, Real dy, Real dz, Real dt, Real gamma,
102 int n_fields);
103
106__device__ inline bool Cell_Is_Crashed(Real density, Real Etot_density)
107{
108 return (density <= 0.0) || (density != density) || (Etot_density <= 0.0) || (Etot_density != Etot_density);
109}
110
151__device__ bool Average_Cell_All_Fields(int i, int j, int k, int nx, int ny, int nz, int ncells, int n_fields,
152 Real gamma, Real *conserved, int stale_depth,
153 SlowCellConditionChecker slow_check);
154
155__device__ Real Average_Cell_Single_Field(int field_indx, int i, int j, int k, int nx, int ny, int nz, int ncells,
156 Real *conserved);
157
158#endif // HYDRO_CUDA_H
__device__ __host__ Real hydroInverseCrossingTime(Real const &E, Real const &d, Real const &d_inv, Real const &vx, Real const &vy, Real const &vz, Real const &dx, Real const &dy, Real const &dz, Real const &gamma)
Determine the maximum inverse crossing time in a specific cell.
Definition hydro_cuda.cu:430
__device__ bool Cell_Is_Crashed(Real density, Real Etot_density)
Definition hydro_cuda.h:106
__device__ __host__ Real mhdInverseCrossingTime(Real const &E, Real const &d, Real const &d_inv, Real const &vx, Real const &vy, Real const &vz, Real const &avgBx, Real const &avgBy, Real const &avgBz, Real const &dx, Real const &dy, Real const &dz, Real const &gamma)
Determine the maximum inverse crossing time in a specific cell.
Definition hydro_cuda.cu:446
__device__ bool Average_Cell_All_Fields(int i, int j, int k, int nx, int ny, int nz, int ncells, int n_fields, Real gamma, Real *conserved, int stale_depth, SlowCellConditionChecker slow_check)
Overwrites the values in the specified cell with the average of all the values from the (up to) 26 ne...
Definition hydro_cuda.cu:1048
Object that checks whether a given cell meets the conditions for slow-cell averaging....
Definition average_cells.h:15